docstr: Tests abs realized volatility for logspace sample paths.
docstr_tok: ["Tests","abs","realized","volatility","for","logspace","sample","paths","."]
code: def test_abs_volatility_logspace_samples(self):
      """Tests abs realized volatility for logspace sample paths."""
      dtype = tf.float64
      num_series = 200
      num_times = 100
      seed = (1, 2)
      draws = tf.random.stateless_normal(
          (num_series, num_times), seed=seed, dtype=dtype
      )
      logspace_paths = tf.math.cumsum(draws, axis=-1)
      sample_paths = tf.math.exp(logspace_paths)
      volatilities = tff.models.realized_volatility(
          logspace_paths,
          path_scale=tff.models.PathScale.LOG,
          returns_type=tff.models.ReturnsType.ABS,
      )
      diffs = tf.math.abs(tff.math.diff(sample_paths, exclusive=True))
      expected_volatilities = tf.reduce_sum(
          diffs / sample_paths[:, :-1], axis=1
      )
      self.assertAllClose(volatilities, expected_volatilities, 1e-6)
  
file_path: tf-quant-finance/tf_quant_finance/models/realized_volatility_test.py
imports: 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 7 for calling the RealizedVolatilityTest obj's underlying member method code with example usage: obj.test_abs_volatility_logspace_samples() without return types