kou commented on code in PR #46381:
URL: https://github.com/apache/arrow/pull/46381#discussion_r2082981566


##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.
+ * @length: (out): return location for the number of elements in the returned 
array.
+ *
+ * Returns: (array length=length): Shape of tensor elements.
+ */
+const gint64 *
+garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType 
*object,
+                                              gsize *length)
+{
+  const auto priv = GARROW_DATA_TYPE_GET_PRIVATE(object);
+  auto arrow_data_type =
+    
std::static_pointer_cast<arrow::extension::FixedShapeTensorType>(priv->data_type);
+
+  *length = arrow_data_type->shape().size();
+  return arrow_data_type->shape().data();

Review Comment:
   ```suggestion
     const auto& arrow_shape = arrow_data_type->shape();
     *length = shape.size();
     return shape.data();
   ```



##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.
+ * @length: (out): return location for the number of elements in the returned 
array.
+ *
+ * Returns: (array length=length): Shape of tensor elements.
+ */
+const gint64 *
+garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType 
*object,
+                                              gsize *length)
+{
+  const auto priv = GARROW_DATA_TYPE_GET_PRIVATE(object);
+  auto arrow_data_type =
+    
std::static_pointer_cast<arrow::extension::FixedShapeTensorType>(priv->data_type);

Review Comment:
   ```suggestion
     auto arrow_data_type =
       
std::static_pointer_cast<arrow::extension::FixedShapeTensorType>(garrow_data_type_get_raw(data_type));
   ```



##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.
+ * @length: (out): return location for the number of elements in the returned 
array.
+ *
+ * Returns: (array length=length): Shape of tensor elements.

Review Comment:
   ```suggestion
    * Returns: (array length=length): Shape of the tensor.
   ```



##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.
+ * @length: (out): return location for the number of elements in the returned 
array.
+ *
+ * Returns: (array length=length): Shape of tensor elements.
+ */
+const gint64 *
+garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType 
*object,

Review Comment:
   ```suggestion
   garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType 
*data_type,
   ```



##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.

Review Comment:
   ```suggestion
    * @data_type: A #GArrowFixedShapeTensorDataType.
   ```



##########
c_glib/arrow-glib/basic-data-type.cpp:
##########
@@ -2347,6 +2347,25 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType 
*value_type,
   return data_type;
 }
 
+/**
+ * garrow_fixed_shape_tensor_data_type_get_shape:
+ * @object: A #GArrowDataType of individual tensor elements.
+ * @length: (out): return location for the number of elements in the returned 
array.

Review Comment:
   ```suggestion
    * @length: (out): Return location for the number of dimensions of the 
tensor.
   ```



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