# Implement a custom function inside the model

**URL:** <https://discuss.pytorch.org/t/implement-a-custom-function-inside-the-model/57153>\
**Category:** vision\
**Created:** [September 30, 2019, 8:41am UTC](https://discuss.pytorch.org/t/implement-a-custom-function-inside-the-model/57153 "2019-09-30T08:41:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Alex\_K](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alex_k/32/13258_2.png) [@Alex\_K](https://discuss.pytorch.org/u/Alex_K)\
**Post date:** [October 8, 2019, 7:22am UTC](https://discuss.pytorch.org/t/implement-a-custom-function-inside-the-model/57153/3 "2019-10-08T07:22:46Z")

</div>

Thanks a lot!  
In this case, shall I implement `backwards` method, how described here? [Defining backward() function in nn.module?](https://discuss.pytorch.org/t/defining-backward-function-in-nn-module/5047)

---

_[View the full topic](https://discuss.pytorch.org/t/implement-a-custom-function-inside-the-model/57153)._
