Skip to content
Discussion options

You must be logged in to vote

Hi - the reason that a_jax.calc() does not error is because the calc method of a_jax is not JIT-compiled. Class method decorators are evaluated at the time the class is defined, not at the time the class is instantiated, and when the class is defined, the global variable BACKEND is set to NumPyBackend(). The fact that this global variable is modified later has no effect on the @BACKEND.jit() decorator used previously in the class definition.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@king-p3nguin
Comment options

Answer selected by king-p3nguin
Comment options

You must be logged in to vote
0 replies
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