Michael Abbott
Michael Abbott
This issue comes up in Base too, where `cat([1], [2]; dims=3)` isn't type-stable, but it also accepts `dims=Val(3)` if required.
The file `~/.julia/packages/ChainRules/RZYEu/src/rulesets/Base/arraymath.jl:36 [inlined]` is this: https://github.com/JuliaDiff/ChainRules.jl/blob/13ccc862899d8a3d98b09bd68edd9be8ca28197e/src/rulesets/Base/arraymath.jl#L36 Here's a smaller demonstration of the problem: ```julia julia> using CUDA, OneHotArrays, NNlibCUDA julia> CUDA.allowscalar(false) julia> x = cu(onehotbatch([3, 4],1:5)) 5×2 OneHotMatrix(::CuArray{UInt32, 1,...
This method: https://github.com/FluxML/OneHotArrays.jl/blob/ddbba636ee8c27130358354355e72b6f1fc61530/src/linalg.jl#L13-L17 ought to allow for ` B::Adjoint{Bool,
That would be great. There's no formal process of assigning things, although we try a little to avoid PR races.
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...
No strong opinions, was just trying to make Flux's tests pass. https://github.com/FluxML/OneHotArrays.jl/pull/17 is more code duplication than ideal.
It's been a while, but chime in on #51.
For `similar`, a possible precedent is: ```julia julia> similar(Diagonal([10, 20.])) # same type 2×2 Diagonal{Float64, Vector{Float64}}: NaN ⋅ ⋅ 2.15906e-314 julia> similar(Diagonal([10, 20.]), Float32, (2, 2)) # similar(parent(A), ...) 2×2...
It appears that the LinearAlgebra tests now pass, so perhaps this is safe to merge? The code from https://github.com/JuliaLang/julia/pull/39301 seems to have been changed or removed, I'm not exactly sure...
Xref #53900 for `Base.Iterators`. For `Base.Broadcast` I believe they would go in https://github.com/JuliaLang/julia/blob/master/base/broadcast.jl