code: def test_normal_ucb_matches_parallel(self):
      shape = [5, 20, 1]
      loc = 2.0 * np.random.uniform(size=shape).astype(self.dtype)
      scale = 3.0 + np.random.uniform(size=[20]).astype(self.dtype)
      exploration = 0.0
      observations = [2.0, 3.0, 4.0]
      actual_ucb = upper_confidence_bound.normal_upper_confidence_bound(
          mean=loc[..., 0], stddev=scale, exploration=exploration
      )
  
      model = normal.Normal(loc, scale, validate_args=True)
      expected_ucb = (
          upper_confidence_bound.ParallelUpperConfidenceBound(
              predictive_distribution=model,
              observations=observations,
              exploration=exploration,
              num_samples=int(2e4),
              seed=test_util.test_seed(),
          )()
      )
      self.assertAllClose(
          self.evaluate(actual_ucb),
          self.evaluate(expected_ucb),
          rtol=1e-3,
      )
      self.assertDTypeEqual(actual_ucb, self.dtype)
  
file_path: probability/tensorflow_probability/python/experimental/bayesopt/acquisition/upper_confidence_bound_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 upper_confidence_bound
  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 _UpperConfidenceBoundTest obj's underlying member method code with example usage: obj.test_normal_ucb_matches_parallel() without return types