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

Method assert_has_rank

tensorflow/python/framework/tensor_shape.py:985–995  ·  view source on GitHub ↗

Raises an exception if `self` is not compatible with the given `rank`. Args: rank: An integer. Raises: ValueError: If `self` does not represent a shape with the given `rank`.

(self, rank)

Source from the content-addressed store, hash-verified

983 (self, other))
984
985 def assert_has_rank(self, rank):
986 """Raises an exception if `self` is not compatible with the given `rank`.
987
988 Args:
989 rank: An integer.
990
991 Raises:
992 ValueError: If `self` does not represent a shape with the given `rank`.
993 """
994 if self.rank not in (None, rank):
995 raise ValueError("Shape %s must have rank %d" % (self, rank))
996
997 def with_rank(self, rank):
998 """Returns a shape based on `self` with the given rank.

Callers 15

testFullyDefinedShapeMethod · 0.95
_IndexFunction · 0.80
mixture_stddevFunction · 0.80
__init__Method · 0.80
_add_scalar_summaryFunction · 0.80
_verify_inputFunction · 0.80
alpha_dropoutFunction · 0.80
get_batch_lossMethod · 0.80
rot90Function · 0.80

Calls

no outgoing calls

Tested by 2

testFullyDefinedShapeMethod · 0.76