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 partially tiled sharding attribute.
  
  This is similar to tile(), but tile_assignment has one more dimension than
  the tensor, and tiles in the last dimension of tile_assignment are
  replicated.
  
  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.
docstr_tok: ["Returns","a","partially","tiled","sharding","attribute",".","This","is","similar","to","tile","(",")",",","but","tile_assignment","has","one","more","dimension","than","the","tensor",",","and","tiles","in","the","last","dimension","of","tile_assignment","are","replicated",".","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","."]
code: def partial_tile(cls, tile_assignment):
      """Returns a partially tiled sharding attribute.
  
      This is similar to tile(), but tile_assignment has one more dimension than
      the tensor, and tiles in the last dimension of tile_assignment are
      replicated.
  
      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.
      """
      if not isinstance(tile_assignment, _np.ndarray):
          raise TypeError(
              "PartialTile 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),
              replicate_on_last_tile_dim=True,
          )
      )
  
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 7 for calling the Sharding obj's underlying member method code with example usage: obj.partial_tile(cls, tile_assignment) and returns: Sharding