PyTorch Dynamo 为 range() 参数和切片成员添加索引强制类型转换
英文摘要
This commit introduces index coercion in PyTorch Dynamo for range() arguments and slice members. The change improves Dynamo’s ability to handle Python’s dynamic integer types during tracing, preventing type mismatches in compiled graphs. Authored by guilhermeleobas, it is associated with issue/PR #18. It is a targeted compiler enhancement for PyTorch’s just-in-time compilation pipeline.
中文摘要
该提交为 PyTorch Dynamo 中的 range() 参数和切片成员引入了索引强制类型转换。此改进增强了 Dynamo 在跟踪过程中处理 Python 动态整数类型的能力,避免编译图中的类型不匹配。此改动由 guilhermeleobas 贡献,关联 issue/PR #18,是对 PyTorch 即时编译管线的一次针对性编译器增强。
关键要点
Adds index coercion for range() arguments and slice members in PyTorch Dynamo.
在 PyTorch Dynamo 中为 range() 参数和切片成员添加索引强制类型转换。
Fix potential type errors when Python dynamic integers are used in indexing during graph tracing.
修复了在图跟踪期间将 Python 动态整数用于索引时可能发生的类型错误。
Part of ongoing Dynamo compiler improvements (issue/PR #18).
属于 Dynamo 编译器持续改进的一部分(issue/PR #18)。