Skip to content

Commit

Permalink
Add promotion rules (belong in ChainRulesCore)
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Sep 16, 2024
1 parent aa58c9b commit 45f00a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rulesets/Base/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ end

_zero_fill!(dx::AbstractArray) = fill!(dx, zero(eltype(dx)))

# Belong in ChainRulesCore
Base.promote_type(T::Type{<:Number}, S::Type{<:AbstractZero}) = T
Base.promote_type(T::Type{<:AbstractZero}, S::Type{<:Number}) = S

function rrule(::typeof(∇eachslice), dys, x, vd::Val)
function ∇∇eachslice(dz_raw)
dz = unthunk(dz_raw)
Expand Down

0 comments on commit 45f00a5

Please sign in to comment.