code: def update(
      self,
      y_pred: torch.Tensor,
      y_true: torch.Tensor,
      mask: torch.Tensor,
      scales: Optional[torch.Tensor] = None,
  ) -> None:
      if self.rescale:
          m = scales[:, 0].unsqueeze(1)
          std = scales[:, 1].unsqueeze(1)
          y_true = y_true * std + m
          y_pred = y_pred * std.unsqueeze(2) + m.unsqueeze(2)
  
      idx_median = y_pred.size()[-1] // 2
      y_pred = y_pred[:, : y_true.size()[1], idx_median]
      losses = (y_pred - y_true).abs()
      losses = torch.mul(losses, mask)
  
      self.numerator += losses.sum()
      self.denom += y_true.abs().sum()
  
imports: from typing import Any, Callable, Optional
  import torch
  from torchmetrics import Metric
label_desc: Use image node_id 2 for calling the NormalizedDeviation obj's underlying member method code with example usage: obj.update(y_pred, y_true, mask, scales) without return types