code: def test_secant_nan_objective(self):
      # With this setup, the find_root_secant should short circuit on the
      # first starting point immediately, and short circuit on the second
      # iteration for the other two values.
      f = lambda x: tf.where(
          tf.abs(x) < 1e-5, np.nan * tf.ones_like(x), x
      )
      initial_position = tf1.placeholder_with_default(
          [0.0, -1.0, 10.0], shape=None
      )
  
      search_result = root_search.find_root_secant(f, initial_position)
  
      self.assertAllNan(search_result.objective_at_estimated_root)
      self.assertAllNan(search_result.estimated_root)
      self.assertAllEqual(
          search_result.num_iterations, tf.constant([0, 2, 2])
      )
  
imports: import numpy
  import scipy.optimize
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import special_math
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import root_search
label_desc: Use image node_id 11 for calling the SecantRootSearchTest obj's underlying member method code with example usage: obj.test_secant_nan_objective() without return types