Skip to content

Commit d9deed2

Browse files
Kenooxinabox
authored andcommitted
misc fixes
1 parent 9918900 commit d9deed2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/extra_rules.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Base.hash(x::ZeroTangent, h::UInt64) = hash(0, h)
296296
# should this be in ChainRules/ChainRulesCore?
297297
# Avoid making nested backings, a Tangent is already a valid Tangent for a Tangent,
298298
# or a valid second order Tangent for the primal
299-
function frule((_, ẋ), T::Type{<:Tangent}, x)
299+
function ChainRulesCore.frule((_, ẋ), T::Type{<:Tangent}, x)
300300
::Tangent
301301
return T(x), ẋ
302-
end
302+
end

src/stage1/forward.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ function shuffle_down(b::TaylorBundle{N, B}) where {N, B}
3333
ntuple(_sdown, N-1))
3434
end
3535

36+
@noinline check_taylor(z₁, z₂) = @assert(z₁ == z₂, "$z₁ == $z₂")
3637

3738
function shuffle_up(r::TaylorBundle{1, Tuple{B1,B2}}) where {B1,B2}
3839
z₀ = primal(r)[1]
3940
z₁ = partial(r, 1)[1]
4041
z₂ = primal(r)[2]
4142
z₁₂ = partial(r, 1)[2]
4243
if true
43-
@assert(z₁ == z₂, "$z₁ == $z₂")
44+
check_taylor(z₁, z₂)
4445
return TaylorBundle{2}(z₀, (z₁, z₁₂))
4546
else
4647
return ExplicitTangentBundle{2}(z₀, (z₁, z₂, z₁₂))

0 commit comments

Comments
 (0)