code: def sizes(x):
    
    def size(x):
      try:
        return x.size
      except Exception:  # pylint: disable=broad-except
        return 0
    return nested_map(x, size)
docs: Get a structure of sizes for a structure of nested arrays.