class_docstr: Mean squared, absolute error loss.
  Calculates both losses and returns a dict with string keys.
class_docstr_tok: ["Mean","squared",",","absolute","error","loss",".","Calculates","both","losses","and","returns","a","dict","with","string","keys","."]
code: def forward(self, sample_list, model_output):
      targets = sample_list["targets"]
      scores = model_output["scores"]
      loss = {
          "mse": F.mse_loss(scores, targets),
          "mae": F.l1_loss(scores, targets),
      }
      return loss
  
imports: import collections
  import unittest
  from unittest.mock import MagicMock
  import mmf.modules.losses
  import torch
  import torch.nn
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.common.sample import SampleList
label_desc: Use image node_id 2 for calling the TestMSEAndMAELoss obj's underlying member method code with example usage: obj.forward(sample_list, model_output) and returns: loss