We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gen.choicemap
In this version of the constructor: https://github.com/probcomp/Gen.jl/blob/master/src/choice_map.jl#L651-L661
This line:
choices[addr] = value
assigns the value as a leaf always, leading to this erro:
julia> cm = Gen.choicemap(:k => Gen.choicemap(:v => 2)) │ └── :k : DynamicChoiceMap(Dict{Any, Any}(:v => 2), Dict{Any, Any}()) julia> Gen.has_value(cm, :k) true julia> Gen.has_submap(cm, :k) false
The text was updated successfully, but these errors were encountered:
This behavior is the desired one, per the documentation of Gen.set_value! and Gen.set_submap!.
For the example above, the API requires breaking down the construction into separate calls:
julia> cm = Gen.choicemap() julia> Gen.set_submap!(cm, :k, Gen.choicemap(:v =>2))
Sorry, something went wrong.
I would recommend that the constructor check and guard against this case though, yeah?
No branches or pull requests
In this version of the constructor: https://github.com/probcomp/Gen.jl/blob/master/src/choice_map.jl#L651-L661
This line:
choices[addr] = value
assigns the value as a leaf always, leading to this erro:
The text was updated successfully, but these errors were encountered: