pytorch/torch/onnx
Shubham Bhokare 49a923c8b5 [ONNX] Update LayerNorm symbolic to handle autocasting (#52199) (#52350)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52350

When onnx export creates a 0-dim tensor of constant type, this action overrides the type promotion logic as quoted in #9515. In order to prevent this from happening this PR adds the following functionality.
If the data type is a floating point type, it is converted to a 0-dim double tensor, else it is converted to a 0-dim tensor of its original type

Test Plan: Imported from OSS

Reviewed By: malfet

Differential Revision: D26490325

Pulled By: SplitInfinity

fbshipit-source-id: 4c47c69c9b6523d2e45b74c2541d6d8ca7e28fc9
2021-02-19 10:57:15 -08:00
..
__init__.py [ONNX] Enable Constant Folding for ONNX Opset 13 (#51096) (#51523) 2021-02-04 12:44:26 -08:00
operators.py Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
symbolic_caffe2.py [quant][onnx] Support conversion of quantized sigmoid operator from pytorch to caffe2 (#34629) 2020-03-13 22:42:06 -07:00
symbolic_helper.py [ONNX] Update LayerNorm symbolic to handle autocasting (#52199) (#52350) 2021-02-19 10:57:15 -08:00
symbolic_opset7.py Warn about floor_divide performing incorrect rounding (#50281) (#50281) 2021-02-10 03:13:34 -08:00
symbolic_opset8.py Warn about floor_divide performing incorrect rounding (#50281) (#50281) 2021-02-10 03:13:34 -08:00
symbolic_opset9.py [ONNX] Update LayerNorm symbolic to handle autocasting (#52199) (#52350) 2021-02-19 10:57:15 -08:00
symbolic_opset10.py Warn about floor_divide performing incorrect rounding (#50281) (#50281) 2021-02-10 03:13:34 -08:00
symbolic_opset11.py [ONNX] Support list remove for onnx export (#51373) (#51526) 2021-02-04 12:44:40 -08:00
symbolic_opset12.py [ONNX] Fix bug in unfold symbolic (#50504) (#51515) 2021-02-04 12:43:50 -08:00
symbolic_opset13.py onnx export of per channel fake quantize functions (#42835) 2021-02-08 13:09:50 -08:00
symbolic_registry.py Update error message that displays when encountering an op unsupported for ONNX export. (#51387) (#51522) 2021-02-04 12:44:22 -08:00
utils.py Clean up usage of torch._six partially (#49785) 2021-02-08 13:58:34 -08:00