You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/12 11:39:13 UTC
[GitHub] [arrow] pitrou commented on a diff in pull request #14381: ARROW-17997: [Ruby] Add support for building Arrow::Tensor from raw nested Ruby array
pitrou commented on code in PR #14381:
URL: https://github.com/apache/arrow/pull/14381#discussion_r993344849
##########
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.
Review Comment:
```suggestion
# raw `Array` (not `Arrow::Array`) and `Numeric`s. You can
# pass a nested `Array` for a multi-dimensional tensor.
```
##########
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
Review Comment:
```suggestion
# @param raw_tensor [::Array<Numeric>] The tensor represented as a
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org