test_concat_op.py 633 字节
Newer Older
1 2
import unittest
import numpy as np
3
from op_test import OpTest
4 5


6
class TestConcatOp(OpTest):
7
    def setUp(self):
8
        self.op_type = "concat"
9 10 11 12
        x0 = np.random.random((2, 3, 2, 5)).astype('float32')
        x1 = np.random.random((2, 3, 3, 5)).astype('float32')
        x2 = np.random.random((2, 3, 4, 5)).astype('float32')
        axis = 2
13
        self.inputs = {'X': [('x0', x0), ('x1', x1), ('x2', x2)]}
14 15 16
        self.attrs = {'axis': axis}
        self.outputs = {'Out': np.concatenate((x0, x1, x2), axis=axis)}

17 18 19
    def test_check_output(self):
        self.check_output()

20 21 22

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