pytorch
61fd1188 - [Export] Remove the concept of Scalar in export schema (#93211)

Commit
2 years ago
[Export] Remove the concept of Scalar in export schema (#93211) Scalar is a union type of [int, float, bool], it's only needed for the representation of operation schema. During export, we always have the concrete argument. As ex.Argument is already an union type, we don't need Scalar type anymore. Example Here's the schema for aten.add.Scalar ``` add.Scalar(Tensor self, Scalar other, Scalar alpha=1) -> Tensor ``` A fx.node ``` add_tensor: f32[s0, s0] = torch.ops.aten.add.Scalar(arg0, 1.1) ``` would be exported as ``` Node( op='call_function', target='aten.add.Tensor', args=[ Argument(as_tensor=TensorArgument(name='arg0')), Argument(as_float=1.1) ], outputs=[ ReturnArgument(as_tensor=TensorArgument(name='add_tensor')) ] ) ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/93211 Approved by: https://github.com/suo
Author
Committer
Parents
Loading