class_docstr: The WeightCheckpoint Metric.
  
  Instances of this metric keeps the weight checkpoint tensor of the
  model at each experience.
  
  Each time `result` is called, this metric emits the latest experience's
  weight checkpoint tensor since the last `reset`.
  
  The reset method will bring the metric to its initial state. By default
  this metric in its initial state will return None.
class_docstr_tok: ["The","WeightCheckpoint","Metric",".","Instances","of","this","metric","keeps","the","weight","checkpoint","tensor","of","the","model","at","each","experience",".","Each","time","`","result","`","is","called",",","this","metric","emits","the","latest","experience's","weight","checkpoint","tensor","since","the","last","`","reset","`",".","The","reset","method","will","bring","the","metric","to","its","initial","state",".","By","default","this","metric","in","its","initial","state","will","return","None","."]
docstr: Creates an instance of the WeightCheckpoint Metric.
  
  By default this metric in its initial state will return None.
  The metric can be updated by using the `update` method
  while the current experience's weight checkpoint tensor can be
  retrieved using the `result` method.
docstr_tok: ["Creates","an","instance","of","the","WeightCheckpoint","Metric",".","By","default","this","metric","in","its","initial","state","will","return","None",".","The","metric","can","be","updated","by","using","the","`","update","`","method","while","the","current","experience","'s","weight","checkpoint","tensor","can","be","retrieved","using","the","`","result","`","method","."]
code: def __init__(self):
      """
      Creates an instance of the WeightCheckpoint Metric.
  
      By default this metric in its initial state will return None.
      The metric can be updated by using the `update` method
      while the current experience's weight checkpoint tensor can be
      retrieved using the `result` method.
      """
      super().__init__()
      self.weights: Optional[bytes] = None
  
file_path: avalanche/avalanche/evaluation/metrics/checkpoint.py
imports: import copy
  import io
  from typing import TYPE_CHECKING, Optional
  from torch import Tensor
  import torch
  from avalanche.evaluation import PluginMetric
  from avalanche.evaluation.metric_results import MetricValue, MetricResult
  from avalanche.evaluation.metric_utils import get_metric_name
label_desc: Use image node_id 1 to create a new WeightCheckpoint object from inherited base classes: PluginMetric with example: obj = WeightCheckpoint()