class_docstr: ClassBalancedBuffer that also stores the logits
class_docstr_tok: ["ClassBalancedBuffer","that","also","stores","the","logits"]
docstr: Init.
  
  :param max_size: The max capacity of the replay memory.
  :param adaptive_size: True if mem_size is divided equally over all
                      observed experiences (keys in replay_mem).
  :param total_num_classes: If adaptive size is False, the fixed number
                            of classes to divide capacity over.
  :param transforms: transformation to be applied to the buffer
docstr_tok: ["Init",".",":","param","max_size",":","The","max","capacity","of","the","replay","memory",".",":","param","adaptive_size",":","True","if","mem_size","is","divided","equally","over","all","observed","experiences","(","keys","in","replay_mem",")",".",":","param","total_num_classes",":","If","adaptive","size","is","False",",","the","fixed","number","of","classes","to","divide","capacity","over",".",":","param","transforms",":","transformation","to","be","applied","to","the","buffer"]
code: def __init__(
      self,
      max_size: int,
      adaptive_size: bool = True,
      total_num_classes: Optional[int] = None,
  ):
      """Init.
  
      :param max_size: The max capacity of the replay memory.
      :param adaptive_size: True if mem_size is divided equally over all
                          observed experiences (keys in replay_mem).
      :param total_num_classes: If adaptive size is False, the fixed number
                                of classes to divide capacity over.
      :param transforms: transformation to be applied to the buffer
      """
      if not adaptive_size:
          assert (
              total_num_classes is not None and total_num_classes > 0
          ), "When fixed exp mem size, total_num_classes should be > 0."
  
      super().__init__(max_size, adaptive_size, total_num_classes)
      self.adaptive_size = adaptive_size
      self.total_num_classes = total_num_classes
      self.seen_classes: Set[int] = set()
  
imports: from collections import defaultdict
  from typing import Callable, Dict, List, Optional, Sequence, Set, SupportsInt, Union
  import torch
  import torch.nn.functional
  from torch.nn import CrossEntropyLoss, Module
  from torch.optim import Optimizer
  from avalanche.benchmarks.utils import make_avalanche_dataset
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.data_attribute import TensorDataAttribute
  from avalanche.training.utils import cycle
  from avalanche.core import SupervisedPlugin
  from avalanche.training.plugins.evaluation import EvaluationPlugin, default_evaluator
  from avalanche.training.storage_policy import BalancedExemplarsBuffer, ReservoirSamplingBuffer
  from avalanche.training.templates import SupervisedTemplate
label_desc: Use image node_id 1 to create a new ClassBalancedBufferWithLogits object from inherited base classes: BalancedExemplarsBuffer with example: obj = ClassBalancedBufferWithLogits(max_size, adaptive_size, total_num_classes)