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

Method as_list

tensorflow/python/framework/tensor_shape.py:1161–1172  ·  view source on GitHub ↗

Returns a list of integers or `None` for each dimension. Returns: A list of integers or `None` for each dimension. Raises: ValueError: If `self` is an unknown shape with an unknown rank.

(self)

Source from the content-addressed store, hash-verified

1159 raise ValueError("Shape %s is not fully defined" % self)
1160
1161 def as_list(self):
1162 """Returns a list of integers or `None` for each dimension.
1163
1164 Returns:
1165 A list of integers or `None` for each dimension.
1166
1167 Raises:
1168 ValueError: If `self` is an unknown shape with an unknown rank.
1169 """
1170 if self._dims is None:
1171 raise ValueError("as_list() is not defined on an unknown TensorShape.")
1172 return [dim.value for dim in self._dims]
1173
1174 def as_proto(self):
1175 """Returns this shape as a `TensorShapeProto`."""

Callers 15

testShapeGettersMethod · 0.95
testShapeGettersMethod · 0.95
testShapeMethod · 0.95
testShapeErrorMethod · 0.95
testShapeGettersMethod · 0.95
testShapeGettersMethod · 0.95
testShapeGettersMethod · 0.95
_sample_shapeMethod · 0.95
_cmpMethod · 0.95
_shape_commonFunction · 0.95
testFullyDefinedShapeMethod · 0.95
_convert_shapeFunction · 0.95

Calls

no outgoing calls

Tested by 15

testShapeGettersMethod · 0.76
testShapeGettersMethod · 0.76
testShapeMethod · 0.76
testShapeErrorMethod · 0.76
testShapeGettersMethod · 0.76
testShapeGettersMethod · 0.76
testShapeGettersMethod · 0.76
_cmpMethod · 0.76
testFullyDefinedShapeMethod · 0.76
_assert_broadcastMethod · 0.36
testConstructionMethod · 0.36