We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b639f7 commit c98f1abCopy full SHA for c98f1ab
src/gradients.jl
@@ -247,7 +247,7 @@ function finite_difference_gradient!(
247
if ArrayInterface.fast_scalar_indexing(c2)
248
epsilon = ArrayInterface.allowed_getindex(c2, i) * dir
249
else
250
- epsilon = compute_epsilon(fdtype, x, relstep, absstep, dir) * dir
+ epsilon = compute_epsilon(fdtype, one(eltype(x)), relstep, absstep, dir) * dir
251
end
252
c1_old = ArrayInterface.allowed_getindex(c1, i)
253
ArrayInterface.allowed_setindex!(c1, c1_old + epsilon, i)
@@ -277,7 +277,7 @@ function finite_difference_gradient!(
277
278
279
280
281
282
283
0 commit comments