Skip to content

Commit

Permalink
convert to list before astensor for pytorch-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Sep 14, 2018
1 parent 62d0b60 commit a1c625a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_interpcode(backend, interpcode, random_histosets_alphasets_pair):
histogramssets, alphasets = random_histosets_alphasets_pair

kitchensink_result = np.asarray(pyhf.tensorlib.tolist(pyhf.interpolate.interpolator(interpcode, do_optimal=False)(histogramssets=histogramssets, alphasets=alphasets)))
optimized_result = np.asarray(pyhf.tensorlib.tolist(pyhf.interpolate.interpolator(interpcode, do_optimal=True)(histogramssets=pyhf.tensorlib.astensor(histogramssets), alphasets=pyhf.tensorlib.astensor(alphasets))))
optimized_result = np.asarray(pyhf.tensorlib.tolist(pyhf.interpolate.interpolator(interpcode, do_optimal=True)(histogramssets=pyhf.tensorlib.astensor(histogramssets.tolist()), alphasets=pyhf.tensorlib.astensor(alphasets.tolist()))))

assert pytest.approx(kitchensink_result[~np.isnan(kitchensink_result)].ravel().tolist()) == optimized_result[~np.isnan(optimized_result)].ravel().tolist()

Expand Down

0 comments on commit a1c625a

Please sign in to comment.