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

luikore · 2020年08月12日 · 1904 次阅读

感谢 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
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号