Skip to content

Commit 83f49fd

Browse files
Slice GNNRecurrence input by indexing instead of eachslice views (#707)
Signed-off-by: Parvm1102 <parvmittal31757@gmail.com> Co-authored-by: Carlo Lucibello <carlo.lucibello@gmail.com>
1 parent ec7f620 commit 83f49fd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Entries link to the pull request that introduced them.
4141
## GraphNeuralNetworks.jl — Unreleased (towards 1.1.1)
4242

4343
**Changed**
44+
- `GNNRecurrence` now hands each cell an indexed time slice instead of an `eachslice` view, matching the Lux frontend. Enzyme's type analysis fails on `SubArray` cell inputs, so this unblocks `DCGRU`, `EvolveGCNO`, `GConvGRU` and `GConvLSTM` under Enzyme ([#707]).
4445
- The recurrent temporal cells now delegate their forward-pass math to shared `GNNlib` functions (requires GNNlib ≥ 1.4); the layer behaviour is unchanged ([#696]).
4546

4647
## GNNlib.jl 1.4.0 — 2026-07-22
@@ -235,5 +236,6 @@ Lux implementations of the graph convolutional, pooling, and temporal layers
235236
[#696]: https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/pull/696
236237
[#703]: https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/pull/703
237238
[#704]: https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/pull/704
239+
[#707]: https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/pull/707
238240
[#706]: https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/pull/706
239241
[FluxML/Zygote.jl#1662]: https://github.com/FluxML/Zygote.jl/issues/1662

‎GraphNeuralNetworks/src/layers/temporalconv.jl‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
function scan(cell, g::GNNGraph, x::AbstractArray{T,3}, state) where {T}
22
y = []
3-
for xt in eachslice(x, dims = 2)
4-
yt, state = cell(g, xt, state)
3+
for t in 1:size(x, 2)
4+
# slice by indexing, not `eachslice`: Enzyme's type analysis fails on
5+
# `SubArray` cell inputs. The Lux frontend slices the same way.
6+
yt, state = cell(g, x[:, t, :], state)
57
y = vcat(y, [yt])
68
end
79
return stack(y, dims = 2)

0 commit comments

Comments
 (0)