# Change batch norm gammas init

**URL:** <https://discuss.pytorch.org/t/change-batch-norm-gammas-init/81278>\
**Category:** Uncategorized\
**Created:** [May 14, 2020, 10:20pm UTC](https://discuss.pytorch.org/t/change-batch-norm-gammas-init/81278 "2020-05-14T22:20:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![polo5](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/polo5/32/8557_2.png) [@polo5](https://discuss.pytorch.org/u/polo5)\
**Post date:** [May 15, 2020, 8:38am UTC](https://discuss.pytorch.org/t/change-batch-norm-gammas-init/81278/3 "2020-05-15T08:38:53Z")

</div>

Thanks for your help 🙂 However my objective is to change gammas and betas even when they are not learnable (`affine=False`).

By deafault `affine=False` means that gammas are set to 1s, and are not parameters. I want to change this to some other value than 1 and still have BN gammas not learnable.

The best would be to rewrite my own BN module but I can’t figure out where the gammas are set to 1 in the case of `afffine=False` since they are set to None.

Thanks!

---

_[View the full topic](https://discuss.pytorch.org/t/change-batch-norm-gammas-init/81278)._
