class_docstr: A class to support adding sharding attributes to Ops.
  
  Use the factory constructors and then call apply_to_tensor:
    Sharding.replicate().apply_to_tensor(tensor)
docstr: Returns a Tiled sharding attribute.
  
  This causes an op to be partially computed on multiple cores in the
  XLA device.
  
  Args:
    tile_assignment: An np.ndarray describing the topology of the tiling and
      which device will compute which part of the topology.
  
  Raises:
    TypeError: tile_assignment was not of np.array type.
  
  TODO(jmolloy): This concept is nefarious and is not
  something we really want to expose to users (especially as the
  contract for tile_assignment is very strict).
docstr_tok: ["Returns","a","Tiled","sharding","attribute",".","This","causes","an","op","to","be","partially","computed","on","multiple","cores","in","the","XLA","device",".","Args",":","tile_assignment",":","An","np.ndarray","describing","the","topology","of","the","tiling","and","which","device","will","compute","which","part","of","the","topology",".","Raises",":","TypeError",":","tile_assignment","was","not","of","np.array","type",".","TODO","(","jmolloy",")",":","This","concept","is","nefarious","and","is","not","something","we","really","want","to","expose","to","users","(","especially","as","the","contract","for","tile_assignment","is","very","strict",")","."]
code: def tile(cls, tile_assignment):
      """Returns a Tiled sharding attribute.
  
      This causes an op to be partially computed on multiple cores in the
      XLA device.
  
      Args:
        tile_assignment: An np.ndarray describing the topology of the tiling and
          which device will compute which part of the topology.
  
      Raises:
        TypeError: tile_assignment was not of np.array type.
  
      TODO(jmolloy): This concept is nefarious and is not
      something we really want to expose to users (especially as the
      contract for tile_assignment is very strict).
      """
      if not isinstance(tile_assignment, _np.ndarray):
          raise TypeError("Tile assignment must be of type np.ndarray")
      dims = list(tile_assignment.shape)
      flattened_devices = tile_assignment.reshape(-1, order="C")
      return Sharding(
          proto=xla_data_pb2.OpSharding(
              type=xla_data_pb2.OpSharding.OTHER,
              tile_assignment_dimensions=dims,
              tile_assignment_devices=list(flattened_devices),
          )
      )
  
imports: import numpy
  from tensorflow.compiler.tf2xla.python import xla
  from local_xla.xla import xla_data_pb2
  from tensorflow.core.framework import attr_value_pb2
label_desc: Use image node_id 5 for calling the Sharding obj's underlying member method code with example usage: obj.tile(cls, tile_assignment) and returns: Sharding