# Implementing a custom convolution using conv2d\_input and conv2d\_weight

**URL:** <https://discuss.pytorch.org/t/implementing-a-custom-convolution-using-conv2d-input-and-conv2d-weight/18556>\
**Category:** Uncategorized\
**Created:** [May 23, 2018, 8:27am UTC](https://discuss.pytorch.org/t/implementing-a-custom-convolution-using-conv2d-input-and-conv2d-weight/18556 "2018-05-23T08:27:36Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![arman-yekkehkhani](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/arman-yekkehkhani/32/32661_2.png) [@arman-yekkehkhani](https://discuss.pytorch.org/u/arman-yekkehkhani)\
**Post date:** [September 27, 2021, 9:34pm UTC](https://discuss.pytorch.org/t/implementing-a-custom-convolution-using-conv2d-input-and-conv2d-weight/18556/26 "2021-09-27T21:34:32Z")

</div>

If you are looking for the intuition behind using `at::cudnn_convolution`, you can look [here](https://github.com/pytorch/pytorch/blob/d6133b2fe6b863dd49fb21641bd04e24e19ac794/aten/src/ATen/native/Convolution.cpp). The exact definition of it may vary based on the version of cuDNN, for v7 look [here](https://github.com/pytorch/pytorch/blob/d6133b2fe6b863dd49fb21641bd04e24e19ac794/aten/src/ATen/native/cudnn/Conv_v7.cpp), and for v8 [here](https://github.com/pytorch/pytorch/blob/d6133b2fe6b863dd49fb21641bd04e24e19ac794/aten/src/ATen/native/cudnn/Conv_v8.cpp).

[Here](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936) is a detailed explanation about `benchmark`.

---

_[View the full topic](https://discuss.pytorch.org/t/implementing-a-custom-convolution-using-conv2d-input-and-conv2d-weight/18556)._
