Skip to content

Commit 2a887ee

Browse files
authored
Collapse tuples of nothing
1 parent 181c1be commit 2a887ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/adjoint.jl

Lines changed: 1 addition & 0 deletions
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)