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)
| 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`.""" |
no outgoing calls