class_docstr: The standalone Loss metric. This is a general metric
  used to compute more specific ones.
  
  Instances of this metric keeps the running average loss
  over multiple <prediction, target> pairs of Tensors,
  provided incrementally.
  The "prediction" and "target" tensors may contain plain labels or
  one-hot/logit vectors.
  
  Each time `result` is called, this metric emits the average loss
  across all predictions made 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 a loss value of 0.
class_docstr_tok: ["The","standalone","Loss","metric",".","This","is","a","general","metric","used","to","compute","more","specific","ones",".","Instances","of","this","metric","keeps","the","running","average","loss","over","multiple","<","prediction",",","target",">","pairs","of","Tensors",",","provided","incrementally",".","The","``","prediction","''","and","``","target","''","tensors","may","contain","plain","labels","or","one-hot\/logit","vectors",".","Each","time","`","result","`","is","called",",","this","metric","emits","the","average","loss","across","all","predictions","made","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","a","loss","value","of","0","."]
docstr: Creates an instance of the loss metric.
  
  By default this metric in its initial state will return a loss
  value of 0. The metric can be updated by using the `update` method
  while the running loss can be retrieved using the `result` method.
code: def __init__(self):
      """
      Creates an instance of the loss metric.
  
      By default this metric in its initial state will return a loss
      value of 0. The metric can be updated by using the `update` method
      while the running loss can be retrieved using the `result` method.
      """
      self._mean_loss = defaultdict(Mean)
      """
          The mean utility that will be used to store the running accuracy
          for each task label.
          """
  
imports: from typing import List, Dict
  import torch
  from torch import Tensor
  from avalanche.evaluation import PluginMetric, Metric, GenericPluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task
  from collections import defaultdict
label_desc: Use image node_id 1 to create a new TaskAwareLoss object from inherited base classes: Metric with example: obj = TaskAwareLoss()