class_docstr: Tangent space of M the space of `n x n` symmetric matrices.
class_docstr_tok: ["Tangent","space","of","M","the","space","of","`","n","x","n","`","symmetric","matrices","."]
code: def _transform_coordinatewise(self, x, f, **kwargs):
      diag_jacobian = spaces.coordinatewise_jvp(f, x)
      basis_tensor = self.compute_basis(x).to_dense()
      batch_shape = ps.shape(diag_jacobian)[:-2]
      basis_shape = ps.shape(basis_tensor)
      basis_tensor = tf.reshape(
          basis_tensor,
          ps.concat(
              [
                  [basis_shape[0]],
                  ps.ones_like(batch_shape),
                  basis_shape[-2:],
              ],
              axis=0,
          ),
      )
      new_basis = spaces.DenseBasis(basis_tensor * diag_jacobian)
  
      correction = tf.math.square(diag_jacobian)
      correction = (
          correction + tf.linalg.matrix_transpose(correction)
      ) / 2.0
      correction = tf.linalg.band_part(tf.math.log(correction), -1, 0)
      log_volume = 0.5 * tf.math.reduce_sum(correction, axis=[-1, -2])
      return log_volume, spaces.GeneralSpace(
          new_basis, computed_log_volume=log_volume
      )
  
file_path: probability/tensorflow_probability/python/experimental/tangent_spaces/symmetric_matrix.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.tangent_spaces import spaces
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import linalg
label_desc: Use image node_id 3 for calling the SymmetricMatrixSpace obj's underlying member method code with example usage: obj._transform_coordinatewise(x, f) and returns: log_volume,  spaces