def assert_bijective_and_finite(bijector,<EOL>x,<EOL>y,<EOL>event_ndims,<EOL>eval_func,<EOL>inverse_event_ndims=None,<EOL>atol=<NUM_LIT:0>,<EOL>rtol=<NUM_LIT>):
if inverse_event_ndims is None:<EOL><INDENT>inverse_event_ndims = event_ndims<EOL><DEDENT>assert_finite(x)<EOL>assert_finite(y)<EOL>f_x = bijector.forward(x)<EOL>g_y = bijector.inverse(y)<EOL>[<EOL>x_from_x,<EOL>y_from_y,<EOL>ildj_f_x,<EOL>fldj_x,<EOL>ildj_y,<EOL>fldj_g_y,<EOL>f_x_v,<EOL>g_y_v,<EOL>] = eval_func([<EOL>bijector.inverse(f_x),<EOL>bijector.forward(g_y),<EOL>bijector.inverse_log_det_jacobian(f_x, event_ndims=inverse_event_ndims),<EOL>bijector.forward_log_det_jacobian(x, event_ndims=event_ndims),<EOL>bijector.inverse_log_det_jacobian(y, event_ndims=inverse_event_ndims),<EOL>bijector.forward_log_det_jacobian(g_y, event_ndims=event_ndims),<EOL>f_x,<EOL>g_y,<EOL>])<EOL>assert_finite(x_from_x)<EOL>assert_finite(y_from_y)<EOL>assert_finite(ildj_f_x)<EOL>assert_finite(fldj_x)<EOL>assert_finite(ildj_y)<EOL>assert_finite(fldj_g_y)<EOL>assert_finite(f_x_v)<EOL>assert_finite(g_y_v)<EOL>np.testing.assert_allclose(x_from_x, x, atol=atol, rtol=rtol)<EOL>np.testing.assert_allclose(y_from_y, y, atol=atol, rtol=rtol)<EOL>np.testing.assert_allclose(-ildj_f_x, fldj_x, atol=atol, rtol=rtol)<EOL>np.testing.assert_allclose(-ildj_y, fldj_g_y, atol=atol, rtol=rtol)<EOL>
Assert that forward/inverse (along with jacobians) are inverses and finite.

    It is recommended to use x and y values that are very very close to the edge
    of the Bijector's domain.

    Args:
      bijector:  A Bijector instance.
      x:  np.array of values in the domain of bijector.forward.
      y:  np.array of values in the domain of bijector.inverse.
      event_ndims: Integer describing the number of event dimensions this bijector
        operates on.
      eval_func: Function to evaluate any intermediate results.
      inverse_event_ndims: Integer describing the number of event dimensions for
        the bijector codomain. If None, then the value of `event_ndims` is used.
      atol:  Absolute tolerance.
      rtol:  Relative tolerance.

    Raises:
      AssertionError:  If tests fail.