.Flux
flatten
function
defined in module
Flux
flatten(x::AbstractArray)
Reshape arbitrarly-shaped input into a matrix-shaped output, preserving the size of the last dimension.
See also
unsqueeze
.
julia> rand(3,4,5) |> Flux.flatten |> size
(12, 5)
julia> xs = rand(Float32, 10,10,3,7);
julia> m = Chain(Conv((3,3), 3 => 4, pad=1), Flux.flatten, Dense(400 => 33));
julia> xs |> m[1] |> size
(10, 10, 4, 7)
julia> xs |> m |> size
(33, 7)
There is
1
method for Flux.flatten
:
The following pages link back here: