code: def _test_all_gather_uneven_tensors(strategy):
      rank = strategy.local_rank
      device = strategy.root_device
      world_size = strategy.num_processes
  
      tensor = torch.ones(rank, device=device)
      result = _gather_all_tensors(tensor)
      assert len(result) == world_size
      for idx in range(world_size):
          assert len(result[idx]) == idx
          assert (result[idx] == torch.ones_like(result[idx])).all()
  
imports: import functools
  import os
  from functools import partial
  from pathlib import Path
  from unittest import mock
  import pytest
  import torch
  from lightning.fabric.accelerators import CPUAccelerator, CUDAAccelerator, MPSAccelerator
  from lightning.fabric.plugins.environments import LightningEnvironment
  from lightning.fabric.strategies import DDPStrategy, SingleDeviceStrategy
  from lightning.fabric.strategies.launchers.multiprocessing import _MultiProcessingLauncher
  from lightning.fabric.utilities.distributed import _gather_all_tensors, _set_num_threads_if_needed, _suggested_max_num_threads, _sync_ddp, is_shared_filesystem
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 3 for calling a global function with example usage: _test_all_gather_uneven_tensors(strategy) without return types