Type Dimension
Namespace tensorflow
Parent PythonObjectContainer
Interfaces IDimension
Represents the value of one dimension in a TensorShape.
Methods
- __add__
- __add___dyn
- __div___dyn
- __floordiv__
- __floordiv__
- __floordiv___dyn
- __ge___dyn
- __gt___dyn
- __index__
- __index___dyn
- __int__
- __int___dyn
- __le___dyn
- __long__
- __long___dyn
- __lt___dyn
- __mod__
- __mod__
- __mod__
- __mod___dyn
- __mul___dyn
- __radd__
- __radd___dyn
- __rdiv___dyn
- __rfloordiv__
- __rfloordiv__
- __rfloordiv___dyn
- __rmod__
- __rmod___dyn
- __rmul___dyn
- __rsub__
- __rsub__
- __rsub___dyn
- __rtruediv__
- __rtruediv___dyn
- __sub__
- __sub__
- __sub__
- __sub__
- __sub___dyn
- __truediv__
- __truediv__
- __truediv___dyn
- assert_is_compatible_with
- assert_is_compatible_with
- assert_is_compatible_with
- assert_is_compatible_with
- assert_is_compatible_with
- assert_is_compatible_with_dyn
- is_compatible_with
- is_compatible_with
- is_compatible_with
- is_compatible_with
- is_compatible_with
- merge_with
- merge_with
- merge_with
- merge_with
- merge_with
- merge_with_dyn
Properties
Public instance methods
object __add__(IEnumerable<object> other)
Returns the sum of `self` and `other`. Dimensions are summed as follows:
Parameters
-
IEnumerable<object>
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the sum of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) + tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m + n) tf.compat.v1.Dimension(m) + tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) + tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) + tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __add___dyn(object other)
Returns the sum of `self` and `other`. Dimensions are summed as follows:
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the sum of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) + tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m + n) tf.compat.v1.Dimension(m) + tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) + tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) + tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __div___dyn(object other)
DEPRECATED: Use `__floordiv__` via `x // y` instead. This function exists only for backwards compatibility purposes; new code
should use `__floordiv__` via the syntax `x // y`. Using `x // y`
communicates clearly that the result rounds down, and is forward compatible
to Python 3.
Parameters
-
object
other - Another `Dimension`.
Returns
-
object
- A `Dimension` whose value is the integer quotient of `self` and `other`.
object __floordiv__(int other)
Returns the quotient of `self` and `other` rounded down. Dimensions are divided as follows:
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A `Dimension` whose value is the integer quotient of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m // n) tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __floordiv__(Dimension other)
Returns the quotient of `self` and `other` rounded down. Dimensions are divided as follows:
Parameters
-
Dimension
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A `Dimension` whose value is the integer quotient of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m // n) tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __floordiv___dyn(object other)
Returns the quotient of `self` and `other` rounded down. Dimensions are divided as follows:
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A `Dimension` whose value is the integer quotient of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m // n) tf.compat.v1.Dimension(m) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) // tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __ge___dyn(object other)
Returns True if `self` is known to be greater than or equal to `other`. Dimensions are compared as follows:
Parameters
-
object
other - Another Dimension.
Returns
-
object
- The value of `self.value >= other.value` if both are known, otherwise None.
Show Example
(tf.compat.v1.Dimension(m) >= tf.compat.v1.Dimension(n)) == (m >= n) (tf.compat.v1.Dimension(m) >= tf.compat.v1.Dimension(None)) == None (tf.compat.v1.Dimension(None) >= tf.compat.v1.Dimension(n)) == None (tf.compat.v1.Dimension(None) >= tf.compat.v1.Dimension(None)) == None
object __gt___dyn(object other)
Returns True if `self` is known to be greater than `other`. Dimensions are compared as follows:
Parameters
-
object
other - Another Dimension.
Returns
-
object
- The value of `self.value > other.value` if both are known, otherwise None.
Show Example
(tf.compat.v1.Dimension(m) > tf.compat.v1.Dimension(n)) == (m > n) (tf.compat.v1.Dimension(m) > tf.compat.v1.Dimension(None)) == None (tf.compat.v1.Dimension(None) > tf.compat.v1.Dimension(n)) == None (tf.compat.v1.Dimension(None) > tf.compat.v1.Dimension(None)) == None
Nullable<int> __index__()
object __index___dyn()
Nullable<int> __int__()
object __int___dyn()
object __le___dyn(object other)
Returns True if `self` is known to be less than or equal to `other`. Dimensions are compared as follows:
Parameters
-
object
other - Another Dimension.
Returns
-
object
- The value of `self.value <= other.value` if both are known, otherwise None.
Show Example
(tf.compat.v1.Dimension(m) <= tf.compat.v1.Dimension(n)) == (m <= n) (tf.compat.v1.Dimension(m) <= tf.compat.v1.Dimension(None)) == None (tf.compat.v1.Dimension(None) <= tf.compat.v1.Dimension(n)) == None (tf.compat.v1.Dimension(None) <= tf.compat.v1.Dimension(None)) == None
Nullable<int> __long__()
object __long___dyn()
object __lt___dyn(object other)
Returns True if `self` is known to be less than `other`. Dimensions are compared as follows:
Parameters
-
object
other - Another Dimension.
Returns
-
object
- The value of `self.value < other.value` if both are known, otherwise None.
Show Example
(tf.compat.v1.Dimension(m) < tf.compat.v1.Dimension(n)) == (m < n) (tf.compat.v1.Dimension(m) < tf.compat.v1.Dimension(None)) == None (tf.compat.v1.Dimension(None) < tf.compat.v1.Dimension(n)) == None (tf.compat.v1.Dimension(None) < tf.compat.v1.Dimension(None)) == None
Dimension __mod__(Dimension other)
Returns `self` modulo `other`. Dimension moduli are computed as follows:
Parameters
-
Dimension
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is `self` modulo `other`.
Show Example
tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m % n) tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
Dimension __mod__(IGraphNodeBase other)
Returns `self` modulo `other`. Dimension moduli are computed as follows:
Parameters
-
IGraphNodeBase
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is `self` modulo `other`.
Show Example
tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m % n) tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
Dimension __mod__(int other)
Returns `self` modulo `other`. Dimension moduli are computed as follows:
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is `self` modulo `other`.
Show Example
tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m % n) tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __mod___dyn(object other)
Returns `self` modulo `other`. Dimension moduli are computed as follows:
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is `self` modulo `other`.
Show Example
tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m % n) tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __mul___dyn(object other)
Returns the product of `self` and `other`. Dimensions are summed as follows:
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the product of `self` and `other`.
Show Example
tf.compat.v1.Dimension(m) * tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m * n) tf.compat.v1.Dimension(m) * tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) * tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) * tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __radd__(IEnumerable<object> other)
Returns the sum of `other` and `self`.
Parameters
-
IEnumerable<object>
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the sum of `self` and `other`.
object __radd___dyn(object other)
Returns the sum of `other` and `self`.
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the sum of `self` and `other`.
object __rdiv___dyn(object other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'int' and 'Dimension'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
object
other - Another `Dimension`.
Dimension __rfloordiv__(IGraphNodeBase other)
Returns the quotient of `other` and `self` rounded down.
Parameters
-
IGraphNodeBase
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A `Dimension` whose value is the integer quotient of `self` and `other`.
Dimension __rfloordiv__(int other)
Returns the quotient of `other` and `self` rounded down.
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A `Dimension` whose value is the integer quotient of `self` and `other`.
object __rfloordiv___dyn(object other)
Returns the quotient of `other` and `self` rounded down.
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A `Dimension` whose value is the integer quotient of `self` and `other`.
Dimension __rmod__(int other)
Returns `other` modulo `self`.
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is `other` modulo `self`.
object __rmod___dyn(object other)
Returns `other` modulo `self`.
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is `other` modulo `self`.
object __rmul___dyn(object other)
Returns the product of `self` and `other`.
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the product of `self` and `other`.
Dimension __rsub__(int other)
Returns the subtraction of `self` from `other`.
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is the subtraction of `self` from `other`.
Dimension __rsub__(IGraphNodeBase other)
Returns the subtraction of `self` from `other`.
Parameters
-
IGraphNodeBase
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
Dimension
- A Dimension whose value is the subtraction of `self` from `other`.
object __rsub___dyn(object other)
Returns the subtraction of `self` from `other`.
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `self` from `other`.
void __rtruediv__(int other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'int' and 'Dimension'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
int
other - Another `Dimension`.
object __rtruediv___dyn(object other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'int' and 'Dimension'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
object
other - Another `Dimension`.
object __sub__(ndarray other)
Returns the subtraction of `other` from `self`. Dimensions are subtracted as follows:
Parameters
-
ndarray
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `other` from `self`.
Show Example
tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m - n) tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __sub__(Dimension other)
Returns the subtraction of `other` from `self`. Dimensions are subtracted as follows:
Parameters
-
Dimension
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `other` from `self`.
Show Example
tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m - n) tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __sub__(int other)
Returns the subtraction of `other` from `self`. Dimensions are subtracted as follows:
Parameters
-
int
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `other` from `self`.
Show Example
tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m - n) tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __sub__(IGraphNodeBase other)
Returns the subtraction of `other` from `self`. Dimensions are subtracted as follows:
Parameters
-
IGraphNodeBase
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `other` from `self`.
Show Example
tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m - n) tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
object __sub___dyn(object other)
Returns the subtraction of `other` from `self`. Dimensions are subtracted as follows:
Parameters
-
object
other - Another Dimension, or a value accepted by `as_dimension`.
Returns
-
object
- A Dimension whose value is the subtraction of `other` from `self`.
Show Example
tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m - n) tf.compat.v1.Dimension(m) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(n) # equiv. to tf.compat.v1.Dimension(None) tf.compat.v1.Dimension(None) - tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(None)
void __truediv__(int other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
int
other - Another `Dimension`.
void __truediv__(Dimension other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
Dimension
other - Another `Dimension`.
object __truediv___dyn(object other)
Use `__floordiv__` via `x // y` instead. This function exists only to have a better error message. Instead of:
`TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'`,
this function will explicitly call for usage of `//` instead.
Parameters
-
object
other - Another `Dimension`.
void assert_is_compatible_with(object other)
Raises an exception if `other` is not compatible with this Dimension.
Parameters
-
object
other - Another Dimension.
void assert_is_compatible_with(IEnumerable<object> other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both
`self` and `other` represent.
Parameters
-
IEnumerable<object>
other - Another TensorShape.
void assert_is_compatible_with(Dimension other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both
`self` and `other` represent.
Parameters
-
Dimension
other - Another TensorShape.
void assert_is_compatible_with(TensorShape other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both
`self` and `other` represent.
Parameters
-
TensorShape
other - Another TensorShape.
void assert_is_compatible_with(int other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both
`self` and `other` represent.
Parameters
-
int
other - Another TensorShape.
object assert_is_compatible_with_dyn(object other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both
`self` and `other` represent.
Parameters
-
object
other - Another TensorShape.
object is_compatible_with(IEnumerable<object> 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.
Parameters
-
IEnumerable<object>
other - Another Dimension.
Returns
-
object
- True if this Dimension and `other` are compatible.
object is_compatible_with(Dimension 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.
Parameters
-
Dimension
other - Another Dimension.
Returns
-
object
- True if this Dimension and `other` are compatible.
object is_compatible_with(PythonClassContainer 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.
Parameters
-
PythonClassContainer
other - Another Dimension.
Returns
-
object
- True if this Dimension and `other` are compatible.
object is_compatible_with(int other)
Returns True iff `self` is compatible with `other`. Two possibly-partially-defined shapes are compatible if there
exists a fully-defined shape that both shapes can represent. Thus,
compatibility allows the shape inference code to reason about
partially-defined shapes. For example: * TensorShape(None) is compatible with all shapes. * TensorShape([None, None]) is compatible with all two-dimensional
shapes, such as TensorShape([32, 784]), and also TensorShape(None). It is
not compatible with, for example, TensorShape([None]) or
TensorShape([None, None, None]). * TensorShape([32, None]) is compatible with all two-dimensional shapes
with size 32 in the 0th dimension, and also TensorShape([None, None])
and TensorShape(None). It is not compatible with, for example,
TensorShape([32]), TensorShape([32, None, 1]) or TensorShape([64, None]). * TensorShape([32, 784]) is compatible with itself, and also
TensorShape([32, None]), TensorShape([None, 784]), TensorShape([None,
None]) and TensorShape(None). It is not compatible with, for example,
TensorShape([32, 1, 784]) or TensorShape([None]). The compatibility relation is reflexive and symmetric, but not
transitive. For example, TensorShape([32, 784]) is compatible with
TensorShape(None), and TensorShape(None) is compatible with
TensorShape([4, 4]), but TensorShape([32, 784]) is not compatible with
TensorShape([4, 4]).
Parameters
-
int
other - Another TensorShape.
Returns
-
object
- True iff `self` is compatible with `other`.
object is_compatible_with(TensorShape other)
Returns True iff `self` is compatible with `other`. Two possibly-partially-defined shapes are compatible if there
exists a fully-defined shape that both shapes can represent. Thus,
compatibility allows the shape inference code to reason about
partially-defined shapes. For example: * TensorShape(None) is compatible with all shapes. * TensorShape([None, None]) is compatible with all two-dimensional
shapes, such as TensorShape([32, 784]), and also TensorShape(None). It is
not compatible with, for example, TensorShape([None]) or
TensorShape([None, None, None]). * TensorShape([32, None]) is compatible with all two-dimensional shapes
with size 32 in the 0th dimension, and also TensorShape([None, None])
and TensorShape(None). It is not compatible with, for example,
TensorShape([32]), TensorShape([32, None, 1]) or TensorShape([64, None]). * TensorShape([32, 784]) is compatible with itself, and also
TensorShape([32, None]), TensorShape([None, 784]), TensorShape([None,
None]) and TensorShape(None). It is not compatible with, for example,
TensorShape([32, 1, 784]) or TensorShape([None]). The compatibility relation is reflexive and symmetric, but not
transitive. For example, TensorShape([32, 784]) is compatible with
TensorShape(None), and TensorShape(None) is compatible with
TensorShape([4, 4]), but TensorShape([32, 784]) is not compatible with
TensorShape([4, 4]).
Parameters
-
TensorShape
other - Another TensorShape.
Returns
-
object
- True iff `self` is compatible with `other`.
object merge_with(TensorShape other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
TensorShape
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
object merge_with(Dimension other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
Dimension
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
object merge_with(object other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
object
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
object merge_with(IEnumerable<object> other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
IEnumerable<object>
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
object merge_with(int other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
int
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
object merge_with_dyn(object other)
Returns a `TensorShape` combining the information in `self` and `other`. The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
Parameters
-
object
other - Another `TensorShape`.
Returns
-
object
- A `TensorShape` containing the combined information of `self` and `other`.
Public properties
object PythonObject get;
Nullable<int> value get;
The value of this dimension, or None if it is unknown.
object value_dyn get;
The value of this dimension, or None if it is unknown.