Skip to content

Commit

Permalink
Allocate output vector with empty tracers
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Jan 24, 2025
1 parent 365d7f9 commit bd7d0bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/trace_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ end

function trace_function(::Type{T}, f!, y, x) where {T<:Union{AbstractTracer,Dual}}
xt = trace_input(T, x)
yt = similar(y, T)
fill!(yt, T(0))
yt = fill(myempty(T), size(y))
f!(yt, xt)
return xt, yt
end
Expand Down

0 comments on commit bd7d0bf

Please sign in to comment.