class_docstr: This class implements the RecMetricComputation for MAE, i.e. Mean Absolute Error.
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
code: def update(
      self,
      *,
      predictions: Optional[torch.Tensor],
      labels: torch.Tensor,
      weights: Optional[torch.Tensor],
  ) -> None:
      if predictions is None or weights is None:
          raise RecMetricException(
              "Inputs 'predictions' and 'weights' should not be None for MAEMetricComputation update"
          )
      states = get_mae_states(labels, predictions, weights)
      num_samples = predictions.shape[-1]
      for state_name, state_value in states.items():
          state = getattr(self, state_name)
          state += state_value
          self._aggregate_window_state(
              state_name, state_value, num_samples
          )
  
file_path: torchrec/torchrec/metrics/mae.py
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 2 for calling the MAEMetricComputation obj's underlying member method code with example usage: obj.update() without return types