Skip to content

Commit

Permalink
Use fill(x[], ()) instead
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Oct 25, 2024
1 parent db391a2 commit 8c9cc71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function (f::ReshapeTransform)(x)
# Specially handle the case where x is a singleton array, see
# https://github.com/JuliaDiff/ReverseDiff.jl/issues/265 and
# https://github.com/TuringLang/DynamicPPL.jl/issues/698
return x[]
return fill(x[], ())
else
# The call to `tovec` is only needed in case `x` is a scalar.
return reshape(tovec(x), f.output_size)
Expand Down

0 comments on commit 8c9cc71

Please sign in to comment.