Support to trace ``Variable``s inside of a brainpy transformation
chaoming0625 opened this issue · 1 comments
chaoming0625 commented
Please:
- Check for duplicate requests.
- Describe your goal, and if possible provide a code snippet with a motivating example.
The current brainpy transformations can only trace Variable
outside these transformation functions. For example,
class A():
def __init__(self):
self.a = bm.Variable(1) # can be traced
@bm.cls_jit
def f(self):
self.b = bm.Variable(1) # cannot be traced
self.a += self.b
This is in contrast to the OO transformations in Flax, which supports to trace Variable
s inside of a transformation function.
It may be essential to support Variable
tracing during a computation.
chaoming0625 commented
Has been solved in #472.