How to handle multiple inputs in flax, is there any example as referece? #1761
-
|
Beta Was this translation helpful? Give feedback.
Answered by
marcvanzee
Jan 5, 2022
Replies: 1 comment
-
The seq2seq model has two inputs: https://github.com/google/flax/blob/main/examples/seq2seq/train.py#L262 You simple have two arguments to the Then when you want to run the forward pass you simply provide both arguments to the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jheek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The seq2seq model has two inputs: https://github.com/google/flax/blob/main/examples/seq2seq/train.py#L262
You simple have two arguments to the
__call__
function of your Module.Then when you want to run the forward pass you simply provide both arguments to the
apply
function of the Module.