File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,8 @@ def test_empty_backend():
264
264
nx .detach (M )
265
265
with pytest .raises (NotImplementedError ):
266
266
nx .matmul (M , M .T )
267
+ with pytest .raises (NotImplementedError ):
268
+ nx .nan_to_num (M )
267
269
268
270
269
271
def test_func_backends (nx ):
@@ -667,6 +669,11 @@ def test_func_backends(nx):
667
669
lst_b .append (nx .to_numpy (A ))
668
670
lst_name .append ("matmul broadcast" )
669
671
672
+ vec = nx .from_numpy (np .array ([1 , np .nan , - 1 ]))
673
+ vec = nx .nan_to_num (vec , nan = 0 )
674
+ lst_b .append (nx .to_numpy (vec ))
675
+ lst_name .append ("nan_to_num" )
676
+
670
677
assert not nx .array_equal (Mb , vb ), "array_equal (shape)"
671
678
assert nx .array_equal (Mb , Mb ), "array_equal (elements) - expected true"
672
679
assert not nx .array_equal (
You can’t perform that action at this time.
0 commit comments