class_docstr: Bijector that computes `Y = tanh(X)`, therefore `Y in (-1, 1)`.
  
  This can be achieved by an affine transform of the Sigmoid bijector, i.e.,
  it is equivalent to
  ```
  tfb.Chain([tfb.Shift(shift=-1.),
             tfb.Scale(scale=2.),
             tfb.Sigmoid(),
             tfb.Scale(scale=2.)])
  ```
  
  However, using the `Tanh` bijector directly is slightly faster and more
  numerically stable.
code: def _forward_log_det_jacobian(self, x):
      #  This formula is mathematically equivalent to
      #  `tf.log1p(-tf.square(tf.tanh(x)))`, however this code is more numerically
      #  stable.
      #  Derivation:
      #    log(1 - tanh(x)^2)
      #    = log(sech(x)^2)
      #    = 2 * log(sech(x))
      #    = 2 * log(2e^-x / (e^-2x + 1))
      #    = 2 * (log(2) - x - log(e^-2x + 1))
      #    = 2 * (log(2) - x - softplus(-2x))
      return 2.0 * (np.log(2.0) - x - tf.math.softplus(-2.0 * x))
  
file_path: probability/tensorflow_probability/python/bijectors/tanh.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
label_desc: Use image node_id 6 for calling the Tanh obj's underlying member method code with example usage: obj._forward_log_det_jacobian(x) and returns: unknown