code: def test_allgather_different_array_size(
      ray_start_distributed_multigpu_2_nodes_4_gpus,
      array_size,
      tensor_backend,
  ):
      world_size = 2
      num_gpu_per_worker = 2
      actual_world_size = world_size * num_gpu_per_worker
      actors, _ = create_collective_multigpu_workers(world_size)
      init_tensors_for_gather_scatter_multigpu(
          actors, array_size=array_size, tensor_backend=tensor_backend
      )
      results = ray.get(
          [a.do_allgather_multigpu.remote() for a in actors]
      )
      for i in range(world_size):
          for j in range(num_gpu_per_worker):
              for k in range(actual_world_size):
                  if tensor_backend == "cupy":
                      assert (
                          results[i][j][k]
                          == cp.ones(array_size, dtype=cp.float32)
                      ).all()
                  else:
                      assert (
                          results[i][j][k]
                          == torch.ones(
                              array_size, dtype=torch.float32
                          ).cuda(j)
                      ).all()
  
imports: import pytest
  import ray
  import cupy
  import torch
  from ray.util.collective.tests.util import create_collective_multigpu_workers, init_tensors_for_gather_scatter_multigpu
label_desc: Use image node_id 1 for calling a global function with example usage: test_allgather_different_array_size(ray_start_distributed_multigpu_2_nodes_4_gpus, array_size, tensor_backend) without return types