(self, tensors)
Initializes the ShardedNdArray.

    Note that the tensors should be ordered in the way the pmap producing these
    tensors is run.

    Args:
      tensors: list or tuple of eager tensors, one for each device.
Initializes the ShardedNdArray.
Initializes the ShardedNdArray .
def __init__(self, tensors):
    """Initializes the ShardedNdArray.

    Note that the tensors should be ordered in the way the pmap producing these
    tensors is run.

    Args:
      tensors: list or tuple of eager tensors, one for each device.
    """

    if not isinstance(tensors, (list, tuple)) or not tensors:
      raise ValueError(
          "Unable to create a ShardedNdArray without a list of tensors.")
    self.tensors = tensors
    self.n_devices = len(tensors)
def __init__ ( self , tensors ) : if not isinstance ( tensors , ( list , tuple ) ) or not tensors : raise ValueError ( "Unable to create a ShardedNdArray without a list of tensors." ) self . tensors = tensors self . n_devices = len ( tensors )