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 Sharding that splits a tensor across a dimension.
  
  This creates a Tiled attribute, similar to tile(), but easier to use for the
  common case of tiling a tensor N ways in one dimension.
  
  Args:
    tensor: A tf.Tensor to split.
    split_dimension: The dimension number to split.
    num_devices: The number of cores to split `tensor` over.
    input_shape: The shape of the original tensor.
  
  Raises:
    ValueError: The tensor to split was smaller in the split dimension than
      the number of devices to split over.
docstr_tok: ["Returns","a","Sharding","that","splits","a","tensor","across","a","dimension",".","This","creates","a","Tiled","attribute",",","similar","to","tile","(",")",",","but","easier","to","use","for","the","common","case","of","tiling","a","tensor","N","ways","in","one","dimension",".","Args",":","tensor",":","A","tf.Tensor","to","split",".","split_dimension",":","The","dimension","number","to","split",".","num_devices",":","The","number","of","cores","to","split","`","tensor","`","over",".","input_shape",":","The","shape","of","the","original","tensor",".","Raises",":","ValueError",":","The","tensor","to","split","was","smaller","in","the","split","dimension","than","the","number","of","devices","to","split","over","."]
code: def split(
      cls, tensor, split_dimension, num_devices, input_shape=None
  ):
      """Returns a Sharding that splits a tensor across a dimension.
  
      This creates a Tiled attribute, similar to tile(), but easier to use for the
      common case of tiling a tensor N ways in one dimension.
  
      Args:
        tensor: A tf.Tensor to split.
        split_dimension: The dimension number to split.
        num_devices: The number of cores to split `tensor` over.
        input_shape: The shape of the original tensor.
  
      Raises:
        ValueError: The tensor to split was smaller in the split dimension than
          the number of devices to split over.
      """
      if input_shape:
          shape = input_shape
      else:
          shape = tensor.shape.as_list()
      if (
          shape[split_dimension] is not None
          and shape[split_dimension] < num_devices
      ):
          raise ValueError(
              "Split dimension was smaller than the required number "
              "of splits: shape=%r, dimension=%r, num_devices=%r"
              % (shape, split_dimension, num_devices)
          )
  
      tile_assignment_dims = [1] * len(shape)
      tile_assignment_dims[split_dimension] = num_devices
  
      return Sharding(
          proto=xla_data_pb2.OpSharding(
              type=xla_data_pb2.OpSharding.OTHER,
              tile_assignment_dimensions=tile_assignment_dims,
              tile_assignment_devices=range(num_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 8 for calling the Sharding obj's underlying member method code with example usage: obj.split(cls, tensor, split_dimension, num_devices, input_shape) and returns: Sharding