Skip to content

Commit e04dad1

Browse files
committed
caught one more first -> only
1 parent c0f4583 commit e04dad1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const FDM = FiniteDifferences.central_fdm(5, 1)
4545
gradient(f, s::Symbol, args) = gradient(f, Val(s), args)
4646

4747
function gradient(f, ::Val{:Zygote}, args)
48-
g = first(Zygote.gradient(f, args))
48+
g = only(Zygote.gradient(f, args))
4949
if isnothing(g)
5050
if args isa AbstractArray{<:Real}
5151
return zeros(size(args)) # To respect the same output as other ADs
@@ -66,7 +66,7 @@ function gradient(f, ::Val{:ReverseDiff}, args)
6666
end
6767

6868
function gradient(f, ::Val{:FiniteDiff}, args)
69-
return first(FiniteDifferences.grad(FDM, f, args))
69+
return only(FiniteDifferences.grad(FDM, f, args))
7070
end
7171

7272
function compare_gradient(f, ::Val{:FiniteDiff}, args)

0 commit comments

Comments
 (0)