code: def _test_non_contiguous_tensors(rank):
      class DummyCatMetric(Metric):
          full_state_update = True
  
          def __init__(self) -> None:
              super().__init__()
              self.add_state("x", default=[], dist_reduce_fx=None)
  
          def update(self, x):
              self.x.append(x)
  
          def compute(self):
              x = torch.cat(self.x, dim=0)
              return x.sum()
  
      metric = DummyCatMetric()
      metric.update(torch.randn(10, 5)[:, 0])
  
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 8 for calling a global function with example usage: _test_non_contiguous_tensors(rank) and returns: x