class_docstr: Collective all-to-all communication.
class_docstr_tok: ["Collective","all-to-all","communication","."]
code: def forward(self, inputs):
      if len(inputs) != self.comm.size:
          raise ValueError(
              "The length of inputs must be same as communicator size."
          )
      xs_dtype = inputs[0].dtype
  
      # convert to float32 for communication
      if numpy.float16 == xs_dtype:
          xs = tuple([x.astype(numpy.float32) for x in inputs])
      else:
          xs = tuple([x for x in inputs])
      ret = self.comm.alltoall(xs)
  
      # convert back
      if numpy.float16 == xs_dtype:
          ret = tuple([item.astype(xs_dtype) for item in ret])
      return ret
  
imports: import chainer
  from chainer import backend
  import numpy
label_desc: Use image node_id 2 for calling the AllToAll obj's underlying member method code with example usage: obj.forward(inputs) and returns: ret