code: def test_v_head_loss_weight():
      target_q_values = mx.nd.array(((3, 5), (-1, -2), (0, 2)))
      pred_q_values = mx.nd.array(((4, 5), (-2, -2), (1, 2)))
      loss_fn = QHeadLoss()
      loss = loss_fn(pred_q_values, target_q_values)
      loss_fn_weighted = QHeadLoss(weight=0.5)
      loss_weighted = loss_fn_weighted(pred_q_values, target_q_values)
      assert loss[0] == loss_weighted[0] * 2
  
file_path: coach/rl_coach/tests/architectures/mxnet_components/heads/test_q_head.py
imports: import mxnet
  import os
  import pytest
  import sys
  from rl_coach.architectures.mxnet_components.heads.q_head import QHead, QHeadLoss
  from rl_coach.agents.clipped_ppo_agent import ClippedPPOAgentParameters
  from rl_coach.spaces import SpacesDefinition, DiscreteActionSpace
label_desc: Use image node_id 2 for calling a global function with example usage: test_v_head_loss_weight() without return types