class_docstr: Auxiliary data structure responsible for running asynchronous all-reduce
  :param part_shapes: a sequence of shapes of torch tensors that will be averaged by this reducer
  :param num_senders: total number of peers in a given all-reduce group that will send gradients
  :note: even if local peer is not sending data, local parts will be used for shape information
class_docstr_tok: ["Auxiliary","data","structure","responsible","for","running","asynchronous","all-reduce",":","param","part_shapes",":","a","sequence","of","shapes","of","torch","tensors","that","will","be","averaged","by","this","reducer",":","param","num_senders",":","total","number","of","peers","in","a","given","all-reduce","group","that","will","send","gradients",":","note",":","even","if","local","peer","is","not","sending","data",",","local","parts","will","be","used","for","shape","information"]
docstr: (re)create averaging buffers for the next part in line, prepopulate with local tensor part
docstr_tok: ["(","re",")","create","averaging","buffers","for","the","next","part","in","line",",","prepopulate","with","local","tensor","part"]
code: def reset_accumulators(self):
      """(re)create averaging buffers for the next part in line, prepopulate with local tensor part"""
      assert (
          self.current_part_accumulated_from == self.num_current_senders
          or self.current_part_index == -1
      )
      if self.current_part_index >= self.num_parts - 1:
          self.finalize()
          return
  
      self.current_part_index += 1
      self.current_part_accumulated_from = 0
      self.current_part_future = asyncio.Future()
      self.num_current_senders = sum(
          self.current_part_index < failed_index
          for failed_index in self.sender_failed_after
      )
      self.accumulator = torch.zeros(
          self.part_shapes[self.current_part_index]
      )
      self.denominator = 0.0
  
imports: import asyncio
  from collections import deque
  from typing import AsyncIterable, AsyncIterator, Optional, Sequence, Tuple, TypeVar
  import numpy
  import torch
  from hivemind.compression import CompressionBase, CompressionInfo, NoCompression
  from hivemind.proto import runtime_pb2
  from hivemind.utils import amap_in_executor, as_aiter, get_logger
label_desc: Use image node_id 2 for calling the TensorPartReducer obj's underlying member method code with example usage: obj.reset_accumulators() without return types