MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / concatenate

Method concatenate

tensorflow/python/framework/tensor_shape.py:946–967  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 15

create_batchMethod · 0.95
block_diagonalFunction · 0.95
parallel_stackFunction · 0.95
_shapeMethod · 0.95
_shapeMethod · 0.95
padFunction · 0.95
__add__Method · 0.95
__radd__Method · 0.95
__concat__Method · 0.95
constant_value_as_shapeFunction · 0.95

Calls 3

as_shapeFunction · 0.85
unknown_shapeFunction · 0.70
TensorShapeClass · 0.70

Tested by

no test coverage detected