Skip to content

Commit 534ccd8

Browse files
committed
add method for zygote.seed(::CA)
1 parent d22a56c commit 534ccd8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/ComponentArraysZygoteExt.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ function Zygote.accum(x::ComponentArray, ys::ComponentArray...)
1010
return ComponentArray(Zygote.accum(getdata(x), getdata.(ys)...), getaxes(x))
1111
end
1212

13+
function Zygote.seed(x::ComponentArray, ::Val{N}, offset = 0) where{N}
14+
data = Zygote.seed(getdata(x), Val(N), offset)
15+
16+
ComponentArray(data, getaxes(x))
17+
end
18+
1319
end

0 commit comments

Comments
 (0)