OneHotArrays.jl
OneHotArrays.jl copied to clipboard
Reduce hcat creates dense matrix
See here: https://github.com/FluxML/Flux.jl/issues/1596
Existing methods are here, a specialisation for reduce(hcat, ... could be added:
https://github.com/FluxML/OneHotArrays.jl/blob/9c43cb75a334f63dafb75143bb8e8adb6289d3f0/src/array.jl#L112-L130
I suspect these methods could use some stress-testing & tidying, e.g. cat(ohm, ohm; dims=Val(2)) looks like it will be an error (instead of falling back).
And [edit] that reduce(vcat, ...; init) is a fallback method, not the fast reduce(vcat, xs::Vector) method. It should just be vcat(x, xs...) here.