code: def test_normal_probability_of_improvement_matches_parallel(self):
      shape = [5, 20]
      loc = 2.0 * np.random.uniform(size=shape).astype(self.dtype)
      scale = 3.0 + np.random.uniform(size=[20]).astype(self.dtype)
      observations = np.array([2.0, 3.0, 4.0]).astype(self.dtype)
      best_observed = tf.reduce_max(observations)
      actual_pi = (
          probability_of_improvement.normal_probability_of_improvement(
              best_observed=best_observed, mean=loc, stddev=scale
          )
      )
  
      model = normal.Normal(
          loc[..., tf.newaxis],
          scale[..., tf.newaxis],
          validate_args=True,
      )
      expected_pi = (
          probability_of_improvement.ParallelProbabilityOfImprovement(
              predictive_distribution=model,
              observations=observations,
              num_samples=int(2e5),
              seed=test_util.test_seed(),
          )()
      )
      self.assertAllClose(
          self.evaluate(actual_pi),
          self.evaluate(expected_pi),
          atol=1e-2,
      )
      self.assertDTypeEqual(actual_pi, self.dtype)
  
file_path: probability/tensorflow_probability/python/experimental/bayesopt/acquisition/probability_of_improvement_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.experimental.bayesopt.acquisition import probability_of_improvement
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
label_desc: Use image node_id 3 for calling the _ProbabilityOfImprovementTest obj's underlying member method code with example usage: obj.test_normal_probability_of_improvement_matches_parallel() without return types