MCPcopy Create free account
hub / github.com/pytorch/pytorch / test_concat

Method test_concat

caffe2/python/functional_test.py:72–90  ·  view source on GitHub ↗
(self, tensor_splits, gc, dc)

Source from the content-addressed store, hash-verified

70
71 @given(tensor_splits=_tensor_splits(), **hu.gcs)
72 def test_concat(self, tensor_splits, gc, dc):
73 # Input Size: 1 -> inf
74 axis, _, splits = tensor_splits
75 concat_result, split_info = Functional.Concat(*splits, axis=axis, device_option=gc)
76
77 concat_result_ref = np.concatenate(splits, axis=axis)
78 split_info_ref = np.array([a.shape[axis] for a in splits])
79
80 np.testing.assert_array_equal(
81 concat_result,
82 concat_result_ref,
83 err_msg='Functional Concat result mismatch'
84 )
85
86 np.testing.assert_array_equal(
87 split_info,
88 split_info_ref,
89 err_msg='Functional Concat split info mismatch'
90 )
91
92 @given(tensor_splits=_tensor_splits(), split_as_arg=st.booleans(), **hu.gcs)
93 def test_split(self, tensor_splits, split_as_arg, gc, dc):

Callers

nothing calls this directly

Calls 1

ConcatMethod · 0.80

Tested by

no test coverage detected