class_docstr: Base class for all top-k accuracies plugin metrics
class_docstr_tok: ["Base","class","for","all","top-k","accuracies","plugin","metrics"]
code: def __init__(self, reset_at, emit_at, mode, top_k):
      super(TopkAccuracyPluginMetric, self).__init__(
          TopkAccuracy(top_k=top_k),
          reset_at=reset_at,
          emit_at=emit_at,
          mode=mode,
      )
  
imports: from typing import TYPE_CHECKING, List, Union, Dict
  import torch
  from torch import Tensor
  import torchmetrics
  from torchmetrics.functional import accuracy
  from avalanche.evaluation import Metric, GenericPluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task
  from collections import defaultdict
  from packaging import version
label_desc: Use image node_id 1 to create a new TopkAccuracyPluginMetric object from inherited base classes: GenericPluginMetric with example: obj = TopkAccuracyPluginMetric(reset_at, emit_at, mode, top_k)