class_docstr: Knowledge distillation loops for training and evaluation. This module is independent of
  the model definition. This class inherits from the Pytorch Lightning's LightningModule:
  https://lightning.ai/docs/pytorch/stable/common/lightning_module.html
code: def _compute_metric_score(
      self,
      metric: torchmetrics.Metric,
      custom_metric_func: Callable,
      logits: torch.Tensor,
      label: torch.Tensor,
  ):
      if isinstance(
          metric,
          (
              torchmetrics.classification.BinaryAUROC,
              torchmetrics.classification.BinaryAveragePrecision,
          ),
      ):
          prob = F.softmax(logits.float(), dim=1)
          metric.update(
              preds=prob[:, 1], target=label
          )  # only for binary classification
      elif isinstance(metric, BaseAggregator):
          metric.update(custom_metric_func(logits, label))
      else:
          metric.update(logits.squeeze(dim=1), label)
  
imports: import logging
  from typing import Callable, List, Optional, Union
  import lightning.pytorch
  import torch
  import torch.nn.functional
  import torchmetrics
  from lightning.pytorch.utilities import grad_norm
  from omegaconf import DictConfig
  from torch import nn
  from torch.nn.modules.loss import _Loss
  from torchmetrics.aggregation import BaseAggregator
  from ..constants import FEATURES, LOGITS, WEIGHT
  from ..models.utils import run_model
  from .utils import apply_layerwise_lr_decay, apply_single_lr, apply_two_stages_lr, get_lr_scheduler, get_optimizer
label_desc: Use image node_id 8 for calling the DistillerLitModule obj's underlying member method code with example usage: obj._compute_metric_score(metric, custom_metric_func, logits, label) without return types