mirror of
https://github.com/pytorch/pytorch.git
synced 2026-10-28 18:56:51 +08:00
Summary: Fixes https://github.com/pytorch/pytorch/issues/169157. The proxy executor was incorrectly deserializing enum arguments by directly casting serialized integer values to c10 enum types. However, the serialized format (torch._export.serde.schema) uses different enum values than c10. This caused custom ops with dtype arguments (e.g., torch.int8) to receive wrong types at runtime, leading to errors like "unsupport output type". The fix addes enum value mappings and auto-generates C++ conversion code using scripts/export/update_schema.py. Co-authored-by: Claude Pull Request resolved: https://github.com/pytorch/pytorch/pull/173562 Approved by: https://github.com/yushangdi