Describe the bug
dlpack doesn't work on mps tensors.
To Reproduce
Include code snippet
>>> import torch
>>> import mlx.core as mx
>>> mx.array(torch.tensor([1,2,3]).to("mps"))
Exception ignored in PyObject_HasAttrString(); consider using PyObject_HasAttrStringWithError(), PyObject_GetOptionalAttrString() or PyObject_GetAttrString():
Traceback (most recent call last):
File "<python-input-7>", line 1, in <module>
RuntimeError: imag is not implemented for tensors with non-complex dtypes.
Exception ignored in PyObject_HasAttrString(); consider using PyObject_HasAttrStringWithError(), PyObject_GetOptionalAttrString() or PyObject_GetAttrString():
Traceback (most recent call last):
File "<python-input-7>", line 1, in <module>
RuntimeError: imag is not implemented for tensors with non-complex dtypes.
Traceback (most recent call last):
File "<python-input-7>", line 1, in <module>
mx.array(torch.tensor([1,2,3]).to("mps"))
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Invalid type torch.Tensor received in array initialization.
>>> mx.array(torch.tensor([1,2,3]).to("cpu"))
array([1, 2, 3], dtype=int64)
>>>
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
>>> mx.__version__
'0.30.0'
Additional context
Add any other context about the problem here.
Describe the bug
dlpack doesn't work on mps tensors.
To Reproduce
Include code snippet
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.