docstr: Tests paths properties for Wiener process (dX = dW).
docstr_tok: ["Tests","paths","properties","for","Wiener","process","(","dX","=","dW",")","."]
code: def test_sample_paths_wiener(self, use_xla):
      """Tests paths properties for Wiener process (dX = dW)."""
  
      def drift_fn(_, x):
          return tf.zeros_like(x)
  
      def vol_fn(_, x):
          return tf.expand_dims(tf.ones_like(x), -1)
  
      process = tff.models.GenericItoProcess(
          dim=1, drift_fn=drift_fn, volatility_fn=vol_fn
      )
      times = np.array([0.1, 0.2, 0.3])
      num_samples = 10000
  
      @tf.function
      def fn():
          return process.sample_paths(
              times=times,
              num_samples=num_samples,
              seed=42,
              time_step=0.01,
          )
  
      if use_xla:
          paths = self.evaluate(tf.xla.experimental.compile(fn))[0]
      else:
          paths = self.evaluate(fn())
  
      means = np.mean(paths, axis=0).reshape([-1])
      covars = np.cov(paths.reshape([num_samples, -1]), rowvar=False)
      expected_means = np.zeros((3,))
      expected_covars = np.minimum(
          times.reshape([-1, 1]), times.reshape([1, -1])
      )
      with self.subTest(name="Means"):
          self.assertAllClose(
              means, expected_means, rtol=1e-2, atol=1e-2
          )
      with self.subTest(name="Covar"):
          self.assertAllClose(
              covars, expected_covars, rtol=1e-2, atol=1e-2
          )
  
imports: import os
  from unittest import mock
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling the GenericItoProcessTest obj's underlying member method code with example usage: obj.test_sample_paths_wiener(use_xla) and returns: tf, tf, process