code: def test_reducescatter_different_array_size(
      ray_start_distributed_2_nodes_4_gpus, array_size, tensor_backend
  ):
      world_size = 4
      actors, _ = create_collective_workers(world_size)
      init_tensors_for_gather_scatter(
          actors, array_size=array_size, tensor_backend=tensor_backend
      )
      results = ray.get([a.do_reducescatter.remote() for a in actors])
      for i in range(world_size):
          if tensor_backend == "cupy":
              assert (
                  results[i]
                  == cp.ones(array_size, dtype=cp.float32) * world_size
              ).all()
          else:
              assert (
                  results[i]
                  == torch.ones(array_size, dtype=torch.float32).cuda()
                  * world_size
              ).all()
  
file_path: ray/python/ray/util/collective/tests/distributed_gpu_tests/test_distributed_reducescatter.py
imports: import pytest
  import ray
  import cupy
  import torch
  from ray.util.collective.tests.util import create_collective_workers, init_tensors_for_gather_scatter
label_desc: Use image node_id 1 for calling a global function with example usage: test_reducescatter_different_array_size(ray_start_distributed_2_nodes_4_gpus, array_size, tensor_backend) without return types