docstr: Update states depending on multidim_average argument.
docstr_tok: ["Update","states","depending","on","multidim_average","argument","."]
code: def _update_state(
      self, tp: Tensor, fp: Tensor, tn: Tensor, fn: Tensor
  ) -> None:
      """Update states depending on multidim_average argument."""
      if self.multidim_average == "samplewise":
          self.tp.append(tp)
          self.fp.append(fp)
          self.tn.append(tn)
          self.fn.append(fn)
      else:
          self.tp += tp
          self.fp += fp
          self.tn += tn
          self.fn += fn
  
imports: from typing import Any, Callable, List, Optional, Tuple, Type, Union
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.classification.base import _ClassificationTaskWrapper
  from torchmetrics.functional.classification.stat_scores import _binary_stat_scores_arg_validation, _binary_stat_scores_compute, _binary_stat_scores_format, _binary_stat_scores_tensor_validation, _binary_stat_scores_update, _multiclass_stat_scores_arg_validation, _multiclass_stat_scores_compute, _multiclass_stat_scores_format, _multiclass_stat_scores_tensor_validation, _multiclass_stat_scores_update, _multilabel_stat_scores_arg_validation, _multilabel_stat_scores_compute, _multilabel_stat_scores_format, _multilabel_stat_scores_tensor_validation, _multilabel_stat_scores_update
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.data import dim_zero_cat
  from torchmetrics.utilities.enums import ClassificationTask
label_desc: Use image node_id 2 for calling the _AbstractStatScores obj's underlying member method code with example usage: obj._update_state(tp, fp, tn, fn) without return types