test_assign_op.py 422 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import op_test
import numpy
import unittest


class TestAssignOp(op_test.OpTest):
    def setUp(self):
        self.op_type = "assign"
        x = numpy.random.random(size=(100, 10))
        self.inputs = {'X': x}
        self.outputs = {'Out': x}

    def test_forward(self):
        self.check_output()

    def test_backward(self):
        self.check_grad(['X'], 'Out')


if __name__ == '__main__':
    unittest.main()