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

Function as_dimension

tensorflow/python/framework/tensor_shape.py:702–718  ·  view source on GitHub ↗

Converts the given value to a Dimension. A Dimension input will be returned unmodified. An input of `None` will be converted to an unknown Dimension. An integer input will be converted to a Dimension with that value. Args: value: The value to be converted. Returns: A Dimension c

(value)

Source from the content-addressed store, hash-verified

700
701
702def as_dimension(value):
703 """Converts the given value to a Dimension.
704
705 A Dimension input will be returned unmodified.
706 An input of `None` will be converted to an unknown Dimension.
707 An integer input will be converted to a Dimension with that value.
708
709 Args:
710 value: The value to be converted.
711
712 Returns:
713 A Dimension corresponding to the given value.
714 """
715 if isinstance(value, Dimension):
716 return value
717 else:
718 return Dimension(value)
719
720
721@tf_export("TensorShape")

Callers 15

__eq__Method · 0.85
__ne__Method · 0.85
is_compatible_withMethod · 0.85
merge_withMethod · 0.85
__add__Method · 0.85
__sub__Method · 0.85
__rsub__Method · 0.85
__mul__Method · 0.85
__floordiv__Method · 0.85
__rfloordiv__Method · 0.85
__mod__Method · 0.85
__rmod__Method · 0.85

Calls 1

DimensionClass · 0.70

Tested by

no test coverage detected