Skip to content

Commit

Permalink
promote_type -> promote_rule, add eltype for NoTangent
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Sep 16, 2024
1 parent b5396f7 commit 940d63f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rulesets/Base/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ 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
Base.promote_rule(T::Type{<:Number}, S::Type{<:AbstractZero}) = T
Base.promote_rule(T::Type{<:AbstractZero}, S::Type{<:Number}) = S
Base.eltype(::Type{NoTangent}) = NoTangent

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

0 comments on commit 940d63f

Please sign in to comment.