Closed mib32 closed 4 years ago
Hey @mib32, thanks for reporting. That error indicates Rice doesn't know how to convert a std::vector<torch::Tensor>
C++ object to Ruby. The steps to fix would be:
Create a new wrap
function for std::vector<torch::Tensor>
: https://github.com/ankane/torch.rb/blob/master/ext/torch/templates.cpp (and add it to templates.hpp
)
Update code that generates the C++ functions to use wrap
If you look up chunk
in native_functions.yaml
, the return type is Tensor(a)[]
(anything with []
will need wrapped). You can run bundle exec rake generate:functions
and search for the _chunk
method in ext/torch/tensor_functions.cpp
to see if wrap
is being added.
bundle exec rake compile -- --with-torch-dir=/path/to/libtorch
bundle exec rake test
It's a bit of a complicated fix, so happy to take it if that's preferred.
Fixed in #14
On 0.3.4, libtorch 1.6.0 version, running this command:
fails with error:
P.S. I'd be happy to make a PR, but I would appreciate if I could have some hint where to look, because the C++ part feels a bit cryptic to me .. %)