class_docstr: This is a wrapper class.
  It smooths the input and target at different scales before passing them into the wrapped loss function.
  
  Adapted from:
      DeepReg (https://github.com/DeepRegNet/DeepReg)
class_docstr_tok: ["This","is","a","wrapper","class",".","It","smooths","the","input","and","target","at","different","scales","before","passing","them","into","the","wrapped","loss","function",".","Adapted","from",":","DeepReg","(","https",":","\/\/github.com\/DeepRegNet\/DeepReg",")"]
code: def forward(
      self, y_true: torch.Tensor, y_pred: torch.Tensor
  ) -> torch.Tensor:
      if self.scales is None:
          loss: torch.Tensor = self.loss(y_pred, y_true)
      else:
          loss_list = []
          for s in self.scales:
              if s == 0:
                  # no smoothing
                  loss_list.append(self.loss(y_pred, y_true))
              else:
                  loss_list.append(
                      self.loss(
                          separable_filtering(
                              y_pred,
                              [self.kernel_fn(s).to(y_pred)]
                              * (y_true.ndim - 2),
                          ),
                          separable_filtering(
                              y_true,
                              [self.kernel_fn(s).to(y_pred)]
                              * (y_true.ndim - 2),
                          ),
                      )
                  )
          loss = torch.stack(loss_list, dim=0)
  
      if self.reduction == LossReduction.MEAN.value:
          loss = torch.mean(loss)  # the batch and channel average
      elif self.reduction == LossReduction.SUM.value:
          loss = torch.sum(loss)  # sum over the batch and channel dims
      elif self.reduction != LossReduction.NONE.value:
          raise ValueError(
              f'Unsupported reduction: {self.reduction}, available options are ["mean", "sum", "none"].'
          )
  
      return loss
  
file_path: MONAI/monai/losses/multi_scale.py
imports: from __future__ import annotations
  import torch
  from torch.nn.modules.loss import _Loss
  from monai.networks.layers import gaussian_1d, separable_filtering
  from monai.utils import LossReduction
label_desc: Use image node_id 2 for calling the MultiScaleLoss obj's underlying member method code with example usage: obj.forward(y_true, y_pred) and returns: loss