test_minus_op.py 558 字节
Newer Older
1 2
import unittest
import numpy as np
Q
qijun 已提交
3
from op_test import OpTest
4 5


6
class TestMinusOp(OpTest):
7
    def setUp(self):
Q
qijun 已提交
8
        self.op_type = "minus"
9 10 11 12 13 14
        self.inputs = {
            'X': np.random.random((32, 84)).astype("float32"),
            'Y': np.random.random((32, 84)).astype("float32")
        }
        self.outputs = {'Out': (self.inputs['X'] - self.inputs['Y'])}

Q
qijun 已提交
15 16
    def test_check_output(self):
        self.check_output()
17

Q
qijun 已提交
18 19
    def test_check_grad(self):
        self.check_grad(['X', 'Y'], 'Out')
20 21


Q
qijun 已提交
22
if __name__ == "__main__":
23
    unittest.main()