pytorch
93d75568 - [ONNX] Refactor ShapeInferenceWithFakeTensor to fill metavalue into the original gm (#98760)

Commit
1 year ago
[ONNX] Refactor ShapeInferenceWithFakeTensor to fill metavalue into the original gm (#98760) From https://github.com/pytorch/pytorch/pull/97494#discussion_r1160068456, the passes should modify gm inplace, but before this PR, `ShapeInferenceWithFakeTensor` utilizes Transform.transform() to make a copy of the gm, and rely on the assumption that the topological order of two graphs should be the same. This PR addresses the issue by saving another metavalue `static_shape` into gm for op_level_debug, instead of overwriting `val`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/98760 Approved by: https://github.com/BowenBao
Author
Committer
Parents
Loading