code: def test_constructor_on_multiple_loss_list(self):
      heads_conf = [
          {"type": "mlp", "loss": "test_cls"},
          {"type": "itm"},
      ]
      tasks = []
      heads_dict = build_heads_dict(heads_conf, tasks, self.losses)
      self.assertTrue(isinstance(heads_dict, HeadsDict))
  
      # test forward
      task = None
      head_output = heads_dict.forward(
          task, self.model_output, self.sample_list
      )
      self.assertTrue(isinstance(head_output, dict))
      self.assertTrue("losses" in head_output)
      self.assertTrue(
          "test/test_dataset/logit_bce" in head_output["losses"]
      )
      self.assertTrue("itm_loss" in head_output["losses"])
  
file_path: mmf/tests/models/transformers/test_heads_dict.py
imports: import unittest
  import torch
  from mmf.common.sample import Sample
  from mmf.models.transformers.heads.utils import build_heads_dict, HeadsDict
  from mmf.modules.losses import MMFLoss
  from omegaconf import OmegaConf
label_desc: Use image node_id 6 for calling the TestHeadsDict obj's underlying member method code with example usage: obj.test_constructor_on_multiple_loss_list() without return types