#include #include #include "utils.h" void init_device(Rice::Module& m) { Rice::define_class_under(m, "Device") .define_constructor(Rice::Constructor()) .define_method( "index", [](torch::Device& self) { return self.index(); }) .define_method( "index?", [](torch::Device& self) { return self.has_index(); }) .define_method( "type", [](torch::Device& self) { std::stringstream s; s << self.type(); return s.str(); }); }