Skip to content

Commit 8c9cc71

Browse files
committed
Use fill(x[], ()) instead
1 parent db391a2 commit 8c9cc71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function (f::ReshapeTransform)(x)
290290
# Specially handle the case where x is a singleton array, see
291291
# https://github.com/JuliaDiff/ReverseDiff.jl/issues/265 and
292292
# https://github.com/TuringLang/DynamicPPL.jl/issues/698
293-
return x[]
293+
return fill(x[], ())
294294
else
295295
# The call to `tovec` is only needed in case `x` is a scalar.
296296
return reshape(tovec(x), f.output_size)

0 commit comments

Comments
 (0)