File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
python/paddle/fluid/tests/unittests Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class TestCastOp2(op_test.OpTest):
40
40
def setUp (self ):
41
41
ipt = np .random .random (size = [10 , 10 ])
42
42
# numpy float16 is binded to fluid float16 via uint16
43
- self .inputs = {'X' : ipt .astype ('float16' ).view (uint16 )}
43
+ self .inputs = {'X' : ipt .astype ('float16' ).view (np . uint16 )}
44
44
self .outputs = {'Out' : ipt .astype ('float32' )}
45
45
self .attrs = {
46
46
'in_dtype' : int (core .VarDesc .VarType .FP16 ),
@@ -49,10 +49,10 @@ def setUp(self):
49
49
self .op_type = 'cast'
50
50
51
51
def test_check_output (self ):
52
- self .check_output ()
52
+ self .check_output (atol = 1e-3 )
53
53
54
54
55
- class TestCastOp2 (op_test .OpTest ):
55
+ class TestCastOp3 (op_test .OpTest ):
56
56
def setUp (self ):
57
57
ipt = np .random .random (size = [10 , 10 ])
58
58
self .inputs = {'X' : ipt .astype ('float32' )}
@@ -64,7 +64,7 @@ def setUp(self):
64
64
self .op_type = 'cast'
65
65
66
66
def test_check_output (self ):
67
- self .check_output ()
67
+ self .check_output (atol = 1e-3 )
68
68
69
69
70
70
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments