-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chain(Parallel(...), ...) #2100
Comments
The reason to remove the recursive definition was to help compile times with "larger" chains and support named layers, but yes a generated function could be avoidable. Best is to try and remove the unary method on chain and allow vararg inputs. |
I started a PR. The new behaviour is somewhat incompatible with the support for julia> ∘()
ERROR: MethodError: no method matching ∘() I don't mind either way, just let me know. |
Closes FluxML#2100 As mentionned in FluxML#2100 (comment), this will break any code using `Chain()` as the identity function.
Because |
Following the discussion in #2101, closing. |
Describe the potential feature
When combining multiple inputs (or an embedding + inputs), one can combine them at the end, with
Parallel(+, Chain(...), Chain(...))
, but one can't combine them earlier:Chain(Parallel(...), Dense(...))
. That code runs, but when called, there is no(::Chain)(args...)
method. Only the unary one.In other words, if Chain is function composition, it should support
Motivation
Helps with multi-modal inputs / embeddings.
Possible Implementation
? #1809 has some background on why the generated function was needed for
_applychain
. If the above one-liner isn't zygote-friendly (... I really don't know), then I could modify the generated function.The text was updated successfully, but these errors were encountered: