From 905e87746a73594fe44df793cbe40cc445ca2ea9 Mon Sep 17 00:00:00 2001 From: tbuckworth <55180288+tbuckworth@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:24:37 +0100 Subject: [PATCH] converting sympy.NumberSymbol to torch.tensor in export_torch.py attempting to address #656 --- pysr/export_torch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysr/export_torch.py b/pysr/export_torch.py index be3d6a163..c421f859f 100644 --- a/pysr/export_torch.py +++ b/pysr/export_torch.py @@ -116,7 +116,7 @@ def __init__(self, *, expr, _memodict, _func_lookup, **kwargs): self._args = () elif issubclass(expr.func, sympy.NumberSymbol): # Can get here from exp(1) or exact pi - self._value = float(expr) + self._value = torch.tensor(float(expr)) self._torch_func = lambda: self._value self._args = () elif issubclass(expr.func, sympy.Symbol):