Skip to content

Instantly share code, notes, and snippets.

import torch
from ops.dcn import DeformConvPack # Needs dcn module from https://github.com/open-mmlab/mmdetection
torch.manual_seed(0)
def check_grad():
device = torch.device('cuda')
@MauroPfister
MauroPfister / deform_conv_speed.py
Last active May 8, 2020 12:52
Script to test speed of deformable convolutions
import torch
from torch import nn
import torchvision
from ops.dcn import DeformConv
import time
class NormalConv(nn.Module):
def __init__(self, in_channels, groups):