pytorch
de6470e2 - [custom_op] Change the python type that maps to ListType in schema (#101190)

Commit
2 years ago
[custom_op] Change the python type that maps to ListType in schema (#101190) Previously, to specify e.g. int[], a user needed to do Tuple[int, ...]. This PR changes it to Sequence[int]. Bikeshedding: we could totally just use List[int] instead. The types that the user gives us that we use to infer a schema is not entirely faithful: for example, we convert `int` to SymInt. I didn't feel strongly between Sequence[int] and List[int] so I went with the more faithful one, plus Python recommends that you use Sequence for input arguments (over list or tuple), though we don't subscribe to that philosophy in general. Test Plan: - new test Pull Request resolved: https://github.com/pytorch/pytorch/pull/101190 Approved by: https://github.com/bdhirsh
Author
Committer
Parents
Loading