arrow icon indicating copy to clipboard operation
arrow copied to clipboard

ARROW-17997: [Ruby] Add support for building Arrow::Tensor from raw nested Ruby array

Open kou opened this issue 3 years ago • 2 comments

kou avatar Oct 12 '22 07:10 kou

https://issues.apache.org/jira/browse/ARROW-17997

github-actions[bot] avatar Oct 12 '22 08:10 github-actions[bot]

:warning: Ticket has not been started in JIRA, please click 'Start Progress'.

github-actions[bot] avatar Oct 12 '22 08:10 github-actions[bot]

For the record, the equivalent Python functions don't allow passing strides.

pitrou avatar Oct 13 '22 15:10 pitrou

For the record, the equivalent Python functions don't allow passing strides.

Thanks for the information.

It seems that PyArrow only accepts constructing a tensor from a NumPy array: https://arrow.apache.org/docs/python/generated/pyarrow.Tensor.html#pyarrow.Tensor.from_numpy

For Ruby, we're already providing a constructor from raw binary data and metadata. It's based on arrow::Tensor::Make() in C++. So we can't remove the constructor to keep backward compatibility.

FYI: We have an external library that converts a NumPy like multi-dimentional array in Ruby (Numo::NArray) to Arrow::Tensor: https://github.com/red-data-tools/red-arrow-numo-narray/

kou avatar Oct 14 '22 02:10 kou

@mrkn What do you think about improved API?

kou avatar Oct 14 '22 04:10 kou

@kou LGTM

mrkn avatar Oct 14 '22 12:10 mrkn

Benchmark runs are scheduled for baseline = 0e80c4f66fb0db3a112db1827d7fba9323c3a27a and contender = fc01a9c3e11822fc3661ee440ca6f4a5e32a7f42. fc01a9c3e11822fc3661ee440ca6f4a5e32a7f42 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. Conbench compare runs links: [Finished :arrow_down:0.0% :arrow_up:0.0%] ec2-t3-xlarge-us-east-2 [Failed :arrow_down:0.0% :arrow_up:0.0%] test-mac-arm [Failed :arrow_down:0.27% :arrow_up:0.0%] ursa-i9-9960x [Finished :arrow_down:0.21% :arrow_up:0.04%] ursa-thinkcentre-m75q Buildkite builds: [Finished] fc01a9c3 ec2-t3-xlarge-us-east-2 [Failed] fc01a9c3 test-mac-arm [Failed] fc01a9c3 ursa-i9-9960x [Finished] fc01a9c3 ursa-thinkcentre-m75q [Finished] 0e80c4f6 ec2-t3-xlarge-us-east-2 [Failed] 0e80c4f6 test-mac-arm [Failed] 0e80c4f6 ursa-i9-9960x [Finished] 0e80c4f6 ursa-thinkcentre-m75q Supported benchmarks: ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True test-mac-arm: Supported benchmark langs: C++, Python, R ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

ursabot avatar Oct 15 '22 23:10 ursabot