Where to find the python interface for SpatialDepthwiseConvolution?

Hi, I need to implement a convolution layer with cuda. I read the code in pytorch sources here: https://github.com/pytorch/pytorch/blob/master/aten/src/THCUNN/SpatialDepthwiseConvolution.cu. However I did not find its interface that I can invoke in python? I have also looked for it in the legacy interface, it was not there either. Where did it go?

Thanks in advance.

Hi,

So indeed, this is the kernel that computed the forward pass.
It is called from this function that performs the forward pass.
This one is used in an automatically generated wrapper called CudaSpatialDepthwiseConvolution_updateOutput which is then exposed to python as CudaSpatialDepthwiseConvolution_updateOutput (same name). Which you can then access from python at torch._C._THNN.CudaSpatialDepthwiseConvolution_updateOutput. :slight_smile:

1 Like

Briliant, it’s hard to find it out.

Yes it’s slightly tricky especially since some of the binding are in generated files that are not in the repo originally.
I would recommand compiling from source and then looking for the function name in the folder where you compiled. That way, your search is going to include all the generated files !

Thanks for your advice, it is very useful for me!