提交 6ef4f1f8 编写于 作者: K Kexin Zhao

small fix

上级 f3c5e815
......@@ -40,7 +40,7 @@ class TestCastOp2(op_test.OpTest):
def setUp(self):
ipt = np.random.random(size=[10, 10])
# numpy float16 is binded to fluid float16 via uint16
self.inputs = {'X': ipt.astype('float16').view(uint16)}
self.inputs = {'X': ipt.astype('float16').view(np.uint16)}
self.outputs = {'Out': ipt.astype('float32')}
self.attrs = {
'in_dtype': int(core.VarDesc.VarType.FP16),
......@@ -49,10 +49,10 @@ class TestCastOp2(op_test.OpTest):
self.op_type = 'cast'
def test_check_output(self):
self.check_output()
self.check_output(atol=1e-3)
class TestCastOp2(op_test.OpTest):
class TestCastOp3(op_test.OpTest):
def setUp(self):
ipt = np.random.random(size=[10, 10])
self.inputs = {'X': ipt.astype('float32')}
......@@ -64,7 +64,7 @@ class TestCastOp2(op_test.OpTest):
self.op_type = 'cast'
def test_check_output(self):
self.check_output()
self.check_output(atol=1e-3)
if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册