class_docstr: Output layer that incrementally adds units whenever new classes are
  encountered.
  
  Typically used in class-incremental benchmarks where the number of
  classes grows over time.
class_docstr_tok: ["Output","layer","that","incrementally","adds","units","whenever","new","classes","are","encountered",".","Typically","used","in","class-incremental","benchmarks","where","the","number","of","classes","grows","over","time","."]
docstr: :param in_features: number of input features.
  :param initial_out_features: initial number of classes (can be
      dynamically expanded).
  :param masking: whether unused units should be masked (default=True).
  :param mask_value: the value used for masked units (default=-1000).
docstr_tok: [":","param","in_features",":","number","of","input","features",".",":","param","initial_out_features",":","initial","number","of","classes","(","can","be","dynamically","expanded",")",".",":","param","masking",":","whether","unused","units","should","be","masked","(","default=True",")",".",":","param","mask_value",":","the","value","used","for","masked","units","(","default=-1000",")","."]
code: def __init__(
      self,
      in_features,
      initial_out_features=2,
      masking=True,
      mask_value=-1000,
  ):
      """
      :param in_features: number of input features.
      :param initial_out_features: initial number of classes (can be
          dynamically expanded).
      :param masking: whether unused units should be masked (default=True).
      :param mask_value: the value used for masked units (default=-1000).
      """
      super().__init__()
      self.masking = masking
      self.mask_value = mask_value
  
      self.classifier = torch.nn.Linear(
          in_features, initial_out_features
      )
      au_init = torch.zeros(initial_out_features, dtype=torch.int8)
      self.register_buffer("active_units", au_init)
  
imports: import torch
  from torch.nn import Module
  from typing import Optional
  from avalanche.benchmarks.utils.flat_data import ConstantSequence
  from avalanche.benchmarks.scenarios import CLExperience
label_desc: Use image node_id 1 to create a new IncrementalClassifier object from inherited base classes: DynamicModule with example: obj = IncrementalClassifier(in_features, initial_out_features, masking, mask_value)