class_docstr: Wrapper class around the main loss function to accept a list of tensors returned from a deeply
  supervised networks. The final loss is computed as the sum of weighted losses for each of deep supervision levels.
code: def forward(
      self,
      input: Union[None, torch.Tensor, list[torch.Tensor]],
      target: torch.Tensor,
  ) -> torch.Tensor:
      if isinstance(input, (list, tuple)):
          weights = self.get_weights(levels=len(input))
          loss = torch.tensor(
              0, dtype=torch.float, device=target.device
          )
          for l in range(len(input)):
              loss += weights[l] * self.get_loss(
                  input[l].float(), target
              )
          return loss
      if input is None:
          raise ValueError("input shouldn't be None.")
  
      return self.loss(input.float(), target)
  
file_path: MONAI/monai/losses/ds_loss.py
imports: from __future__ import annotations
  from typing import Union
  import torch
  import torch.nn.functional
  from torch.nn.modules.loss import _Loss
  from monai.utils import pytorch_after
label_desc: Use image node_id 4 for calling the DeepSupervisionLoss obj's underlying member method code with example usage: obj.forward(input, target) and returns: self, loss