Beispiel #1
0
 def f(pred):
     assert python_should_be_running
     checkify.assert_(pred, "foo")
Beispiel #2
0
 def f():
     checkify.assert_(False, "hi")
Beispiel #3
0
 def f(x):
     checkify.assert_(x > 0, "must be positive!")
     return jnp.log(x)
Beispiel #4
0
 def multi_errors(x):
     x = x / 0  # DIV
     x = jnp.sin(x)  # NAN
     x = x[500]  # OOB
     checkify.assert_(x < 0, "must be negative!")  # ASSERT
     return x