code: def _auc_compute(
      x: Tensor, y: Tensor, reorder: bool = False
  ) -> Tensor:
      with torch.no_grad():
          if reorder:
              x, x_idx = torch.sort(x, stable=True)
              y = y[x_idx]
  
          dx = x[1:] - x[:-1]
          if (dx < 0).any():
              if (dx <= 0).all():
                  direction = -1.0
              else:
                  raise ValueError(
                      "The `x` tensor is neither increasing or decreasing. Try setting the reorder argument to `True`."
                  )
          else:
              direction = 1.0
          return _auc_compute_without_check(x, y, direction)
  
file_path: torchmetrics/src/torchmetrics/utilities/compute.py
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 7 for calling a global function with example usage: _auc_compute(x, y, reorder) and returns: _auc_compute_without_check