I can't find the source code of _conv_func

_conv_func is in the ConvLayer function.
It is used in “conv_func = _conv_func(ndim, transpose=transpose)”
But I can’t find what it is and its code.

I was trying to answer the question on notebook 15 for the transpose. I need to see the code to understand how it uses the build a transpose convolution.


Thank you if anyone can help me to find the code.

Anything with an _ denotes a private function. 99.9% of the time they exist in the same file as the function calling it. So you should look in layers.py for it.

Thank you. I see it.

It also took me a while to figure out how to do transposed convolution. It’s a bit counter-intuitive to me. It’s called ``stride half convolution’’, but we need to specify stride=2.

im = image2tensor(Image.open('images/grizzly.jpg'))
print(im.shape)
conv = ConvLayer(3, 3, stride=2, padding=1, transpose=True)
c_t = conv(im.unsqueeze(0)/255.0)
print(c_t.shape)