rok commented on code in PR #37533:
URL: https://github.com/apache/arrow/pull/37533#discussion_r1424680822


##########
python/pyarrow/includes/libarrow.pxd:
##########
@@ -2650,24 +2650,25 @@ cdef extern from "arrow/extension_type.h" namespace 
"arrow":
 
 cdef extern from "arrow/extension/fixed_shape_tensor.h" namespace 
"arrow::extension":
     cdef cppclass CFixedShapeTensorType \
-            " arrow::extension::FixedShapeTensorType"(CExtensionType):
+            " arrow::extension::FixedShapeTensorType"(CExtensionType) nogil:

Review Comment:
   Nice! Changed.



##########
python/pyarrow/array.pxi:
##########
@@ -3518,17 +3518,38 @@ class FixedShapeTensorArray(ExtensionArray):
 
     def to_numpy_ndarray(self):
         """
-        Convert fixed shape tensor extension array to a numpy array (with 
dim+1).
+        Convert fixed shape tensor extension array to a numpy.ndarray with 
zero copy.
+        First dimension of ndarray will be the length of the fixed shape 
tensor array
+        and the rest of the dimensions will match the shape of the fixed shape 
tensor.
+        """
+        return self.to_tensor().to_numpy()
+
+    def to_tensor(self):

Review Comment:
   Added.



-- 
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