Sha256: f3d4aa7f029f8995d87cbb44b07d65e084c7e47d58b70d7d863476b1aaf3f04e
Contents?: true
Size: 660 Bytes
Versions: 18
Compression:
Stored size: 660 Bytes
Contents
#include <torch/torch.h> #include <rice/rice.hpp> #include "utils.h" void init_device(Rice::Module& m) { Rice::define_class_under<torch::Device>(m, "Device") .add_handler<torch::Error>(handle_error) .define_constructor(Rice::Constructor<torch::Device, const std::string&>()) .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(); }); }
Version data entries
18 entries across 18 versions & 1 rubygems