code: def check_scatter(xs, communicator):
      # All processes receive the same xs since seed is fixed.
      root = 0
  
      y = chainermn.functions.scatter(
          communicator, xs if communicator.rank == root else None, root
      )
      x = xs[communicator.rank]
      e = chainer.functions.mean_squared_error(y, x)
      e.backward()
  
      # Check backward does not fall in deadlock, and error = 0.
      assert 0 == e.data
      assert None is not x.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 16 for calling a global function with example usage: check_scatter(xs, communicator) without return types