code: def test_nccl_allreduce(self, n, m, in_place):
      xs = [np.random.randn(m).astype(np.float32) for i in range(n)]
      inputs = [str("x_{}".format(i)) for i in range(n)]
      prefix = "" if in_place else "o"
      outputs = [str("{}x_{}".format(prefix, i)) for i in range(n)]
      op = core.CreateOperator("NCCLAllreduce", inputs, outputs)
      input_device_options = {
          n: gpu_device(i) for i, n in enumerate(inputs)
      }
  
      def allreduce(*args):
          assert len(args) == n
          output = np.sum(args, axis=0)
          return [output for _ in range(n)]
  
      outputs = self.assertReferenceChecks(
          hu.gpu_do,
          op,
          [xs[i] for i, _ in enumerate(inputs)],
          allreduce,
          input_device_options,
      )
      for output in outputs:
          np.testing.assert_array_equal(outputs[0], output)
          self.assertEqual(outputs[0].tobytes(), output.tobytes())
  
file_path: pytorch/caffe2/contrib/nccl/nccl_ops_test.py
imports: import unittest
  import hypothesis.strategies
  from hypothesis import given, assume
  import numpy
  import time
  import os
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace, muji, dyndep
  import caffe2.python.hypothesis_test_util
label_desc: Use image node_id 1 for calling the NCCLOpsTest obj's underlying member method code with example usage: obj.test_nccl_allreduce(n, m, in_place) and returns: unknown