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 volatility squared as either a `PiecewiseConstantFunc` or a `Tensor`.
  
  Args:
    volatility: Either a 'Tensor' or 'PiecewiseConstantFunc'.
    volatility_is_constant: `bool` which is True if volatility is of type
      `Tensor`.
    dtype: The default dtype to use when converting values to `Tensor`s.
      Default value: `None` which means that default dtypes inferred by
        TensorFlow are used.
    name: Python string. The name to give to the ops created by this class.
      Default value: `None` which maps to the default name
      '_volatility_squared'.
docstr_tok: ["Returns","volatility","squared","as","either","a","`","PiecewiseConstantFunc","`","or","a","`","Tensor","`",".","Args",":","volatility",":","Either","a","'Tensor","'","or","'PiecewiseConstantFunc","'",".","volatility_is_constant",":","`","bool","`","which","is","True","if","volatility","is","of","type","`","Tensor","`",".","dtype",":","The","default","dtype","to","use","when","converting","values","to","`","Tensor","`","s",".","Default","value",":","`","None","`","which","means","that","default","dtypes","inferred","by","TensorFlow","are","used",".","name",":","Python","string",".","The","name","to","give","to","the","ops","created","by","this","class",".","Default","value",":","`","None","`","which","maps","to","the","default","name","'_volatility_squared","'","."]
code: def _volatility_squared_from_volatility(
      self, volatility, volatility_is_constant, dtype=None, name=None
  ):
      """Returns volatility squared as either a `PiecewiseConstantFunc` or a `Tensor`.
  
      Args:
        volatility: Either a 'Tensor' or 'PiecewiseConstantFunc'.
        volatility_is_constant: `bool` which is True if volatility is of type
          `Tensor`.
        dtype: The default dtype to use when converting values to `Tensor`s.
          Default value: `None` which means that default dtypes inferred by
            TensorFlow are used.
        name: Python string. The name to give to the ops created by this class.
          Default value: `None` which maps to the default name
          '_volatility_squared'.
      """
      name = name or (self._name + "_volatility_squared")
      if volatility_is_constant:
          return volatility**2
      else:
          return pw.PiecewiseConstantFunc(
              volatility.jump_locations(),
              volatility.values() ** 2,
              dtype=dtype,
              name=name,
          )
  
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 12 for calling the GeometricBrownianMotion obj's underlying member method code with example usage: obj._volatility_squared_from_volatility(volatility, volatility_is_constant, dtype, name) and returns: unknown, pw