File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
name = " DynamicPPL"
2
2
uuid = " 366bfd00-2699-11ea-058f-f148b4cae6d8"
3
- version = " 0.30.1 "
3
+ version = " 0.30.2 "
4
4
5
5
[deps ]
6
6
ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
Original file line number Diff line number Diff line change @@ -286,8 +286,15 @@ function (f::ReshapeTransform)(x)
286
286
if size (x) != f. input_size
287
287
throw (DimensionMismatch (" Expected input of size $(f. input_size) , got $(size (x)) " ))
288
288
end
289
- # The call to `tovec` is only needed in case `x` is a scalar.
290
- return reshape (tovec (x), f. output_size)
289
+ if f. output_size == ()
290
+ # Specially handle the case where x is a singleton array, see
291
+ # https://github.com/JuliaDiff/ReverseDiff.jl/issues/265 and
292
+ # https://github.com/TuringLang/DynamicPPL.jl/issues/698
293
+ return fill (x[], ())
294
+ else
295
+ # The call to `tovec` is only needed in case `x` is a scalar.
296
+ return reshape (tovec (x), f. output_size)
297
+ end
291
298
end
292
299
293
300
function (inv_f:: Bijectors.Inverse{<:ReshapeTransform} )(x)
You can’t perform that action at this time.
0 commit comments