Skip to content

Commit a4ea9ba

Browse files
Update gradients.jl
1 parent 6e9bfb0 commit a4ea9ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gradients.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function finite_difference_gradient!(
238238
# c1 denotes x1, c2 is epsilon
239239
fx, c1, c2, c3 = cache.fx, cache.c1, cache.c2, cache.c3
240240
if fdtype != Val(:complex) && ArrayInterface.fast_scalar_indexing(c2)
241-
@. c2 = compute_epsilon(fdtype, x, relstep, absstep, dir)
241+
@. c2 = compute_epsilon(fdtype, one(eltype(x)), relstep, absstep, dir)
242242
copyto!(c1, x)
243243
end
244244
copyto!(c3, x)

0 commit comments

Comments
 (0)