#pragma once #include #include inline Object wrap(bool x) { return to_ruby(x); } inline Object wrap(int64_t x) { return to_ruby(x); } inline Object wrap(double x) { return to_ruby(x); } inline Object wrap(torch::Tensor x) { return to_ruby(x); } inline Object wrap(torch::Scalar x) { return to_ruby(x); } inline Object wrap(torch::ScalarType x) { return to_ruby(x); } inline Object wrap(torch::QScheme x) { return to_ruby(x); } inline 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); } inline 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); } inline 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); } inline 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); } inline 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); } inline 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); } inline Object wrap(torch::TensorList x) { Array a; for (auto& t : x) { a.push(to_ruby(t)); } return Object(a); } inline 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); }