Skip to content

Commit 01530b6

Browse files
committed
use ForwardDiff for chain rule test of SqMahalanobis
1 parent a7e7452 commit 01530b6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/chainrules.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function ChainRulesCore.rrule(s::Sinus, x::AbstractVector, y::AbstractVector)
118118
return val, evaluate_pullback
119119
end
120120

121-
## Reverse Rulse SqMahalanobis
121+
## Reverse Rules SqMahalanobis
122122

123123
function ChainRulesCore.rrule(
124124
dist::Distances.SqMahalanobis, a::AbstractVector, b::AbstractVector

test/chainrules.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
KernelFunctions.Sinus(r)(xy[1], xy[2])
2323
end
2424
if VERSION < v"1.6"
25-
compare_gradient(:Zygote, [Q, x, y]) do xy
26-
SqMahalanobis(xy[1]; skipchecks=true)(xy[2], xy[3])
25+
compare_gradient(:ForwardDiff, [Q, x, y]) do Qxy
26+
SqMahalanobis(Qxy[1]; skipchecks=true)(Qxy[2], Qxy[3])
2727
end
2828
else
29-
compare_gradient(:Zygote, [Q, x, y]) do xy
30-
SqMahalanobis(xy[1])(xy[2], xy[3])
29+
compare_gradient(:Zygote, [Q, x, y]) do Qxy
30+
SqMahalanobis(Qxy[1])(Qxy[2], Qxy[3])
3131
end
3232
end
3333
end

0 commit comments

Comments
 (0)