@@ -641,9 +641,14 @@ def _test(base, exponent): helper_test_op(None, lambda x,y: x**y, vals=[base, ex
641
641
642
642
def test_sqrt (self ):
643
643
helper_test_op ([(45 ,65 )], lambda x : x .sqrt ())
644
+ if Device .DEFAULT not in ("LLVM" , "DSP" ):
645
+ # TODO: fix backward
646
+ helper_test_op (None , lambda x : x .sqrt (), vals = [[0.0 ]])
644
647
helper_test_op ([()], lambda x : x .sqrt ())
645
648
def test_rsqrt (self ):
646
649
helper_test_op ([(45 ,65 )], lambda x : x .rsqrt ())
650
+ # TODO: fix backward
651
+ helper_test_op (None , lambda x : x .rsqrt (), vals = [[0.0 ]], forward_only = True )
647
652
helper_test_op ([()], lambda x : x .rsqrt ())
648
653
649
654
def test_xor (self ):
@@ -1274,6 +1279,7 @@ def test_var_zero_in_axis(self):
1274
1279
helper_test_op ([(1 ,0 ,3 ,0 ,5 )], lambda x : x .var (axis = (1 ,3 ), correction = 0 ))
1275
1280
helper_test_op ([(1 ,0 ,3 ,0 ,5 )], lambda x : x .var (axis = (1 ,3 ), correction = 5 ))
1276
1281
def test_var_one_in_axis (self ):
1282
+ helper_test_op ([(1 ,)], lambda x : x .var (axis = (0 ,), correction = 0 ))
1277
1283
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .var (axis = (0 ,3 )))
1278
1284
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .var (axis = (0 ,3 ), correction = 0 ))
1279
1285
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .var (axis = (0 ,3 ), correction = 5 ))
@@ -1301,8 +1307,9 @@ def test_std_zero_in_axis(self):
1301
1307
helper_test_op ([(1 ,0 ,3 ,0 ,5 )], lambda x : x .std (axis = (1 ,3 ), correction = 0 ))
1302
1308
helper_test_op ([(1 ,0 ,3 ,0 ,5 )], lambda x : x .std (axis = (1 ,3 ), correction = 5 ))
1303
1309
def test_std_one_in_axis (self ):
1310
+ # TODO: fix backward
1311
+ helper_test_op ([(1 ,)], lambda x : x .std (axis = (0 ,), correction = 0 ), forward_only = True )
1304
1312
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .std (axis = (0 ,3 )))
1305
- # TODO: this one broke with correction=0 in new gradient
1306
1313
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .std (axis = (0 ,3 ), correction = 0 ), forward_only = True )
1307
1314
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .std (axis = (0 ,3 ), correction = 5 ))
1308
1315
helper_test_op ([(1 ,2 ,3 ,1 ,5 )], lambda x : x .std (axis = (0 ,4 )))
0 commit comments