docstr: Tests that univariate GBM sampling is XLA-compatible.
docstr_tok: ["Tests","that","univariate","GBM","sampling","is","XLA-compatible","."]
code: def test_univariate_xla_compatible(self):
      """Tests that univariate GBM sampling is XLA-compatible."""
      process = tff.models.GeometricBrownianMotion(
          0.05, 0.5, dtype=tf.float64
      )
  
      @tf.function
      def sample_fn():
          return process.sample_paths(
              times=[0.1, 0.5, 1.0],
              initial_state=2.0,
              num_samples=10000,
          )
  
      samples = tf.function(sample_fn, jit_compile=True)()
      log_s = tf.math.log(samples)
      mean = tf.reduce_mean(log_s, axis=0)
      expected_mean = (
          process._mean - process._volatility**2 / 2
      ) * np.array([0.1, 0.5, 1.0]) + np.log(2.0)
      self.assertAllClose(
          tf.squeeze(mean), expected_mean, atol=1e-2, rtol=1e-2
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.models.geometric_brownian_motion import geometric_brownian_motion_test_utils
  from tf_quant_finance.models.geometric_brownian_motion import univariate_geometric_brownian_motion
label_desc: Use image node_id 19 for calling the GeometricBrownianMotionTest obj's underlying member method code with example usage: obj.test_univariate_xla_compatible() and returns: process