class_docstr: Test box_iou and generalized_box_iou functions.
class_docstr_tok: ["Test","box_iou","and","generalized_box_iou","functions","."]
docstr: Test box_iou using hand designed targets.
docstr_tok: ["Test","box_iou","using","hand","designed","targets","."]
code: def test_box_iou(self):
      """Test box_iou using hand designed targets."""
      in1 = jnp.array(
          [
              [
                  [0.1, 0.2, 0.3, 0.4],
                  [0.1, 0.2, 0.5, 1.0],
                  [0.1, 0.2, 0.5, 0.8],
              ],
              [
                  [0.6, 0.2, 1.0, 1.0],
                  [0.6, 0.2, 1.0, 0.8],
                  [0.0, 0.0, 0.0, 0.0],
              ],
              [
                  [0.0, 0.0, 0.0, 0.0],
                  [0.2, 0.1, 0.2, 0.1],
                  [0.1, 0.1, 0.2, 0.2],
              ],
          ],
          dtype=jnp.float32,
      )
      in2 = jnp.array(
          [
              [
                  [0.4, 0.4, 0.5, 0.8],
                  [0.4, 0.4, 0.5, 0.8],
                  [0.4, 0.4, 0.7, 0.8],
              ],
              [
                  [0.7, 0.4, 0.8, 0.6],
                  [0.8, 0.6, 0.7, 0.4],
                  [0.1, 0.1, 0.2, 0.2],
              ],
              [
                  [0.0, 0.0, 0.0, 0.0],
                  [0.2, 0.1, 0.2, 0.1],
                  [0.1, 0.1, 0.2, 0.2],
              ],
          ],
          dtype=jnp.float32,
      )
  
      target = jnp.array(
          [[0.0, 0.125, 0.125], [0.0625, 0.0, 0.0], [0.0, 0.0, 1.0]],
          dtype=jnp.float32,
      )
  
      output, _ = box_utils.box_iou(in1, in2, all_pairs=False)
  
      self.assertSequenceAlmostEqual(
          output.flatten(), target.flatten(), places=3
      )
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import box_utils
  from shapely import geometry
label_desc: Use image node_id 2 for calling the IoUTest obj's underlying member method code with example usage: obj.test_box_iou() without return types