Skip to content

Commit 71f69d5

Browse files
committed
Just use fill!
1 parent b85e025 commit 71f69d5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Nonlinear/ReverseAD/ReverseAD.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
module ReverseAD
88

99
import ForwardDiff
10-
import MutableArithmetics as MA
1110
import MathOptInterface as MOI
1211
import ..Nonlinear
1312
import SparseArrays

src/Nonlinear/ReverseAD/forward_over_reverse.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ function _eval_hessian_chunk(
9797
chunk::Int,
9898
::Val{CHUNK},
9999
) where {CHUNK}
100-
MA.operate!(zero, d.input_ϵ)
101100
for r in eachindex(ex.rinfo.local_indices)
102101
# set up directional derivatives
103102
@inbounds idx = ex.rinfo.local_indices[r]
@@ -107,8 +106,9 @@ function _eval_hessian_chunk(
107106
d.input_ϵ[(idx-1)*CHUNK+s] = ex.seed_matrix[r, offset+s-1]
108107
end
109108
end
110-
MA.operate!(zero, d.output_ϵ)
109+
fill!(d.output_ϵ, 0.0)
111110
_hessian_slice_inner(d, ex, Val(CHUNK))
111+
fill!(d.input_ϵ, 0.0)
112112
# collect directional derivatives
113113
for r in eachindex(ex.rinfo.local_indices)
114114
@inbounds idx = ex.rinfo.local_indices[r]

0 commit comments

Comments
 (0)