pytorch
06c98e67 - [ONNX] Fix ignored small eps in layer normalization in fp16 (#89869)

Commit
2 years ago
[ONNX] Fix ignored small eps in layer normalization in fp16 (#89869) Prior to this change, the symbolic_fn `layer_norm` (before ONNX version 17) always lose precision when eps is smaller than Float type, while PyTorch always take eps as Double. This PR adds `onnx::Cast` into eps related operations to prevent losing precision during the calculation. Pull Request resolved: https://github.com/pytorch/pytorch/pull/89869 Approved by: https://github.com/BowenBao
Author
Committer
Parents
Loading