https://github.com/red-data-tools/red-tensor
Generic tensor interface in Ruby
https://github.com/red-data-tools/red-tensor
Last synced: about 1 year ago
JSON representation
Generic tensor interface in Ruby
- Host: GitHub
- URL: https://github.com/red-data-tools/red-tensor
- Owner: red-data-tools
- License: mit
- Created: 2020-10-01T07:11:09.000Z (over 5 years ago)
- Default Branch: math_functions
- Last Pushed: 2020-11-09T07:17:38.000Z (over 5 years ago)
- Last Synced: 2025-02-15T19:48:43.255Z (over 1 year ago)
- Language: Ruby
- Size: 12.7 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Tensor - Common protocol for numerical array libraries
Tensor provides the programming interface and the backend protocol for operating numerical arrays among different libraries.
## Install
```console
$ gem install tensor
```
## Usage
```ruby
require "tensor"
require "numo/narray"
require "pandas"
x1 = [0, 0.5, 1, 1.5, 2].map {|x| x * Math::PI }
x2 = Numo::DFloat[*ary]
x3 = Pandas::Series.new(a)
y1 = Tensor.sin(x1)
y2 = Tensor.sin(x2)
y3 = Tensor.sin(x3)
p y1.class #=> Array
p y2.class #=> Numo::DFloat
p y3.class #=>
```
## License
MIT License
## Author
- [Kenta Murata](https://github.com/mrkn)