开源项目 torch.rb 看起来不错,用 Ruby 搞深度学习也能走上正统了

luikore · August 12, 2020 · 1905 hits

感谢 PyTorch 做了 libTorch,它是个建构在 Eigen / ATen 之上的 C++ 库,然后 Ruby 只要做个绑定包装就可以使用了。

https://github.com/ankane/torch.rb

缺点也有,就是 Ruby namespace 四个点,不如 Python 的一个点好看。用前 include 好了。

brew install libtorch automake
# rice 需要 --enabled-shared
RUBY_CONFIGURE_OPTS="--enable-shared" rbenv install -k -v 2.8.0-dev
# 感觉 rice 没搞对 clang 的一些默认 flag
CXX='clang++ -std=c++11 -fdeclspec' gem ins rice
gem ins torch-rb
No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.