ext/torch/ext.cpp in torch-rb-0.2.5 vs ext/torch/ext.cpp in torch-rb-0.2.6

- old
+ new

@@ -328,9 +328,14 @@ .define_method("dim", &torch::Tensor::dim) .define_method("numel", &torch::Tensor::numel) .define_method("element_size", &torch::Tensor::element_size) .define_method("requires_grad", &torch::Tensor::requires_grad) .define_method( + "contiguous?", + *[](Tensor& self) { + return self.is_contiguous(); + }) + .define_method( "addcmul!", *[](Tensor& self, Scalar value, const Tensor & tensor1, const Tensor & tensor2) { return self.addcmul_(tensor1, tensor2, value); }) .define_method(