#include #include #include "templates.hpp" Object wrap(bool x) { return to_ruby(x); } Object wrap(int64_t x) { return to_ruby(x); } Object wrap(double x) { return to_ruby(x); } Object wrap(torch::Tensor x) { return to_ruby(x); } Object wrap(torch::Scalar x) { return to_ruby(x); } Object wrap(torch::ScalarType x) { return to_ruby(x); } Object wrap(torch::QScheme x) { return to_ruby(x); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); return Object(a); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); a.push(to_ruby(std::get<2>(x))); return Object(a); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); a.push(to_ruby(std::get<2>(x))); a.push(to_ruby(std::get<3>(x))); return Object(a); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); a.push(to_ruby(std::get<2>(x))); a.push(to_ruby(std::get<3>(x))); a.push(to_ruby(std::get<4>(x))); return Object(a); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); a.push(to_ruby(std::get<2>(x))); a.push(to_ruby(std::get<3>(x))); return Object(a); } Object wrap(std::tuple x) { Array a; a.push(to_ruby(std::get<0>(x))); a.push(to_ruby(std::get<1>(x))); a.push(to_ruby(std::get<2>(x))); a.push(to_ruby(std::get<3>(x))); return Object(a); } Object wrap(std::vector x) { Array a; for (auto& t : x) { a.push(to_ruby(t)); } return Object(a); }