RNN weights definition in Flux

In the Flux source files there is a line.

@functor RNNCell

How does the functor understand that state0 and \sigma (which should be fixed) in RNNCell definition aren’t weights?

It doesn’t. The state field is excluded by Flux.jl/recurrent.jl at b7df765301e6fc00b582112daf58916bb6728c24 · FluxML/Flux.jl · GitHub, which Flux.params calls under the hood.