lib/torch/tensor.rb in torch-rb-0.5.3 vs lib/torch/tensor.rb in torch-rb-0.6.0
- old
+ new
@@ -133,9 +133,13 @@
def new_ones(*size, **options)
Torch.ones_like(Torch.empty(*size), **options)
end
+ def requires_grad=(requires_grad)
+ _requires_grad!(requires_grad)
+ end
+
def requires_grad!(requires_grad = true)
_requires_grad!(requires_grad)
end
def type(dtype)