Skip to content

Use "real" python code inside of jit #18130

Answered by jakevdp
inversecrime asked this question in Q&A
Discussion options

You must be logged in to vote

It sounds like you're looking for jax.ensure_compile_time_eval:

class Foo:
    @cached_property
    def some_property(self) -> Array:
        with jax.ensure_compile_time_eval():
            return jnp.ones((10, 10))

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
9 replies
@jakevdp
Comment options

@inversecrime
Comment options

@jakevdp
Comment options

@inversecrime
Comment options

@jakevdp
Comment options

Answer selected by inversecrime
Comment options

You must be logged in to vote
1 reply
@inversecrime
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants