Skip to content

Commit

Permalink
Fix KernelFunctions on Julia 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Mar 10, 2024
1 parent 2a6e5e9 commit 052be13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.3'
- '1'
- '1.6'
- 'nightly'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "KernelFunctions"
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
version = "0.10.63"
version = "0.10.64"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
6 changes: 3 additions & 3 deletions src/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function ChainRulesCore.rrule(
= ChainRulesCore.Tangent{typeof(d)}(; r=r̄)
return NoTangent(), d̄, @thunk(project_x(x̄))
end
return Distances.pairwise(d, x; dims), pairwise_pullback
return Distances.pairwise(d, x; dims=dims), pairwise_pullback
end

function ChainRulesCore.rrule(
Expand Down Expand Up @@ -190,7 +190,7 @@ function ChainRulesCore.rrule(
= ChainRulesCore.Tangent{typeof(d)}(; r=r̄)
return NoTangent(), d̄, @thunk(project_x(x̄)), @thunk(project_y(ȳ))
end
return Distances.pairwise(d, x, y; dims), pairwise_pullback
return Distances.pairwise(d, x, y; dims=dims), pairwise_pullback
end

function ChainRulesCore.rrule(
Expand Down Expand Up @@ -229,7 +229,7 @@ function ChainRulesCore.rrule(::Type{<:ColVecs}, X::AbstractMatrix)
"or because some external computation has acted on `ColVecs` to produce a vector of vectors." *
"In the former case, to solve this issue overload `kernelmatrix(_diag)` for your kernel for `ColVecs`." *
"In the latter case, one needs to track down the `rrule` whose pullback returns a `Vector{Vector{T}}`," *
" rather than a `Tangent`, as the cotangent / gradient for `ColVecs` input, and circumvent it."
" rather than a `Tangent`, as the cotangent / gradient for `ColVecs` input, and circumvent it.",
)
end
return ColVecs(X), ColVecs_pullback
Expand Down

0 comments on commit 052be13

Please sign in to comment.