Michael Abbott

Results 222 issues of Michael Abbott

This PR wants to use `add!!` to add thunks, which should be safe if the result of `unthunk`ing is always an array we are free to mutate. And it adds...

inplace accumulation

This is one way not to make a Tangent with only zero types in it: ```julia julia> ProjectTo(Ref(1))(Ref(1)) # ok Tangent{Base.RefValue{Int64}}(x = 1.0,) julia> ProjectTo(Ref(1))(Ref(NoTangent())) # could collapse to NoTangent()...

This adds a function to check whether a given type is non-differentiable. The purpose is to let you test whether to take the trivial path for some rule. It goes...

The example from https://github.com/JuliaDiff/ChainRulesCore.jl/issues/441#issuecomment-902941440 is `x -> sqrt(Diagonal(x))`, whose implementation is `sqrt.(x.diag)`. At present, Zygote returns a "structural" tangent for this, i.e. a NamedTuple. When the `.diag` is the very...

Structural Tangent
ProjectTo

Quite a few packages define a function to tell whether they are inside AD, as of https://github.com/FluxML/Flux.jl/pull/1863/files#r806287154 Flux has: ``` istraining() = false # @adjoint istraining() = true, _ ->...

enhancement

Adding two `InplaceableThunk`s via `add!!` should only need one copy, but: ```julia julia> th = rrule(sum, rand(100,100))[2](1)[2] # BTW this prints far far too much InplaceableThunk(Thunk(ChainRules.var"#1429#1432"{Int64, Colon, Matrix{Float64}, ProjectTo{AbstractArray, NamedTuple{(:element,...

inplace accumulation

If we want something like https://github.com/JuliaArrays/FillArrays.jl/pull/153 to project the gradient of a Fill onto a one-dimensional subspace, then I think we probably want something similar for the gradient of a...

ProjectTo

I was trying to figure out what Tangent and friends do. So I wrote some examples. And I wondered (1) why there isn't a method which accepts structs like Symmetric...

documentation

This macro only accepts a few functions. But if the ones it accepts aren't imported, it quietly does the wrong thing. Surely this should always make a method for `ChainRulesCore.rrule`:...

bug
rule definition helper