class_docstr: Tangent space of M for Simplex distributions in R^n.
class_docstr_tok: ["Tangent","space","of","M","for","Simplex","distributions","in","R^n","."]
code: def _transform_general(self, x, f, **kwargs):
      basis = self.compute_basis(x)
      # Note that B @ B.T results in the matrix I + 11^T, where 1 is the vector of
      # all ones. By the matrix determinant lemma we have det(I + 11^T) = n + 1,
      # or the dimension of the ambient space.
      dim = ps.shape(x)[-1]
      result = dtype_util.as_numpy_dtype(x.dtype)(0.5 * np.log(dim))
      new_basis_tensor = spaces.compute_new_basis_tensor(f, x, basis)
      new_log_volume = spaces.volume_coefficient(
          distribution_util.move_dimension(new_basis_tensor, 0, -2)
      )
      result = new_log_volume - result
      return result, spaces.GeneralSpace(
          spaces.DenseBasis(new_basis_tensor),
          computed_log_volume=new_log_volume,
      )
  
file_path: probability/tensorflow_probability/python/experimental/tangent_spaces/simplex.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.linalg import linear_operator_row_block
  from tensorflow_probability.python.experimental.tangent_spaces import spaces
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 2 for calling the ProbabilitySimplexSpace obj's underlying member method code with example usage: obj._transform_general(x, f) and returns: result,  spaces