pytorch
a7a818d9 - [symint] Make TensorImpl::sizes_and_strides_ contain SymInt

Commit
3 years ago
[symint] Make TensorImpl::sizes_and_strides_ contain SymInt Change our representation of sizes and strides to contain SymInts instead of int64_t. Right now it's not actually possible to create a Tensor with symbolic shape, so this change is intended to be a no-op. But the intended behavior is: - If you create a Tensor with symbolic shape, a `CustomSizes` policy will be set, and the `has_symbolic_sizes_strides_` bit will be set. (not currently implemented) - Calling any TensorImpl function that naively interacts with sizes and strides will throw. For hot-path functions (`sizes()`, `strides()`), we make use of the existing policy check to throw. For others, we just have a regular `TORCH_CHECK(!has_symbolic_sizes_strides_)`. This also undoes the explicit constructor I made in https://github.com/pytorch/pytorch/pull/77666; it ended up being more annoying than useful when making these changes. Pull Request resolved: https://github.com/pytorch/pytorch/pull/77994 Approved by: https://github.com/Krovatkin
Author
suo suo
Committer
Parents
Loading