code: def test_broadcast_torch_cupy(ray_start_single_node_2_gpus, src_rank):
      import torch
  
      world_size = 2
      actors, _ = create_collective_workers(world_size)
      ray.wait(
          [
              actors[1].set_buffer.remote(
                  torch.ones(
                      10,
                  ).cuda()
                  * world_size
              )
          ]
      )
      results = ray.get(
          [a.do_broadcast.remote(src_rank=src_rank) for a in actors]
      )
      if src_rank == 0:
          assert (results[0] == cp.ones((10,))).all()
          assert (results[1] == torch.ones((10,)).cuda()).all()
      else:
          assert (results[0] == cp.ones((10,)) * world_size).all()
          assert (
              results[1] == torch.ones((10,)).cuda() * world_size
          ).all()
  
file_path: ray/python/ray/util/collective/tests/single_node_gpu_tests/test_broadcast.py
imports: import pytest
  import cupy
  import ray
  from ray.util.collective.tests.util import create_collective_workers
label_desc: Use image node_id 3 for calling a global function with example usage: test_broadcast_torch_cupy(ray_start_single_node_2_gpus, src_rank) without return types