Skip to content

Commit acd86a9

Browse files
authored
Merge pull request #26 from devmotion/patch-1
Collapse tuples of `nothing`
2 parents d8aba5f + 2a887ee commit acd86a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/adjoint.jl

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ for n = 0:3
2121
gradtuple = Symbol(:gradtuple, n)
2222
@eval begin
2323
$gradtuple(x::Tuple) = ($(ntuple(_->:nothing,n)...), x...)
24+
$gradtuple(::Tuple{Vararg{Nothing}}) = nothing
2425
$gradtuple(x::Nothing) = nothing
2526
$gradtuple(x) = error("Gradient $x should be a tuple")
2627
end

0 commit comments

Comments
 (0)