class_docstr: Meter to calculate top-k accuracy for single label/ multi label
  image classification task.
class_docstr_tok: ["Meter","to","calculate","top-k","accuracy","for","single","label\/","multi","label","image","classification","task","."]
code: def sync_state(self):
      # Communications
      self._curr_correct_predictions_k = all_reduce_sum(
          self._curr_correct_predictions_k
      )
      self._curr_sample_count = all_reduce_sum(self._curr_sample_count)
  
      # Store results
      self._total_correct_predictions_k += (
          self._curr_correct_predictions_k
      )
      self._total_sample_count += self._curr_sample_count
  
      # Reset values until next sync
      self._curr_correct_predictions_k.zero_()
      self._curr_sample_count.zero_()
  
file_path: ClassyVision/classy_vision/meters/accuracy_meter.py
imports: from typing import Any, Dict, Sequence
  import torch
  from classy_vision.generic.distributed_util import all_reduce_sum
  from classy_vision.generic.util import is_pos_int, maybe_convert_to_one_hot
  from classy_vision.meters import ClassyMeter
  from .None import register_meter
label_desc: Use image node_id 4 for calling the AccuracyMeter obj's underlying member method code with example usage: obj.sync_state() without return types