pytorch/torch/_export/serde
angelayi ea10c072f3 [export] Deserialize args with python keyword names (#136036)
Currently when we deserialize inputs to nodes, we deserialize arguments with default values as kwargs. So deserializing `aten.uniform`, which has the signature `uniform(Tensor(a!) self, float from=0, float to=1, *, Generator? generator=None) -> Tensor(a!)`, will get become `uniform(x, from=0, to=1)`. However, this fails when running in python because `from` is a python keyword. So the solution here is to not deserialize it as a kwarg.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136036
Approved by: https://github.com/zhxchen17
2024-09-17 18:13:14 +00:00
..
__init__.py
aoti_schema.py [aoti] Add initial custom op support (#127034) 2024-07-24 20:29:55 +00:00
dynamic_shapes.py [export] dynamic_shapes serialization, load/dump (#134718) 2024-09-05 05:39:44 +00:00
schema_check.py Flip default value for mypy disallow_untyped_defs [2/11] (#127839) 2024-06-08 18:23:08 +00:00
schema.py [export] Record the global torch version in serialization. (#135243) 2024-09-06 17:02:06 +00:00
schema.yaml [export] Record the global torch version in serialization. (#135243) 2024-09-06 17:02:06 +00:00
serialize.py [export] Deserialize args with python keyword names (#136036) 2024-09-17 18:13:14 +00:00
union.py Flip default value for mypy disallow_untyped_defs [2/11] (#127839) 2024-06-08 18:23:08 +00:00