# Where is F.conv2d?

**URL:** <https://discuss.pytorch.org/t/where-is-f-conv2d/42452>\
**Category:** Uncategorized\
**Created:** [April 13, 2019, 6:24am UTC](https://discuss.pytorch.org/t/where-is-f-conv2d/42452 "2019-04-13T06:24:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soniya](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Soniya](https://discuss.pytorch.org/u/Soniya)\
**Post date:** [April 13, 2019, 6:24am UTC](https://discuss.pytorch.org/t/where-is-f-conv2d/42452/1 "2019-04-13T06:24:25Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![MariosOreo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mariosoreo/32/18330_2.png) [@MariosOreo](https://discuss.pytorch.org/u/MariosOreo)\
**Post date:** [April 13, 2019, 6:53am UTC](https://discuss.pytorch.org/t/where-is-f-conv2d/42452/2 "2019-04-13T06:53:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Soniya](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Soniya](https://discuss.pytorch.org/u/Soniya)\
**Post date:** [April 13, 2019, 7:00am UTC](https://discuss.pytorch.org/t/where-is-f-conv2d/42452/3 "2019-04-13T07:00:33Z")

</div>

Okay. The ‘torch.nn.functional.conv2d’ includes ‘\_add\_docstr’. What this function do?

---

<div class="post-metadata">

**Author:** ![klory](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/klory/32/5814_2.png) [@klory](https://discuss.pytorch.org/u/klory)\
**Post date:** [April 13, 2019, 9:54pm UTC](https://discuss.pytorch.org/t/where-is-f-conv2d/42452/4 "2019-04-13T21:54:50Z")

</div>

> [@Soniya](#):
>
> \_add\_docstr

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