class_docstr: Test GeneralSpace works on a Sphere.
class_docstr_tok: ["Test","GeneralSpace","works","on","a","Sphere","."]
code: def tangent_basis(self, x):
      # Hairy Ball Theorem kicks in so that this parameterization is not going to
      # be valid for the whole sphere. However, we are only computing this on the
      # half-sphere so we should have a well defined tangent space.
      return spaces.DenseBasis(
          tf.stack(
              [
                  tf.stack(
                      [-x[..., 1], x[..., 0], tf.zeros_like(x[..., 0])],
                      axis=-1,
                  ),
                  tf.stack(
                      [tf.zeros_like(x[..., 1]), -x[..., 2], x[..., 1]],
                      axis=-1,
                  ),
              ],
              axis=0,
          )
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import reshape
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import scale_matvec_tril
  from tensorflow_probability.python.bijectors import transform_diagonal
  from tensorflow_probability.python.experimental.tangent_spaces import spaces
  from tensorflow_probability.python.experimental.tangent_spaces import spaces_test_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling the HalfSphereSpaceTest obj's underlying member method code with example usage: obj.tangent_basis(x) and returns: spaces