diff --git a/src/utils.jl b/src/utils.jl index 1a2d1ffd7..a809fda17 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -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)