cossio
cossio
Also, pulling from your comment on Slack, I think it would be nice to have a function like: ``` function with_backend(f, backend) # set backend temporarily to `backend` f() #...
Did you try defining an adjoint for the `Fill` constructor?
Related: https://github.com/FluxML/Zygote.jl/pull/338, https://github.com/FluxML/Zygote.jl/issues/336
Does https://github.com/FluxML/Zygote.jl/pull/1001 close this?
Any updates on this?
A workaround is to specify the size of `I`: ```julia gradient((A,B) -> sum([I(2) A; B I(3)]), randn(2,3), randn(3,2)) ``` That works.
> Is there any reason this should be an adjoint for just Zygote and not an `rrule` in Chainrules itself? No. Do you think the issue should be raised at...
The idea is to eventually deprecate `@adjoint`? Or to make `@adjoint` fallback to `rrule`?
Bump. I would also like to have this.
A possible implementation (nevermind the types): ```julia function wcor(x::AbstractVector, y::AbstractVector, w::AbstractVector) @assert length(x) == length(y) == length(w) w_ = w ./ sum(w) x_ = x .- sum(w_ .* x) y_...