From 9715cd273fe5f601a275687299d619b2e5ced810 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Sun, 15 Feb 2026 16:10:27 +0100 Subject: [PATCH] Back to what AI created. I thought I could do better. --- more_math/Parser/UnifiedMathVisitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/more_math/Parser/UnifiedMathVisitor.py b/more_math/Parser/UnifiedMathVisitor.py index e6ab0d7..604cddb 100644 --- a/more_math/Parser/UnifiedMathVisitor.py +++ b/more_math/Parser/UnifiedMathVisitor.py @@ -2375,7 +2375,7 @@ class UnifiedMathVisitor(MathExprVisitor): def visitShapeFunc(self, ctx): val = (yield ctx.expr()) if self._is_tensor(val): - return val.shape.to(self.device) + return torch.tensor(list(val.shape), dtype=torch.long, device=self.device) elif self._is_list(val): return torch.tensor([len(val)], dtype=torch.long, device=self.device) else: