class_docstr: At the end of the entire stream of experiences, this plugin metric
  reports the average top-k accuracy over all patterns
  seen in all experiences. This metric only works at eval time.
class_docstr_tok: ["At","the","end","of","the","entire","stream","of","experiences",",","this","plugin","metric","reports","the","average","top-k","accuracy","over","all","patterns","seen","in","all","experiences",".","This","metric","only","works","at","eval","time","."]
docstr: Creates an instance of StreamTopkAccuracy metric
docstr_tok: ["Creates","an","instance","of","StreamTopkAccuracy","metric"]
code: def __init__(self, top_k):
      """
      Creates an instance of StreamTopkAccuracy metric
      """
      super(StreamTopkAccuracy, self).__init__(
          reset_at="stream", emit_at="stream", mode="eval", top_k=top_k
      )
      self.top_k = top_k
  
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 StreamTopkAccuracy object from inherited base classes: TopkAccuracyPluginMetric with example: obj = StreamTopkAccuracy(top_k)