Michael Abbott

Results 1316 comments of Michael Abbott

> How to add adjoint for LinearAlgebra.diagm where Base.Pair is used? Those seem be easier, e.g. ```julia Zygote.@adjoint diagm(x::AbstractVector) = diagm(x), dy -> (diag(dy),) Zygote.@adjoint diagm(pr::Pair) = diagm(pr), dy ->...

Here's one way to avoid indexing: ```julia julia> masked_minimum(A * x, mask) 13.674786f0 julia> masked_minimum_2(val, mask) = mapreduce(min, val, mask) do x, y ifelse(isone(y), x, typemax(typeof(x))) end; julia> masked_minimum_2(A *...

It isn't calling the rrule you defined. And I think the reason is this line https://github.com/FluxML/Zygote.jl/blob/de078c84ce0a1ee517e9e929f0bb6b97b697e23e/src/lib/array.jl#L6 since Zygote's own `@adjoint` rules take precedence: ``` julia> function ChainRulesCore.rrule(::Type{Array}, x::CUDA.CuArray) println("Array rrule")...

Sometimes there are hints in the stack trace, but often printing is the best way to know what's going on. (The fancier `@info` and friends don't play well with Zygote,...

You say regression, but not on which version this is known to work. It appears to be one of the cases where re-using a variable name (for something with a...

That's more concerning. I got as far as trying 0.6.0... note that internally it's still working harder when the names are confusing, but does not accumulate a wrong answer: ```...

@aksk this looks unrelated to me. This line ``` [3] accum(x::NamedTuple{(:data, :itr), Tuple{Tuple{}, Nothing}}, y::NamedTuple{(:data, :itr), Tuple{NamedTuple{(), Tuple{}}, Nothing}}) ``` says that something is producing both `(), nothing` and `(;),...

These specialisations probably cannot be removed, so at least they should be clearly documented, including the precise signature which triggers them. If I'm not mistaken you have to look at...

Besides performance there are quirks like this which would probably break things: ``` julia> mapreduce(identity, hcat, [[1,2]]) # never calls hcat 2-element Vector{Int64}: 1 2 julia> reduce(hcat, [[1,2]]) 2×1 Matrix{Int64}:...

Bump... pinging @ViralBShah as he liked it in August?