MilesCranmer commited on
Commit
3f3625c
1 Parent(s): 5fe5010

Fix ordering of torch import

Browse files
Files changed (1) hide show
  1. test/test_torch.py +1 -1
test/test_torch.py CHANGED
@@ -125,6 +125,7 @@ class TestTorch(unittest.TestCase):
125
  "equation_file_custom_operator.csv.bkup", sep="|"
126
  )
127
 
 
128
  model = PySRRegressor(
129
  model_selection="accuracy",
130
  equation_file="equation_file_custom_operator.csv",
@@ -139,7 +140,6 @@ class TestTorch(unittest.TestCase):
139
 
140
  tformat = model.pytorch()
141
  self.assertEqual(str(tformat), "_SingleSymPyModule(expression=sin(x1))")
142
- import torch
143
  np.testing.assert_almost_equal(
144
  tformat(torch.tensor(X)).detach().numpy(),
145
  np.sin(X[:, 1]),
 
125
  "equation_file_custom_operator.csv.bkup", sep="|"
126
  )
127
 
128
+ import torch
129
  model = PySRRegressor(
130
  model_selection="accuracy",
131
  equation_file="equation_file_custom_operator.csv",
 
140
 
141
  tformat = model.pytorch()
142
  self.assertEqual(str(tformat), "_SingleSymPyModule(expression=sin(x1))")
 
143
  np.testing.assert_almost_equal(
144
  tformat(torch.tensor(X)).detach().numpy(),
145
  np.sin(X[:, 1]),