def f(pred): assert python_should_be_running checkify.check(pred, "foo")
def f(): # Note that x is not an argument to the checkified function. checkify.check(x > 0, "must be positive!") return jnp.log(x)
def body(carry, x): checkify.check(jnp.all(x > 0), "should be positive") return carry, x
def f(): checkify.check(False, "hi")
def f(x): checkify.check(x > 0, "must be positive!") return jnp.log(x)
def multi_errors(x): checkify.check(jnp.all(x < 0), "must be negative!") # ASSERT x = x / 0 # DIV x = jnp.sin(x) # NAN x = x[500] # OOB return x
def multi_errors(x): x = x / 0 # DIV x = jnp.sin(x) # NAN x = x[500] # OOB checkify.check(x < 0, "must be negative!") # ASSERT return x
def f(x): checkify.check(jnp.sum(x) == 1., "x must sum to one.") return x
def while_body(val): i, x = val checkify.check(x < 0, "x must be negative") return i + 1., x + 1
def while_cond(val): i, _ = val checkify.check(i < 0, "i must be negative") return i < 2