code: def _logsoftmax(x: Tensor, dim: int = -1) -> Tensor:
      return torch.nn.functional.log_softmax(x, dim)
  
file_path: torchmetrics/tests/unittests/classification/inputs.py
imports: from typing import Any
  import pytest
  import torch
  from torch import Tensor
  from unittests import BATCH_SIZE, EXTRA_DIM, NUM_BATCHES, NUM_CLASSES, _GroupInput, _Input
  from unittests.helpers import seed_all
label_desc: Use image node_id 2 for calling a global function with example usage: _logsoftmax(x, dim) and returns: torch