From c2e934dd99d817b7cc473e14399d025d7b5f39e8 Mon Sep 17 00:00:00 2001 From: Abhay D Date: Wed, 18 Dec 2024 16:38:27 -0800 Subject: [PATCH] Fix bug in from_torch method --- genesis/grad/creation_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genesis/grad/creation_ops.py b/genesis/grad/creation_ops.py index ca01e32a..863edce0 100644 --- a/genesis/grad/creation_ops.py +++ b/genesis/grad/creation_ops.py @@ -89,7 +89,7 @@ def from_torch(torch_tensor, dtype=None, requires_grad=False, detach=True, scene ) requires_grad = True - gs_tensor = Tensor(torch_tensor.to(gs.device).to(dtype), scene=scene).clone() + gs_tensor = Tensor(torch_tensor.to(device=gs.device, dtype=dtype), scene=scene).clone() if detach: gs_tensor = gs_tensor.detach(sceneless=False)