class_docstr: Test various loss functions in model_utils.
class_docstr_tok: ["Test","various","loss","functions","in","model_utils","."]
docstr: Test weighted_box_l1_loss against manually specified targets.
docstr_tok: ["Test","weighted_box_l1_loss","against","manually","specified","targets","."]
code: def test_weighted_box_l1_loss(self):
      """Test weighted_box_l1_loss against manually specified targets."""
      x1 = jnp.array([[0.1, 0.3, 0.9, 0.8]], dtype=jnp.float32)
      y1 = jnp.array([[0.5, 0.1, 0.9, 0.7]], dtype=jnp.float32)
  
      out1 = model_utils.weighted_box_l1_loss(x1, y1)
      out1_target = jnp.array([[0.4, 0.2, 0, 0.1]], dtype=jnp.float32)
      self.assertSequenceAlmostEqual(
          out1.flatten(), out1_target.flatten(), places=5
      )
  
      out2 = model_utils.weighted_box_l1_loss(
          x1, y1, reduction="mean"
      ).item()
      out2_target = jnp.mean(out1_target).item()
      self.assertAlmostEqual(out2, out2_target, places=5)
  
      out3 = model_utils.weighted_box_l1_loss(x1, y1, tight=False)
      out3_target = jnp.array([[0.4, 0.0, 0.0, 0.1]], dtype=jnp.float32)
      self.assertSequenceAlmostEqual(
          out3.flatten(), out3_target.flatten(), places=5
      )
  
imports: import itertools
  from absl.testing import absltest
  from absl.testing import parameterized
  from flax.training import common_utils
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import model_utils
label_desc: Use image node_id 2 for calling the LossTest obj's underlying member method code with example usage: obj.test_weighted_box_l1_loss() without return types