From 27feb8a366575413d009a9f92ae91b46f963ced0 Mon Sep 17 00:00:00 2001 From: lucasdelimanogueira Date: Thu, 23 May 2024 12:07:17 -0300 Subject: [PATCH] fix autograd was not running on device --- norch/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/norch/tensor.py b/norch/tensor.py index 8063cba..6861f14 100644 --- a/norch/tensor.py +++ b/norch/tensor.py @@ -205,7 +205,7 @@ class Tensor: if gradient is None: if self.shape == [1]: - gradient = Tensor([1]) + gradient = Tensor([1]).to(self.device) else: raise RuntimeError("Gradient argument must be specified for non-scalar tensors.")