code: def test_numerator(
      self, k, tau_grid, r, q, sigma, dtype, expected_shape
  ):
      k = tf.constant(k, dtype=dtype)
      tau_grid = tf.constant(tau_grid, dtype=dtype)
      r = tf.constant(r, dtype=dtype)
      q = tf.constant(q, dtype=dtype)
      sigma = tf.constant(sigma, dtype=dtype)
      # TODO(viktoriac): test against numpy results
      k_exp = k[:, tf.newaxis, tf.newaxis]
      r_exp = r[:, tf.newaxis, tf.newaxis]
      q_exp = q[:, tf.newaxis, tf.newaxis]
      epsilon = machine_eps(dtype)
  
      def _b_0(tau_grid_exp):
          one = tf.constant(1.0, dtype=dtype)
          return (
              tf.ones_like(tau_grid_exp)
              * k_exp
              * tf.where(
                  tf.math.abs(q_exp) < epsilon,
                  one,
                  tf.math.minimum(one, r_exp / q_exp),
              )
          )
  
      actual_numerator = boundary_numerator(
          tau_grid, _b_0, k, r, q, sigma
      )
      actual_numerator = np.array(self.evaluate(actual_numerator))
      self.assertEqual(actual_numerator.shape, expected_shape)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/american_option_pricing/exercise_boundary_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import utils
  from tf_quant_finance.experimental.american_option_pricing import common
  from tf_quant_finance.experimental.american_option_pricing import exercise_boundary
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling the ExerciseBoundaryTest obj's underlying member method code with example usage: obj.test_numerator(k, tau_grid, r, q, sigma, dtype, expected_shape) and returns: unknown