Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the source code of pytorch conv2d?

Tags:

pytorch

Where do I find the source code of the pytorch function conv2d?

It should be in torch.nn.functional but I only find _add_docstr lines, if i search for conv2d. I looked here:

https://github.com/pytorch/pytorch/blob/master/torch/nn/functional.py

Update: It's is not my typing, I do mean the function. Conv2d class uses conv2d function from the nn.functional

Here:

https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/conv.py

On line 338:

return F.conv2d(F.pad(input, expanded_padding, mode='circular')

F is how they import functional

So then I went there, but I don't find the code.

like image 277
user3435407 Avatar asked Dec 01 '19 15:12

user3435407


1 Answers

The functional code is all implemented in C++. The entry point into the C++ pytorch code for conv2d is here.

like image 195
jodag Avatar answered Oct 22 '22 23:10

jodag