Sha256: e5799da3e1589cf968d08177925decc323b2d117687046c4838aa96fafad40aa
Contents?: true
Size: 615 Bytes
Versions: 9
Compression:
Stored size: 615 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") .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
9 entries across 9 versions & 1 rubygems