Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
b80fb14
1
Parent(s):
9bfcbfa
Remove unused torch->sympy code
Browse files- pysr/export_torch.py +2 -4
pysr/export_torch.py
CHANGED
@@ -84,6 +84,7 @@ def _initialize_torch():
|
|
84 |
}
|
85 |
|
86 |
class _Node(torch.nn.Module):
|
|
|
87 |
def __init__(self, *, expr, _memodict, _func_lookup, **kwargs):
|
88 |
super().__init__(**kwargs)
|
89 |
|
@@ -134,6 +135,7 @@ def _initialize_torch():
|
|
134 |
|
135 |
|
136 |
class SingleSymPyModule(torch.nn.Module):
|
|
|
137 |
def __init__(self, expression, symbols_in,
|
138 |
extra_funcs=None, **kwargs):
|
139 |
super().__init__(**kwargs)
|
@@ -150,10 +152,6 @@ def _initialize_torch():
|
|
150 |
def __repr__(self):
|
151 |
return f"{type(self).__name__}(expression={self._expression_string})"
|
152 |
|
153 |
-
def sympy(self):
|
154 |
-
_memodict = {}
|
155 |
-
return self._node.sympy(_memodict)
|
156 |
-
|
157 |
def forward(self, X):
|
158 |
symbols = {symbol: X[:, i]
|
159 |
for i, symbol in enumerate(self.symbols_in)}
|
|
|
84 |
}
|
85 |
|
86 |
class _Node(torch.nn.Module):
|
87 |
+
"""SympyTorch code from https://github.com/patrick-kidger/sympytorch"""
|
88 |
def __init__(self, *, expr, _memodict, _func_lookup, **kwargs):
|
89 |
super().__init__(**kwargs)
|
90 |
|
|
|
135 |
|
136 |
|
137 |
class SingleSymPyModule(torch.nn.Module):
|
138 |
+
"""SympyTorch code from https://github.com/patrick-kidger/sympytorch"""
|
139 |
def __init__(self, expression, symbols_in,
|
140 |
extra_funcs=None, **kwargs):
|
141 |
super().__init__(**kwargs)
|
|
|
152 |
def __repr__(self):
|
153 |
return f"{type(self).__name__}(expression={self._expression_string})"
|
154 |
|
|
|
|
|
|
|
|
|
155 |
def forward(self, X):
|
156 |
symbols = {symbol: X[:, i]
|
157 |
for i, symbol in enumerate(self.symbols_in)}
|