# How to convert tensorflow's BatchNormalization to pytorch?

**URL:** <https://discuss.pytorch.org/t/how-to-convert-tensorflows-batchnormalization-to-pytorch/166426>\
**Category:** Uncategorized\
**Created:** [November 20, 2022, 3:23am UTC](https://discuss.pytorch.org/t/how-to-convert-tensorflows-batchnormalization-to-pytorch/166426 "2022-11-20T03:23:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuhskeHujisaki](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/yuhskehujisaki/32/48683_2.png) [@YuhskeHujisaki](https://discuss.pytorch.org/u/YuhskeHujisaki)\
**Post date:** [November 20, 2022, 3:23am UTC](https://discuss.pytorch.org/t/how-to-convert-tensorflows-batchnormalization-to-pytorch/166426/1 "2022-11-20T03:23:34Z")

</div>

```auto
BatchNormalization(axis=3, epsilon=1e-05, momentum=0.1)

```

I want to convert this tensoflow code to pytorch, but pytorch does not have axis, how should I convert it?  
Integer, the axis to be normalized (usually the feature axis). For example, set axis=1 in BatchNormalization after a Conv2D layer with data\_format=“channels\_first”. However, pytorch does not allow you to specify an axis.
