Skip to content

returned doesn't have a method for Dict #1095

@penelopeysm

Description

@penelopeysm

DynamicPPL.jl/src/model.jl

Lines 1139 to 1146 in 22740ed

function returned(model::Model, parameters::NamedTuple)
fixed_model = fix(model, parameters)
return fixed_model()
end
function returned(model::Model, values, keys)
return returned(model, NamedTuple{keys}(values))
end

NamedTuple is dangerous, as it only works for identity-lens-VarNames.

BTW, i wonder if it is a bit debatable as to whether it should really use fix? as that zeroes all logprobs. If the return value includes logprobs, then returned(model, NT) will yield zero, whereas that may not have been intended. I believe that it's safer to use InitFromParams, even if that's somewhat slower (as it has to go through the whole accumulator stuff).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions