pitrou commented on issue #38868:
URL: https://github.com/apache/arrow/issues/38868#issuecomment-5524108729

   I don't think this issue is entirely fixed by 
https://github.com/apache/arrow/pull/50929, so I'm leaving it open:
   ```python
   >>> np_arr = np.arange(12, dtype=np.int32).reshape(3, 2, 2)
   >>> a = pa.FixedShapeTensorArray.from_numpy_ndarray(np_arr)
   >>> a.__dlpack__()
   Traceback (most recent call last):
     Cell In[10], line 1
       a.__dlpack__()
     File pyarrow/array.pxi:2331 in pyarrow.lib.Array.__dlpack__
       legacy_tensor = GetResultValue(ExportArrayToDLPack(self.sp_array))
     File pyarrow/error.pxi:155 in pyarrow.lib.pyarrow_internal_check_status
       return check_status(status)
     File pyarrow/error.pxi:92 in pyarrow.lib.check_status
       raise convert_status(status)
   ArrowTypeError: DataType is not compatible with DLPack spec: 
extension<arrow.fixed_shape_tensor[value_type=int32, shape=[2,2], 
permutation=[0,1]]>, try converting to a Tensor for multi dimensional data 
support
   /home/antoine/arrow/dev/cpp/src/arrow/c/dlpack.cc:131  GetDLDataType(type)
   
   >>> a[0]
   <pyarrow.FixedShapeTensorScalar: [0, 1, 2, 3]>
   >>> a[0].__dlpack__()
   Traceback (most recent call last):
     Cell In[12], line 1
       a[0].__dlpack__()
   AttributeError: 'pyarrow.lib.FixedShapeTensorScalar' object has no attribute 
'__dlpack__'
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to