Skip to content

Commit a6bd31b

Browse files
authored
Merge pull request #9 from andreasnoack/an/big
Initialize gradient in HessianResult to avoid undef errors when
2 parents 8d12336 + e4ed5ab commit a6bd31b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DiffResults.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Note that `HessianResult` allocates its own storage; `x` is only used for type a
104104
shape information. If you want to allocate storage yourself, use the `DiffResult`
105105
constructor instead.
106106
"""
107-
HessianResult(x::AbstractArray) = DiffResult(first(x), similar(x), similar(x, length(x), length(x)))
107+
HessianResult(x::AbstractArray) = DiffResult(first(x), zeros(length(x)), similar(x, length(x), length(x)))
108108
HessianResult(x::StaticArray) = DiffResult(first(x), x, zeros(StaticArrays.similar_type(typeof(x), Size(length(x),length(x)))))
109109

110110
#############

0 commit comments

Comments
 (0)