Skip to content

Commit d969a6f

Browse files
pat-altmcabbott
andauthored
Attempt to make compatible with Julia nightly (#15)
* trying to fix the error that's come up on julia nightly * CI wasn't triggered * removed Manifest * moved CI to 1.7 * bumped up version entry * revert to 1.3 * drop 1.3 CI Co-authored-by: Michael Abbott <[email protected]>
1 parent 97a9af6 commit d969a6f

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
version:
19-
- '1.3'
19+
- '1.6' # LTS
2020
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
2121
- 'nightly'
2222
os:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Manifest.toml

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SliceMap"
22
uuid = "82cb661a-3f19-5665-9e27-df437c7e54c8"
33
authors = ["Michael Abbott"]
4-
version = "0.2.6"
4+
version = "0.2.7"
55

66
[deps]
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ how `slicemap(f, A; dims)` works). Similar gradients are also available in
2828
and in [LazyStack](https://github.com/mcabbott/LazyStack.jl).
2929

3030
There are more details & examples at [docs/intro.md](docs/intro.md).
31+
32+

src/SliceMap.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ end
185185
#= JuliennedArrays =#
186186

187187
@adjoint JuliennedArrays.Slices(whole, along...) =
188-
Slices(whole, along...), Δ -> (Align(Δ, along...), map(_->nothing, along)...)
188+
JuliennedArrays.Slices(whole, along...), Δ -> (Align(Δ, along...), map(_->nothing, along)...)
189189

190190
@adjoint JuliennedArrays.Align(whole, along...) =
191-
Align(whole, along...), Δ -> (Slices(Δ, along...), map(_->nothing, along)...)
192-
191+
Align(whole, along...), Δ -> (JuliennedArrays.Slices(Δ, along...), map(_->nothing, along)...)
193192
#= Base =#
194193

195194
@adjoint Base.reduce(::typeof(hcat), V::AbstractVector{<:AbstractVector}) =

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Zygote.refresh()
3535
@test grad Zygote.gradient(m -> sum(sin, tmapcols(fun, m)), mat)[1]
3636
@test grad Zygote.gradient(m -> sum(sin, ThreadMapCols{3}(fun, m)), mat)[1]
3737

38-
jcols(f,m) = Align(map(f, Slices(m, True(), False())), True(), False())
38+
jcols(f,m) = Align(map(f, JuliennedArrays.Slices(m, True(), False())), True(), False())
3939
@test res jcols(fun, mat)
4040
@test grad Zygote.gradient(m -> sum(sin, jcols(fun, m)), mat)[1]
4141

@@ -111,7 +111,7 @@ end
111111
@test grad Tracker.gradient(m -> sum(sin, maprows(fun, m)), mat)[1]
112112
@test grad Zygote.gradient(m -> sum(sin, maprows(fun, m)), mat)[1]
113113

114-
jrows(f,m) = Align(map(f, Slices(m, False(), True())), False(), True())
114+
jrows(f,m) = Align(map(f, JuliennedArrays.Slices(m, False(), True())), False(), True())
115115
@test res jrows(fun, mat)
116116
@test grad Zygote.gradient(m -> sum(sin, jrows(fun, m)), mat)[1]
117117

@@ -128,12 +128,12 @@ end
128128
@test grad Zygote.gradient(x -> sum(sin, slicemap(fun, x, dims=3)), ten)[1]
129129

130130
jthree(f,m) = Align(map(f,
131-
Slices(m, False(), False(), True(), False())
131+
JuliennedArrays.Slices(m, False(), False(), True(), False())
132132
), False(), False(), True(), False())
133133
@test res jthree(fun, ten)
134134
@test grad Zygote.gradient(m -> sum(sin, jthree(fun, m)), ten)[1]
135135

136-
j3(f,m) = Align(map(f, Slices(m, 3)), 3)
136+
j3(f,m) = Align(map(f, JuliennedArrays.Slices(m, 3)), 3)
137137
@test res j3(fun, ten)
138138
@test grad Zygote.gradient(m -> sum(sin, j3(fun, m)), ten)[1]
139139

0 commit comments

Comments
 (0)