code: def _test_ddp_compositional_tensor(
      rank: int, worldsize: int = NUM_PROCESSES
  ) -> None:
      dummy = DummyMetricSum()
      dummy._reductions = {"x": torch.sum}
      dummy = dummy.clone() + dummy.clone()
      dummy.update(tensor(1))
      val = dummy.compute()
      assert val == 2 * worldsize
  
imports: import os
  import sys
  from copy import deepcopy
  from functools import partial
  import pytest
  import torch
  from torch import tensor
  from torchmetrics import Metric
  from torchmetrics.utilities.distributed import gather_all_tensors
  from torchmetrics.utilities.exceptions import TorchMetricsUserError
  from unittests import NUM_PROCESSES
  from unittests.helpers import seed_all
  from unittests.helpers.testers import DummyListMetric, DummyMetric, DummyMetricSum
label_desc: Use image node_id 6 for calling a global function with example usage: _test_ddp_compositional_tensor(rank, worldsize) without return types