David Widmann

Results 1463 comments of David Widmann

The same error occurs when saving an optimizer in Flux: https://github.com/FluxML/Flux.jl/issues/737 As far as I can see, the underlying problem is that it is not possible to save an `IdDict`.

Here are some examples that reproduce the error resulting from the calls of `Int32` in https://github.com/JuliaIO/BSON.jl/blob/f66a6395d76240f6fccf7adccc831741f8c1a4d8/src/write.jl#L14, https://github.com/JuliaIO/BSON.jl/blob/f66a6395d76240f6fccf7adccc831741f8c1a4d8/src/write.jl#L15, and https://github.com/JuliaIO/BSON.jl/blob/f66a6395d76240f6fccf7adccc831741f8c1a4d8/src/write.jl#L32: ```julia julia> using BSON julia> a = zeros(UInt8, 2147483634); julia> BSON.@save...

> Julia now hides depwarns by default. Not in the tests though.

Ǹot really surprising that sometimes `Any` is returned - seems we use Core.Compiler.return_type: https://github.com/TuringLang/DynamicPPL.jl/blob/083dfa11447e762aaa74a07e08c39f40b39a7d0e/src/varinfo.jl#L1036 It is allowed to return `Any` (or any other super type of the actual `eltype`) for...

Yeah :smile: My main point is that there might be many more cases where `Any` (or some other super type) is returned, so there's no guarantee that the fix will...

BTW the fix is inconsistent with the behaviour for non-empty `VarInfo`: ```julia julia> using DynamicPPL, Distributions, Random julia> @model demo() = x ~ Normal() demo (generic function with 2 methods)...

> Sure! But in this case I'd say that this fix is still better than not sweat_smile But why base it on `getlogp` if it's not based on `getlogp` if...

> This is what we do for SimpleVarInfo That's definitely inconsistent with `VarInfo` :disappointed: Do we have to define `eltype` for `VarInfo` at all? It's not completely clear on what...

Maybe we can fix these `eltype` use cases. But for this use case it seems more reasonable to base `eltype` on the samples but not the `logp` since the `::Type`...

Yes, I guess probably this inconsistency between `VarInfo` and `SimpleVarInfo` is the least important issue. I'm more concerned with defining `eltype` for varinfos at all, and particularly based on the...