code: def check_tuple_communication(length, gpu, param):
      with chainer.using_config("dtype", param.dtype):
          communicator = create_communicator(gpu, param)
          rank_send = (communicator.rank + 1) % communicator.size
          rank_recv = (communicator.rank - 1) % communicator.size
          x = create_x(gpu, param, communicator)
          (model, entire_model) = create_models(
              gpu, param, communicator
          )
  
          if communicator.rank == 0:
              y = []
              for i in range(length):
                  _y = function(model(x))
                  y.append(_y)
              err = chainermn.functions.send(y, communicator, rank_send)
              err.backward()
  
          elif communicator.rank == communicator.size - 1:
              y = chainermn.functions.recv(
                  communicator, rank_recv, force_tuple=True
              )
              assert isinstance(y, tuple)
              z = functools.reduce(lambda x, y: x + y, y)
              err = evaluation(z, x)
              err.backward()
  
          else:
              y = chainermn.functions.recv(communicator, rank_recv)
              err = chainermn.functions.send(y, communicator, rank_send)
              err.backward()
  
imports: import functools
  import chainer
  import copy
  from chainer.backends.cuda import cupy
  import chainer.testing
  import chainer.testing.attr
  import numpy
  import pytest
  import chainermn
  from chainer.functions import sigmoid
  from chainer.functions import mean_squared_error
label_desc: Use image node_id 11 for calling a global function with example usage: check_tuple_communication(length, gpu, param) without return types