pitrou commented on code in PR #14381:
URL: https://github.com/apache/arrow/pull/14381#discussion_r993348833


##########
ruby/red-arrow/lib/arrow/tensor.rb:
##########
@@ -15,8 +15,140 @@
 # specific language governing permissions and limitations
 # under the License.
 
+require_relative "raw-tensor-converter"
+
 module Arrow
   class Tensor
+    alias_method :initialize_raw, :initialize
+    # Creates a new {Arrow::Tensor}.
+    #
+    # @overload initialize(raw_tensor, data_type: nil, shape: nil, strides: 
nil, dimension_names: nil)
+    #
+    #   @param raw_tensor [::Array<Numeric>] The tensor represented by
+    #     raw `Array` (not `Arrow::Array`) and `Numeric`s. You can
+    #     nested `Array` for multi-dimensions array.
+    #
+    #   @param data_type [Arrow::DataType, String, Symbol, ::Array<String>,
+    #     ::Array<Symbol>, Hash, nil] The element data type of the tensor.
+    #
+    #     If you specify `nil`, data type is guessed from `raw_tensor`.
+    #
+    #     See {Arrow::DataType.resolve} how to specify data type.
+    #
+    #   @param shape [::Array<Integer>, nil] The array of dimension sizes.
+    #
+    #     If you specify `nil`, shape is guessed from `raw_tensor`.
+    #
+    #   @param strides [::Array<Integer>, nil] The array of the number of
+    #     bytes in each dimension.
+    #
+    #     If you specify `nil` or an empty `Array`, strides are
+    #     guessed from `raw_tensor`.
+    #
+    #   @param dimension_names [::Array<String>, ::Array<Symbol>, nil]
+    #     The array of the dimension names.
+    #
+    #     If you specify `nil`, all dimensions doesn't have their names.

Review Comment:
   ```suggestion
       #     If you specify `nil`, all dimensions have empty names.
   ```



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