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