pytorch
2eac8bd2 - [dynamo][numpy] Support ndarray methods (#97537)

Commit
1 year ago
[dynamo][numpy] Support ndarray methods (#97537) This PR adds universal support for ndarray methods. After #100839 each `NumpyNdarrayVariable` should wrap a `torch.Tensor`. This PR adds a `numpy_method_wrapper` which converts the `torch.Tensor` to `torch_np.ndarray` and then call the numpy ndarray method. Then we also try to return a `torch.Tensor` (return as-is if the value is not ndarray-like) Pull Request resolved: https://github.com/pytorch/pytorch/pull/97537 Approved by: https://github.com/ezyang
Author
Committer
Parents
Loading