code: def check_all_to_all(xs, communicator):
      ys = chainermn.functions.alltoall(communicator, xs)
  
      y = chainer.functions.sum(ys[0])
      for _y in ys[1:]:
          y += chainer.functions.sum(_y)
  
      y.backward()
  
      # Check if gradients are passed back without deadlock.
      assert None is not xs[0].grad
  
imports: import chainer
  import chainer.testing
  import chainer.testing.attr
  import numpy
  import pytest
  import chainermn
  import chainermn.functions
label_desc: Use image node_id 5 for calling a global function with example usage: check_all_to_all(xs, communicator) without return types