How to splice two separate Chain into one

Hi.
I now have two chains. I want to splice them.
I know function Parallel(+) can do that. But I don’t expect to get the sum. Instead, I expect to get them end to end.
For example, Chain1 has 2 outputs:1,2. Chain2 has 2 outputs:3,4. I expect to get Chain3(1,2,3,4)

How can I achieve that?
Thanks

I assume you’re talking about Flux.jl?

And sounds like you are looking for concatenation?

If so, something like this presumably:

Parallel((x...) -> cat(x...; dims = <channel_dim>), ...)

1 Like

Thank you for replying me!
Yes! I’m using Flux and concatenation is exactly what I meant.
I tried your method and succeeded!
Thank you!

1 Like