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

Function get_inner_shape

tensorflow/python/ops/ragged/ragged_factory_ops.py:280–286  ·  view source on GitHub ↗

Returns the inner shape for a python list `item`.

(item)

Source from the content-addressed store, hash-verified

278 """Computes a default inner shape for the given python list."""
279
280 def get_inner_shape(item):
281 """Returns the inner shape for a python list `item`."""
282 if not isinstance(item, (list, tuple)) and np.ndim(item) == 0:
283 return ()
284 elif item:
285 return (len(item),) + get_inner_shape(item[0])
286 return (0,)
287
288 def check_inner_shape(item, shape):
289 """Checks that `item` has a consistent shape matching `shape`."""

Callers 1

Calls 1

ndimMethod · 0.45

Tested by

no test coverage detected