Skip to content

Commit

Permalink
Make tests version dependent, test 1.0 and nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed Jun 29, 2021
1 parent cba9dae commit f2f2163
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.3'
- '1'
# - 'nightly'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Ratios = "0.3, 0.4"
Requires = "1.1"
StaticArrays = "0.12, 1"
WoodburyMatrices = "0.4, 0.5"
julia = "1.3"
julia = "1"

[extras]
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
Expand Down
13 changes: 11 additions & 2 deletions test/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ using Zygote

itp = interpolate(y,BSpline(Linear()))

@test Zygote.gradient(itp, 1)[1] == Interpolations.gradient(itp, 1)
if VERSION v"1.3"
@test Zygote.gradient(itp, 1)[1] == Interpolations.gradient(itp, 1)
else
@test_skip Zygote.gradient(itp, 1)[1] == Interpolations.gradient(itp, 1)
end

# 2D example
x2 = [i*j for i=1:5, j=1:5]
y2 = sin.(x2)

itp2 = interpolate(y2, BSpline(Cubic(Line(OnGrid()))))
@test Zygote.gradient(itp2,1,2)[1] == Interpolations.gradient(itp2,1,2)

if VERSION v"1.3"
@test Zygote.gradient(itp2,1,2)[1] == Interpolations.gradient(itp2,1,2)
else
@test_skip Zygote.gradient(itp2,1,2)[1] == Interpolations.gradient(itp2,1,2)
end
end

0 comments on commit f2f2163

Please sign in to comment.