mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
487b6d40ec
Similar to https://github.com/facebookresearch/multimodal/blob/dbeed9724bc9099be173c86871df7d41f3b7e58c/torchmultimodal/modules/layers/normalizations.py#L51 **The implementation here is not optimized and we welcome pull requests to improve this** - Use `normalized_shape` instead of singular integer `dim` to be aligned with the `nn.LayerNorm` implementation - Remove the [upcast to float and downcast ](https://github.com/facebookresearch/multimodal/blob/dbeed9724bc9099be173c86871df7d41f3b7e58c/torchmultimodal/modules/layers/normalizations.py#L73) Differential Revision: [](https://our.internmc.facebook.com/intern/diff/) Differential Revision: [D55485840](https://our.internmc.facebook.com/intern/diff/D55485840) Pull Request resolved: https://github.com/pytorch/pytorch/pull/121364 Approved by: https://github.com/albanD