class tf.Dimension
See the guide: Building Graphs > Defining new operations
Represents the value of one dimension in a TensorShape.
value
The value of this dimension, or None if it is unknown.
__init__(value)
Creates a new Dimension with the given value.
assert_is_compatible_with(other)
Raises an exception if other
is not compatible with this Dimension.
other
: Another Dimension.ValueError
: If self
and other
are not compatible (see is_compatible_with).is_compatible_with(other)
Returns true if other
is compatible with this Dimension.
Two known Dimensions are compatible if they have the same value. An unknown Dimension is compatible with all other Dimensions.
other
: Another Dimension.True if this Dimension and other
are compatible.
merge_with(other)
Returns a Dimension that combines the information in self
and other
.
Dimensions are combined as follows:
Dimension(n) .merge_with(Dimension(n)) == Dimension(n) Dimension(n) .merge_with(Dimension(None)) == Dimension(n) Dimension(None).merge_with(Dimension(n)) == Dimension(n) Dimension(None).merge_with(Dimension(None)) == Dimension(None) Dimension(n) .merge_with(Dimension(m)) raises ValueError for n != m
other
: Another Dimension.A Dimension containing the combined information of self
and other
.
ValueError
: If self
and other
are not compatible (see is_compatible_with).Defined in tensorflow/python/framework/tensor_shape.py
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/Dimension