Skip to content

Commit 02a8d26

Browse files
committed
Use regular zeros if <: Array
1 parent 706728e commit 02a8d26

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/EvaluateEquationDerivative.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ function grad_deg0_eval(
294294
)::Tuple{AbstractVector{T},AbstractMatrix{T},Bool} where {T<:Number,variable,n_gradients}
295295
const_part = deg0_eval(tree, cX)[1]
296296

297-
zero_mat = hcat((fill_similar(zero(T), cX, axes(cX, 2)) for _ in 1:n_gradients)...)'
297+
zero_mat = if typeof(cX) <: Array
298+
zeros(T, n_gradients, size(cX, 2))
299+
else
300+
hcat((fill_similar(zero(T), cX, axes(cX, 2)) for _ in 1:n_gradients)...)'
301+
end
298302

299303
if variable == tree.constant
300304
return (const_part, zero_mat, true)

0 commit comments

Comments
 (0)