code: def test_collective_errors(self, device):
      t = torch.rand(10).cuda(0)
      with self.assertRaisesRegex(
          TypeError, "Inputs should be a collection of tensors"
      ):
          nccl.all_reduce(t)
  
      with self.assertRaisesRegex(
          TypeError, "Inputs should be a collection of tensors"
      ):
          nccl.reduce(t)
  
      with self.assertRaisesRegex(
          TypeError, "Inputs should be a collection of tensors"
      ):
          nccl.broadcast(t)
  
      with self.assertRaisesRegex(
          TypeError, "Inputs should be a collection of tensors"
      ):
          nccl.all_gather(t, t)
  
      with self.assertRaisesRegex(
          TypeError, "Inputs should be a collection of tensors"
      ):
          nccl.reduce_scatter(t, t)
  
file_path: pytorch/test/distributed/test_nccl.py
imports: import sys
  import torch
  import torch.cuda.nccl
  import torch.cuda
  import torch.distributed
  from torch.testing._internal.common_utils import TestCase, run_tests, IS_WINDOWS, load_tests, TEST_WITH_ROCM, skip_but_pass_in_sandcastle_if, NoTest
  from torch.testing._internal.common_cuda import TEST_CUDA, TEST_MULTIGPU
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes
  import re
label_desc: Use image node_id 5 for calling the TestNCCL obj's underlying member method code with example usage: obj.test_collective_errors(device) without return types