Returns an unknown TensorShape, optionally with a known rank. Args: rank: (Optional) If specified, the number of dimensions in the shape. **kwargs: For backwards compatibility. Returns: An unknown TensorShape. Raises: TypeError: In case of invalid arguments.
(rank=None, **kwargs)
| 1217 | |
| 1218 | |
| 1219 | def unknown_shape(rank=None, **kwargs): |
| 1220 | """Returns an unknown TensorShape, optionally with a known rank. |
| 1221 | |
| 1222 | Args: |
| 1223 | rank: (Optional) If specified, the number of dimensions in the shape. |
| 1224 | **kwargs: For backwards compatibility. |
| 1225 | |
| 1226 | Returns: |
| 1227 | An unknown TensorShape. |
| 1228 | |
| 1229 | Raises: |
| 1230 | TypeError: In case of invalid arguments. |
| 1231 | """ |
| 1232 | if rank is None and "ndims" in kwargs: |
| 1233 | rank = kwargs.pop("ndims") |
| 1234 | if kwargs: |
| 1235 | raise TypeError("Unknown argument: %s" % kwargs) |
| 1236 | if rank is None: |
| 1237 | return TensorShape(None) |
| 1238 | else: |
| 1239 | return TensorShape([Dimension(None)] * rank) |
| 1240 | |
| 1241 | |
| 1242 | @deprecation.deprecated(None, "Use tf.TensorShape([]).") |