code: def forward(self, model_output, lens):
      mask = get_mask_from_lengths(lens // self.n_group_size)
      mask = mask[:, None].float()
      loss_dict = {}
      if "z" in model_output:
          n_elements = lens.sum() // self.n_group_size
          n_dims = model_output["z"].size(1)
  
          loss, loss_prior = compute_flow_loss(
              model_output["z"],
              model_output["log_det_W_list"],
              model_output["log_s_list"],
              n_elements,
              n_dims,
              mask,
              self.sigma,
          )
          loss_dict = {
              "loss_{}".format(self.name): (loss, self.loss_weight),
              "loss_prior_{}".format(self.name): (loss_prior, 0.0),
          }
      elif "x_hat" in model_output:
          loss_dict = compute_regression_loss(
              model_output["x_hat"], model_output["x"], mask, self.name
          )
          for k, v in loss_dict.items():
              loss_dict[k] = (v, self.loss_weight)
  
      if len(loss_dict) == 0:
          raise Exception("loss not supported")
  
      return loss_dict
  
file_path: NeMo/nemo/collections/tts/losses/radttsloss.py
imports: import torch
  from torch.nn import functional
  from nemo.collections.tts.losses.aligner_loss import ForwardSumLoss
  from nemo.collections.tts.parts.utils.helpers import get_mask_from_lengths
  from nemo.core.classes import Loss
label_desc: Use image node_id 2 for calling the AttributePredictionLoss obj's underlying member method code with example usage: obj.forward(model_output, lens) and returns: loss_dict