chengdazhi / Deformable-Convolution-V2-PyTorch

Deformable ConvNets V2 (DCNv2) in PyTorch
MIT License
1.44k stars 229 forks source link

Do deformable convolution of feature_x and feature_z. #1

Closed noUmbrella closed 5 years ago

noUmbrella commented 5 years ago

Can this tools do deformable convolution of feature_x and feature_z, that is both them are not learnable parameters, but two tensor. In other words, dose this tool support F.conv2d(x,z) like in pytorch?

chengdazhi commented 5 years ago

I don't see how pytorch conv2d can accept two feature tensors as input, according to the class definition: https://github.com/pytorch/pytorch/blob/b740b92f3600840e09d4c93f3138333838d1e474/torch/nn/modules/conv.py#L191

Do you mean z is the weight?

noUmbrella commented 5 years ago

Please refer "torch.nn.functional.conv2d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1) " this function.@chengdazhi

chengdazhi commented 5 years ago

So the feature_z is actually the conv's weight? Our operator supports this, you can look into the Functions and the Modules. The Function is a shallow wrapper of the cuda kernels, and the weights are defined and initialized in the Modules. You can easily customize the module to fit your needs.