Closed RuhmUndAnsehen closed 1 year ago
Hi @RuhmUndAnsehen, I'm not sure how to reproduce. The shared library should be located at lib/torch/ext.so
on Linux, and require_relative
shouldn't make a difference.
Apparently, on my system the extensions are located separately in /home/.../.gem/ruby/extensions/x86_64-linux/3.2.0/torch-rb-0.13.1/torch
.
This is all with default configurations and a pristine install. When I change the import in the already installed gem as mentioned in the OP, it works.
Thanks, can confirm extensions are placed in a separate directory with the system Ruby. Pushed a fix in the commit above. Thanks for reporting!
Trying to
require 'torch'
, I'm getting the following error:Environment:
The source of the error is commit https://github.com/ankane/torch.rb/commit/4202447cc23c2770355b13de0c3d9858cad915ca, which modified the import of native extentions in lib/torch.rb#2.
Here's the directory structure of a 0.12.0 install that worked in Ruby 3.1, vs. the directory structure of 0.13.1 in my current environment. The point I'm trying to make with this is that there is no file
torch/ext
in both instances, whichrequire_relative
seems to target. Instead,ext
lives in the gem's root directory.I can make this error go away by changing the aforementioned
require_relative
back torequire
.