(a1, a2, tensor_format_context)
| 727 | |
| 728 | @pytest.mark.parametrize("a1,a2", pytest_tensor_array_concat_arr_combinations) |
| 729 | def test_tensor_array_concat(a1, a2, tensor_format_context): |
| 730 | ta1 = TensorArray(a1) |
| 731 | ta2 = TensorArray(a2) |
| 732 | ta = TensorArray._concat_same_type([ta1, ta2]) |
| 733 | assert len(ta) == a1.shape[0] + a2.shape[0] |
| 734 | assert ta.dtype.element_dtype == ta1.dtype.element_dtype |
| 735 | if a1.shape[1:] == a2.shape[1:]: |
| 736 | assert ta.dtype.element_shape == a1.shape[1:] |
| 737 | np.testing.assert_array_equal(ta.to_numpy(), np.concatenate([a1, a2])) |
| 738 | else: |
| 739 | assert ta.dtype.element_shape == (None,) * (len(a1.shape) - 1) |
| 740 | for arr, expected in zip( |
| 741 | ta.to_numpy(), np.array([e for a in [a1, a2] for e in a], dtype=object) |
| 742 | ): |
| 743 | np.testing.assert_array_equal(arr, expected) |
| 744 | |
| 745 | |
| 746 | @pytest.mark.parametrize("a1,a2", pytest_tensor_array_concat_arr_combinations) |
nothing calls this directly
no test coverage detected
searching dependent graphs…