Skip to content

How to handle multiple inputs in flax, is there any example as referece? #1761

Answered by marcvanzee
long1216 asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jheek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1760 on January 05, 2022 19:35.