class_docstr: Tests correctness of the Y = g(X) = X / norm(X) transformation.
class_docstr_tok: ["Tests","correctness","of","the","Y","=","g","(","X",")","=","X","\/","norm","(","X",")","transformation","."]
code: def testBijectiveAndFinite(self):
      uv = unit_vector.UnitVector()
      x = np.linspace(-50, 50, num=10).reshape(5, 2).astype(np.float32)
      # Make y values on the simplex with a wide range.
      y_0 = np.ones(5).astype(np.float32)
      y_1 = (1e-5 * rng.rand(5)).astype(np.float32)
      y_2 = (1e1 * rng.rand(5)).astype(np.float32)
      y = np.array([y_0, y_1, y_2])
      y /= y.sum(axis=0)
      y = y.T  # y.shape = [5, 3]
      bijector_test_util.assert_bijective_and_finite(
          uv, x, y, eval_func=self.evaluate, event_ndims=1
      )
  
file_path: probability/tensorflow_probability/python/bijectors/unit_vector_test.py
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import unit_vector
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 6 for calling the UnitVectorBijectorTest obj's underlying member method code with example usage: obj.testBijectiveAndFinite() without return types