class_docstr: Test hungarian matcher.
docstr: Can recover the matching returned by Scipy for n < m matrices?
docstr_tok: ["Can","recover","the","matching","returned","by","Scipy","for","n","<","m","matrices","?"]
code: def test_cost_matches_scipy_rect_n_smaller_m(self, matcher_fn):
      """Can recover the matching returned by Scipy for n < m matrices?"""
      # Test where n < m.
      cost_matrix = self.cost_matrix[
          :, self.cost_matrix.shape[1] // 2 :, :
      ]
      sp_ind = np.array(
          list(
              map(
                  lambda x: tuple(sciopt.linear_sum_assignment(x)),
                  cost_matrix,
              )
          )
      )
      ind = matcher_fn(cost_matrix)
  
      for i, ((sp_row, sp_col), (row, col)) in enumerate(
          zip(sp_ind, ind)
      ):
          sp_cost = cost_matrix[i, sp_row, sp_col].sum()
          cost = cost_matrix[i, row, col].sum()
          self.assertAlmostEqual(sp_cost, cost, places=4)
  
imports: from typing import Optional
  from absl.testing import absltest
  from absl.testing import parameterized
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib import matchers
  from scenic.model_lib.base_models import box_utils
  import scipy.optimize
label_desc: Use image node_id 6 for calling the MatchingTest obj's underlying member method code with example usage: obj.test_cost_matches_scipy_rect_n_smaller_m(matcher_fn) without return types