-
Notifications
You must be signed in to change notification settings - Fork 27.7k
PyTorch complex support has NumPy incompatible functions #35494
Copy link
Copy link
Closed
Labels
high prioritymodule: complexRelated to complex number support in PyTorchRelated to complex number support in PyTorchmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Labels
high prioritymodule: complexRelated to complex number support in PyTorchRelated to complex number support in PyTorchmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
🐛 Bug
The new complex number support introduces APIs that are incompatible with NumPy. Some of these functions existed in PyTorch 1.4, but they were practically useless and undocumented.
I'm concerned that this is going to make our life difficult going forward as we try to balance backwards compatibility with NumPy support. In general, we shouldn't be releasing new APIs that are incompatible with NumPy without good reasons.
Here are some examples I found with a few minutes of testing:
Tensor.real()is a function butndarray.realis a propertytorch.real()(andTensor.real()) returns a complex-type Tensor, butnp.real(andndarray.real) return floating-point type arrays:cc @ezyang @gchanan @zou3519 @anjali411 @dylanbespalko