Returns the concatenation of the dimension in `self` and `other`. *N.B.* If either `self` or `other` is completely unknown, concatenation will discard information about the other shape. In future, we might support concatenation that preserves this information for use with slicing.
(self, other)
| 944 | return other.concatenate(self) |
| 945 | |
| 946 | def concatenate(self, other): |
| 947 | """Returns the concatenation of the dimension in `self` and `other`. |
| 948 | |
| 949 | *N.B.* If either `self` or `other` is completely unknown, |
| 950 | concatenation will discard information about the other shape. In |
| 951 | future, we might support concatenation that preserves this |
| 952 | information for use with slicing. |
| 953 | |
| 954 | Args: |
| 955 | other: Another `TensorShape`. |
| 956 | |
| 957 | Returns: |
| 958 | A `TensorShape` whose dimensions are the concatenation of the |
| 959 | dimensions in `self` and `other`. |
| 960 | """ |
| 961 | # TODO(mrry): Handle the case where we concatenate a known shape with a |
| 962 | # completely unknown shape, so that we can use the partial information. |
| 963 | other = as_shape(other) |
| 964 | if self._dims is None or other.dims is None: |
| 965 | return unknown_shape() |
| 966 | else: |
| 967 | return TensorShape(self._dims + other.dims) |
| 968 | |
| 969 | def assert_same_rank(self, other): |
| 970 | """Raises an exception if `self` and `other` do not have compatible ranks. |
no test coverage detected