Skip to content

Commit

Permalink
converting sympy.NumberSymbol to torch.tensor in export_torch.py
Browse files Browse the repository at this point in the history
attempting to address MilesCranmer#656
  • Loading branch information
tbuckworth authored Sep 26, 2024
1 parent 339cc0a commit 905e877
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysr/export_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 905e877

Please sign in to comment.