|TensorFlow 1 version||View source on GitHub|
Represents the shape of a
Compat aliases for migration
See Migration guide for more details.
tf.TensorShape( dims )
Used in the notebooks
|Used in the guide||Used in the tutorials|
TensorShape represents a possibly-partial shape specification for a
Tensor. It may be one of the following:
- Fully-known shape: has a known number of dimensions and a known size
for each dimension. e.g.
- Partially-known shape: has a known number of dimensions, and an unknown
size for one or more dimension. e.g.
- Unknown shape: has an unknown number of dimensions, and an unknown
size in all dimensions. e.g.
If a tensor is produced by an operation of type
"Foo", its shape
may be inferred if there is a registered shape function for
"Foo". See Shape
for details of shape functions and how to register them. Alternatively,
the shape may be set explicitly using
||A list of Dimensions, or None if the shape is unspecified.|
||If dims cannot be converted to a list of dimensions.|
Deprecated. Returns list of dimensions for this shape.
Deprecated accessor for
||Returns the rank of this shape, or None if it is unspecified.|
Returns a list of integers or
None for each dimension.
A list of integers or
Returns this shape as a
assert_has_rank( rank )
Raises an exception if
self is not compatible with the given
assert_is_compatible_with( other )
Raises exception if
other do not represent the same shape.
This method can be used to assert that there exists a shape that both