# 'model.eval()' vs 'with torch.no\_grad()'

**URL:** <https://discuss.pytorch.org/t/model-eval-vs-with-torch-no-grad/19615>\
**Category:** Uncategorized\
**Created:** [June 13, 2018, 8:52am UTC](https://discuss.pytorch.org/t/model-eval-vs-with-torch-no-grad/19615 "2018-06-13T08:52:41Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [January 17, 2019, 9:14pm UTC](https://discuss.pytorch.org/t/model-eval-vs-with-torch-no-grad/19615/17 "2019-01-17T21:14:55Z")

</div>

Have a look at [this post](https://discuss.pytorch.org/t/unclear-behaviour-of-dropout/22890/4?u=ptrblck) for an example why we are scaling the activations.  
Note that the `p` in my explanation refert to the keep probability not the drop probability.

---

_[View the full topic](https://discuss.pytorch.org/t/model-eval-vs-with-torch-no-grad/19615)._
