code: def _check_type(self, output: Sequence[torch.Tensor]) -> None:
      super()._check_type(output)
  
      if (
          self._type in ["binary", "multiclass"]
          and self._average == "samples"
      ):
          raise ValueError(
              "Argument average='samples' is incompatible with binary and multiclass input data."
          )
  
      y_pred, y = output
      if self._type == "multiclass" and y.dtype != torch.long:
          warnings.warn(
              "`y` should be of dtype long when entry type is multiclass",
              RuntimeWarning,
          )
      if (
          self._type == "binary"
          and self._average is not False
          and (y.dtype != torch.long or y_pred.dtype != torch.long)
      ):
          warnings.warn(
              "`y` and `y_pred` should be of dtype long when entry type is binary and average!=False",
              RuntimeWarning,
          )
  
file_path: ignite/ignite/metrics/precision.py
imports: import warnings
  from typing import Callable, cast, Optional, Sequence, Union
  import torch
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics.accuracy import _BaseClassification
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
  from ignite.utils import to_onehot
label_desc: Use image node_id 2 for calling the _BasePrecisionRecall obj's underlying member method code with example usage: obj._check_type(output) without return types