class_docstr: This `Metric` calculates the mean absolute error (MAE) between two tensors.
docstr: # Parameters
  
  predictions : `torch.Tensor`, required.
      A tensor of predictions of shape (batch_size, ...).
  gold_labels : `torch.Tensor`, required.
      A tensor of the same shape as `predictions`.
  mask : `torch.BoolTensor`, optional (default = `None`).
      A tensor of the same shape as `predictions`.
code: def __call__(
      self,
      predictions: torch.Tensor,
      gold_labels: torch.Tensor,
      mask: Optional[torch.BoolTensor] = None,
  ) -> None:
      """
      # Parameters
  
      predictions : `torch.Tensor`, required.
          A tensor of predictions of shape (batch_size, ...).
      gold_labels : `torch.Tensor`, required.
          A tensor of the same shape as `predictions`.
      mask : `torch.BoolTensor`, optional (default = `None`).
          A tensor of the same shape as `predictions`.
      """
      predictions, gold_labels, mask = self.detach_tensors(
          predictions, gold_labels, mask
      )
  
      absolute_errors = torch.abs(predictions - gold_labels)
  
      if mask is not None:
          absolute_errors *= mask
          _total_count = torch.sum(mask)
      else:
          _total_count = gold_labels.numel()
      _absolute_error = torch.sum(absolute_errors)
  
      self._absolute_error += float(dist_reduce_sum(_absolute_error))
      self._total_count += int(dist_reduce_sum(_total_count))
  
file_path: allennlp/allennlp/training/metrics/mean_absolute_error.py
imports: from typing import Dict, Optional
  import torch
  from allennlp.training.metrics.metric import Metric
  from allennlp.nn.util import dist_reduce_sum
label_desc: Use image node_id 2 for calling the MeanAbsoluteError obj's underlying member method code with example usage: obj.__call__(predictions, gold_labels, mask) without return types