class_docstr: Geometric Brownian Motion.
  
  Represents the 1-dimensional Ito process:
  
  ```None
    dX(t) = means(t) * X(t) * dt + volatilities(t) * X(t) * dW(t),
  ```
  
  where `W(t)` is a 1D Brownian motion, `mean(t)` and `volatility(t)` are either
  constant `Tensor`s or piecewise constant functions of time.
  
  Supports batching which enables modelling multiple univariate geometric
  brownian motions (GBMs) efficiently. No guarantee is made about the
  relationships between the batched univariate GMBs. To control the correlation
  between multiple GBMs use `MultivariateGeometricBrownianMotion`.
  
  ## Example
  
  ```python
  import tensorflow as tf
  import tf_quant_finance as tff
  process = tff.models.GeometricBrownianMotion(0.05, 1.0, dtype=tf.float64)
  times = [0.1, 0.2, 1.0]
  # Use SOBOL sequence to draw trajectories
  samples_sobol = process.sample_paths(
      times=times,
      initial_state=1.5,
      random_type=tff.math.random.RandomType.SOBOL,
      num_samples=100000)
  
  # You can also supply the random normal draws directly to the sampler
  normal_draws = tf.random.stateless_normal(
      [100000, 3, 1], seed=[4, 2], dtype=tf.float64)
  samples_custom = process.sample_paths(
      times=times,
      initial_state=1.5,
      normal_draws=normal_draws)
  ```
docstr: Returns a sample of paths from the process.
  
  If `mean` and `volatility` were specified with batch dimensions the sample
  paths will be generated for all batch dimensions for the specified `times`
  using a single set of random draws.
  
  Args:
    times: A `Tensor` of positive real values of a shape `[T, k]`, where
      `T` is either empty or a shape which is broadcastable to `batch_shape`
      (as defined by the shape of `mean` or `volatility` which were set when
      this instance of GeometricBrownianMotion was initialised) and `k` is the
      number of time points. The times at which the path points are to be
      evaluated.
    initial_state: A `Tensor` of the same `dtype` as `times` and of shape
      broadcastable to `[batch_shape, num_samples]`. Represents the initial
      state of the Ito process.
      Default value: `None` which maps to a initial state of ones.
    num_samples: Positive scalar `int`. The number of paths to draw.
    random_type: Enum value of `RandomType`. The type of (quasi)-random
      number generator to use to generate the paths.
      Default value: None which maps to the standard pseudo-random numbers.
    seed: Seed for the random number generator. The seed is
      only relevant if `random_type` is one of
      `[STATELESS, PSEUDO, HALTON_RANDOMIZED, PSEUDO_ANTITHETIC,
        STATELESS_ANTITHETIC]`. For `PSEUDO`, `PSEUDO_ANTITHETIC` and
      `HALTON_RANDOMIZED` the seed should be an Python integer. For
      `STATELESS` and  `STATELESS_ANTITHETIC `must be supplied as an integer
      `Tensor` of shape `[2]`.
      Default value: `None` which means no seed is set.
    skip: `int32` 0-d `Tensor`. The number of initial points of the Sobol or
      Halton sequence to skip. Used only when `random_type` is 'SOBOL',
      'HALTON', or 'HALTON_RANDOMIZED', otherwise ignored.
      Default value: 0.
    normal_draws: A `Tensor` of shape `[num_samples, num_time_points, 1]`
      and the same `dtype` as `times`. Represents random normal draws to
      compute increments `N(0, t_{n+1}) - N(0, t_n)`. When supplied,
      `num_samples` argument is ignored and the first dimensions of
      `normal_draws` is used instead. `num_time_points` should be equal to
      `tf.shape(times)[0]`.
      Default value: `None` which means that the draws are generated by the
      algorithm.
    name: Str. The name to give this op.
      Default value: `sample_paths`.
  
  Returns:
    A `Tensor`s of shape [batch_shape, num_samples, k, 1] where `k` is the
    the number of `time points`.
  
  Raises:
    ValueError: If `normal_draws` is supplied and does not have shape
    broadcastable to `[num_samples, num_time_points, 1]`.
docstr_tok: ["Returns","a","sample","of","paths","from","the","process",".","If","`","mean","`","and","`","volatility","`","were","specified","with","batch","dimensions","the","sample","paths","will","be","generated","for","all","batch","dimensions","for","the","specified","`","times","`","using","a","single","set","of","random","draws",".","Args",":","times",":","A","`","Tensor","`","of","positive","real","values","of","a","shape","`","[","T",",","k","]","`",",","where","`","T","`","is","either","empty","or","a","shape","which","is","broadcastable","to","`","batch_shape","`","(","as","defined","by","the","shape","of","`","mean","`","or","`","volatility","`","which","were","set","when","this","instance","of","GeometricBrownianMotion","was","initialised",")","and","`","k","`","is","the","number","of","time","points",".","The","times","at","which","the","path","points","are","to","be","evaluated",".","initial_state",":","A","`","Tensor","`","of","the","same","`","dtype","`","as","`","times","`","and","of","shape","broadcastable","to","`","[","batch_shape",",","num_samples","]","`",".","Represents","the","initial","state","of","the","Ito","process",".","Default","value",":","`","None","`","which","maps","to","a","initial","state","of","ones",".","num_samples",":","Positive","scalar","`","int","`",".","The","number","of","paths","to","draw",".","random_type",":","Enum","value","of","`","RandomType","`",".","The","type","of","(","quasi",")","-random","number","generator","to","use","to","generate","the","paths",".","Default","value",":","None","which","maps","to","the","standard","pseudo-random","numbers",".","seed",":","Seed","for","the","random","number","generator",".","The","seed","is","only","relevant","if","`","random_type","`","is","one","of","`","[","STATELESS",",","PSEUDO",",","HALTON_RANDOMIZED",",","PSEUDO_ANTITHETIC",",","STATELESS_ANTITHETIC","]","`",".","For","`","PSEUDO","`",",","`","PSEUDO_ANTITHETIC","`","and","`","HALTON_RANDOMIZED","`","the","seed","should","be","an","Python","integer",".","For","`","STATELESS","`","and","`","STATELESS_ANTITHETIC","`","must","be","supplied","as","an","integer","`","Tensor","`","of","shape","`","[","2","]","`",".","Default","value",":","`","None","`","which","means","no","seed","is","set",".","skip",":","`","int32","`","0-d","`","Tensor","`",".","The","number","of","initial","points","of","the","Sobol","or","Halton","sequence","to","skip",".","Used","only","when","`","random_type","`","is","'SOBOL","'",",","'HALTON","'",",","or","'HALTON_RANDOMIZED","'",",","otherwise","ignored",".","Default","value",":","0.","normal_draws",":","A","`","Tensor","`","of","shape","`","[","num_samples",",","num_time_points",",","1","]","`","and","the","same","`","dtype","`","as","`","times","`",".","Represents","random","normal","draws","to","compute","increments","`","N","(","0",",","t_","{","n+1","}",")","-","N","(","0",",","t_n",")","`",".","When","supplied",",","`","num_samples","`","argument","is","ignored","and","the","first","dimensions","of","`","normal_draws","`","is","used","instead",".","`","num_time_points","`","should","be","equal","to","`","tf.shape","(","times",")","[","0","]","`",".","Default","value",":","`","None","`","which","means","that","the","draws","are","generated","by","the","algorithm",".","name",":","Str",".","The","name","to","give","this","op",".","Default","value",":","`","sample_paths","`",".","Returns",":","A","`","Tensor","`","s","of","shape","[","batch_shape",",","num_samples",",","k",",","1","]","where","`","k","`","is","the","the","number","of","`","time","points","`",".","Raises",":","ValueError",":","If","`","normal_draws","`","is","supplied","and","does","not","have","shape","broadcastable","to","`","[","num_samples",",","num_time_points",",","1","]","`","."]
code: def sample_paths(
      self,
      times,
      initial_state=None,
      num_samples=1,
      random_type=None,
      seed=None,
      skip=0,
      normal_draws=None,
      name=None,
  ):
      """Returns a sample of paths from the process.
  
      If `mean` and `volatility` were specified with batch dimensions the sample
      paths will be generated for all batch dimensions for the specified `times`
      using a single set of random draws.
  
      Args:
        times: A `Tensor` of positive real values of a shape `[T, k]`, where
          `T` is either empty or a shape which is broadcastable to `batch_shape`
          (as defined by the shape of `mean` or `volatility` which were set when
          this instance of GeometricBrownianMotion was initialised) and `k` is the
          number of time points. The times at which the path points are to be
          evaluated.
        initial_state: A `Tensor` of the same `dtype` as `times` and of shape
          broadcastable to `[batch_shape, num_samples]`. Represents the initial
          state of the Ito process.
          Default value: `None` which maps to a initial state of ones.
        num_samples: Positive scalar `int`. The number of paths to draw.
        random_type: Enum value of `RandomType`. The type of (quasi)-random
          number generator to use to generate the paths.
          Default value: None which maps to the standard pseudo-random numbers.
        seed: Seed for the random number generator. The seed is
          only relevant if `random_type` is one of
          `[STATELESS, PSEUDO, HALTON_RANDOMIZED, PSEUDO_ANTITHETIC,
            STATELESS_ANTITHETIC]`. For `PSEUDO`, `PSEUDO_ANTITHETIC` and
          `HALTON_RANDOMIZED` the seed should be an Python integer. For
          `STATELESS` and  `STATELESS_ANTITHETIC `must be supplied as an integer
          `Tensor` of shape `[2]`.
          Default value: `None` which means no seed is set.
        skip: `int32` 0-d `Tensor`. The number of initial points of the Sobol or
          Halton sequence to skip. Used only when `random_type` is 'SOBOL',
          'HALTON', or 'HALTON_RANDOMIZED', otherwise ignored.
          Default value: 0.
        normal_draws: A `Tensor` of shape `[num_samples, num_time_points, 1]`
          and the same `dtype` as `times`. Represents random normal draws to
          compute increments `N(0, t_{n+1}) - N(0, t_n)`. When supplied,
          `num_samples` argument is ignored and the first dimensions of
          `normal_draws` is used instead. `num_time_points` should be equal to
          `tf.shape(times)[0]`.
          Default value: `None` which means that the draws are generated by the
          algorithm.
        name: Str. The name to give this op.
          Default value: `sample_paths`.
  
      Returns:
        A `Tensor`s of shape [batch_shape, num_samples, k, 1] where `k` is the
        the number of `time points`.
  
      Raises:
        ValueError: If `normal_draws` is supplied and does not have shape
        broadcastable to `[num_samples, num_time_points, 1]`.
      """
      name = name or (self._name + "_sample_path")
  
      with tf.name_scope(name):
          times = tf.convert_to_tensor(times, self._dtype)
          if normal_draws is not None:
              normal_draws = tf.convert_to_tensor(
                  normal_draws, dtype=self._dtype, name="normal_draws"
              )
          initial_state = utils.convert_to_tensor_with_default(
              initial_state,
              tf.ones([1], dtype=self._dtype),
              dtype=self._dtype,
              name="initial_state",
          )
  
          num_requested_times = tff_utils.get_shape(times)[-1]
          return self._sample_paths(
              times=times,
              num_requested_times=num_requested_times,
              initial_state=initial_state,
              num_samples=num_samples,
              random_type=random_type,
              seed=seed,
              skip=skip,
              normal_draws=normal_draws,
          )
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
  from tf_quant_finance.math import piecewise
  from tf_quant_finance.math.pde import fd_solvers
  from tf_quant_finance.models import ito_process
  from tf_quant_finance.models import utils
label_desc: Use image node_id 9 for calling the GeometricBrownianMotion obj's underlying member method code with example usage: obj.sample_paths(times, initial_state, num_samples, random_type, seed, skip, normal_draws, name) and returns: self