Dispatch on the last layer type in Flux

Probably easiest to define predict(m, x) = predict(typeof(m.layers[end]), m, x)
and write dispatches for e.g. predict(::Type{<:Dense}, m, x) = [...]

1 Like