Documentation issue: batch_stats in batchnorm need to be marked as mutable even in test/inference
Open
- Dominant language
- Jupyter Notebook
- Stars
- 7.3k
- Forks
- 833
- Avg merge
- 5h 11m
- Merged PRs (30d)
- 5
Description
Apologies that this does not follow the suggested format - this is to report a documentation issue. In [this example](https://github.com/google/flax/blob/cb6843f29d3400d7dab6751d4b693e4862f57d98/docs/guides/training_techniques/batch_norm.rst?plain=1#L290) on the `BatchNorm` documentation page, `batch_stats` needs to be marked as `mutable`. Otherwise, it will fail in `nn.scan` and perhaps other layers that have some sort of `carry`. If it's not marked as mutable, it won't be carried after the first iteration of the loop and will fail during inference/testing.
Contributor guide
Assessment
This issue has not been assessed yet.