code: def sum_losses_mmseg(losses_dict):
      loss_ = {}
      for k, v in losses_dict.items():
          if k.__contains__("loss"):
              if isinstance(v, torch.Tensor):
                  loss_[k] = float(v.cpu().numpy())
              elif isinstance(v, list):
                  loss_[k] = sum([float(o.cpu().numpy()) for o in v])
  
      loss_["loss_total"] = sum(loss_.values())
      return loss_
  
file_path: icevision/icevision/models/mmseg/common/interpretation_utils.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.models.interpretation import _move_to_device
  from icevision.core.record_components import LossesRecordComponent
  from icevision.models.mmseg.common.utils import mmseg_tensor_to_image
label_desc: Use image node_id 1 for calling a global function with example usage: sum_losses_mmseg(losses_dict) and returns: loss_