code: def _find_repeats(data: Tensor) -> Tensor:
      """Find and return values which have repeats i.e. the same value are more than once in the tensor."""
      temp = data.detach().clone()
      temp = temp.sort()[0]
  
      change = torch.cat(
          [
              torch.tensor([True], device=temp.device),
              temp[1:] != temp[:-1],
          ]
      )
      unique = temp[change]
      change_idx = torch.cat(
          [
              torch.nonzero(change),
              torch.tensor([[temp.numel()]], device=temp.device),
          ]
      ).flatten()
      freq = change_idx[1:] - change_idx[:-1]
      atleast2 = freq > 1
      return unique[atleast2]
  
file_path: torchmetrics/src/torchmetrics/functional/regression/spearman.py
imports: from typing import Tuple
  import torch
  from torch import Tensor
  from torchmetrics.functional.regression.utils import _check_data_shape_to_num_outputs
  from torchmetrics.utilities.checks import _check_same_shape
label_desc: Use image node_id 1 for calling a global function with example usage: _find_repeats(data) and returns: unique