class_docstr: Bijector mapping vectors onto the unit sphere.
  
  This bijector maps points in n-dimensional space to the
  unit sphere in (n + 1)-dimensional space via the inverse
  stereographic projection from the point (0, ..., 0, 1).
  
  The forward map is:
  
  f(x_0, ..., x_{n-1})
      = (2x_0/(s^2 + 1), ..., 2x_{n-1}/(s^2 + 1), (s^2 - 1)/(s^2 + 1))
  
  where s^2 = x_0^2 + ... + x_{n-1}^2.
  
  And the inverse map is
  
  f^{-1}(y_0, ..., y_n) = (y_0/(1 - y_n), ..., y_{n-1}/(1 - y_n)).
  
  Example Use:
  
  ```python
  UnitVector().forward([2., 1, 2])
  # Result: [0.4, 0.2, 0.4, 0.8]
  
  UnitVector().inverse([0.4, 0.2, 0.4, 0.8])
  # Result: [2., 1., 2.]
  ```
class_docstr_tok: ["Bijector","mapping","vectors","onto","the","unit","sphere",".","This","bijector","maps","points","in","n-dimensional","space","to","the","unit","sphere","in","(","n","+","1",")","-dimensional","space","via","the","inverse","stereographic","projection","from","the","point","(","0",",","...",",","0",",","1",")",".","The","forward","map","is",":","f","(","x_0",",","...",",","x_","{","n-1","}",")","=","(","2x_0\/","(","s^2","+","1",")",",","...",",","2x_","{","n-1","}","\/","(","s^2","+","1",")",",","(","s^2","-","1",")","\/","(","s^2","+","1",")",")","where","s^2","=","x_0^2","+","...","+","x_","{","n-1","}","^2",".","And","the","inverse","map","is","f^","{","-1","}","(","y_0",",","...",",","y_n",")","=","(","y_0\/","(","1","-","y_n",")",",","...",",","y_","{","n-1","}","\/","(","1","-","y_n",")",")",".","Example","Use",":","``","`","python","UnitVector","(",")",".forward","(","[","2.",",","1",",","2","]",")","#","Result",":","[","0.4",",","0.2",",","0.4",",","0.8","]","UnitVector","(",")",".inverse","(","[","0.4",",","0.2",",","0.4",",","0.8","]",")","#","Result",":","[","2.",",","1.",",","2",".","]","``","`"]
code: def _inverse_event_shape(self, output_shape):
      return self._pad.inverse_event_shape(output_shape)
  
file_path: probability/tensorflow_probability/python/bijectors/unit_vector.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import pad
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 5 for calling the UnitVector obj's underlying member method code with example usage: obj._inverse_event_shape(output_shape) and returns: self