code: def test_bcast(seed, src, inplace, comm_nccl_opts):
      if comm_nccl_opts is None:
          pytest.skip(
              "Communicator test is disabled. You can turn it on by an option `--test-communicator`."
          )
      if len(comm_nccl_opts.devices) < 2:
          pytest.skip(
              "Communicator test is disabled. Use more than 1 gpus."
          )
  
      comm = comm_nccl_opts.comm
      device_id = int(comm_nccl_opts.device_id)
      n_devices = len(comm_nccl_opts.devices)
  
      # Variables
      x_list = []
      x_data_list = []
      num_layers = 20
      rng = np.random.RandomState(seed)
      for l in range(num_layers):
          x_data = rng.rand(3, 4)
          x_data_list.append(x_data)
          x = nn.Variable(x_data.shape)
          x.d = x_data * (device_id + 1)
          x_list.append(x)
  
      # Bcast
      comm.bcast([x.data for x in x_list], src, inplace=inplace)
  
      # Ref
      refs = ref_bcast(x_data_list, src)
  
      # Check
      for x, ref in zip(x_list, refs):
          assert_allclose(x.d, ref, rtol=1e-3, atol=1e-6)
  
imports: import pytest
  import nnabla
  import nnabla.parametric_functions
  import numpy
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 2 for calling a global function with example usage: test_bcast(seed, src, inplace, comm_nccl_opts) without return types