code: def test_sum_arbitrary(self):
      config = self._get_config()
      crit = SumArbitraryLoss.from_config(config)
      outputs = self._get_outputs()
      targets = self._get_targets()
      self.assertAlmostEqual(
          crit(outputs, targets).item(), 1.0 + 2.0 + 3.0
      )
  
      # Verify changing losses works
      new_config = copy.deepcopy(config)
      new_config.update(
          {
              "losses": [{"name": "mock_a"}, {"name": "mock_b"}],
              "weights": [1.0, 1.0],
          }
      )
      crit = SumArbitraryLoss.from_config(new_config)
      self.assertAlmostEqual(crit(outputs, targets).item(), 1.0 + 2.0)
  
      # Verify changing weights works
      new_config = copy.deepcopy(config)
      new_config.update({"weights": [1.0, 2.0, 3.0]})
      crit = SumArbitraryLoss.from_config(new_config)
      self.assertAlmostEqual(
          crit(outputs, targets).item(), 1.0 + 2.0 * 2.0 + 3.0 * 3.0
      )
  
imports: import copy
  import unittest
  import torch
  from classy_vision.losses import build_loss, ClassyLoss, register_loss, SumArbitraryLoss
label_desc: Use image node_id 5 for calling the TestSumArbitraryLoss obj's underlying member method code with example usage: obj.test_sum_arbitrary() without return types