code: def shapes(x):
    
    def shape(x):
      try:
        return x.shape
      except Exception:  # pylint: disable=broad-except
        return []
    return nested_map(x, shape)
docs: Get a structure of shapes for a structure of nested arrays.