# What pytorch means by buffers?

**URL:** <https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266>\
**Category:** Uncategorized\
**Created:** [May 5, 2021, 2:12am UTC](https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266 "2021-05-05T02:12:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [May 5, 2021, 6:53am UTC](https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2 "2021-05-05T06:53:29Z")

</div>

Buffers are tensors, which are registered in the module and will thus be inside the `state_dict`.  
These tensors do not require gradients and are thus not registered as parameters.  
This is useful e.g. to track the mean and std in batchnorm layers etc. which should be stored and loaded using the `state_dict` of the module.

---

_[View the full topic](https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266)._
