You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a function to Jit or Grad, etc... we need to also pass the variables the function uses. While we can maintain this design pattern, we could also propose an alternative: a decorator that turns a function into a module.
Example:
# Current designdefsome_function(x):
returnobjax.functional.softmax(model(x, training=False))
jit_func=objax.Jit(some_function, model.vars())
When passing a function to Jit or Grad, etc... we need to also pass the variables the function uses. While we can maintain this design pattern, we could also propose an alternative: a decorator that turns a function into a module.
Example:
Alternate design proposal (not a replacement)
I like a certain elegance about this proposal but I would like more opinions on whether it is a desirable addition.
The text was updated successfully, but these errors were encountered: