Where is F.conv2d?

Hi Everyone !

I’m curious to see the forward and backward coded file for torch.nn.Conv2d. I have gone through the file ‘conv.py’ in ‘anaconda3/lib/python3.5/site-packages/torch/nn/modules’. In the forward call, it uses F.conv2d function. But i’m unable to find it. Please help me. A snapshot of the ‘conv.py’ function is as follows.

@weak_module
class Conv2d(_ConvNd):
def init(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True):
kernel_size = _pair(kernel_size)
stride = _pair(stride)
padding = _pair(padding)
dilation = _pair(dilation)
super(Conv2d, self).init(
in_channels, out_channels, kernel_size, stride, padding, dilation,
False, _pair(0), groups, bias)

@weak_script_method
def forward(self, input):
    return F.conv2d(input, self.weight, self.bias, self.stride,
                    self.padding, self.dilation, self.groups)

F.conv2d just means torch.nn.functional.conv2d.

Okay. The ‘torch.nn.functional.conv2d’ includes ‘_add_docstr’. What this function do?

I guess that is some inner functions, you do not need to touch it.