Skip to content

Conversation

marcoct
Copy link
Collaborator

@marcoct marcoct commented Apr 11, 2020

"""
function update(trace;
args::Tuple=get_args(trace),
argdiffs::Tuple=map((_) -> NoChange(), args),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the default be NoChange or UnknownChange?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there are two convenience forms:

If you provide args, then argdiffs is an optional keyword argument that defaults to UnknownChange. (This is so you don't need to construct the unknown change argdiffs).

If you do not provide args then argdiffs is automatically set to NoChanges. (This is a common case e.g. for top-level generative functions on which we are doing MCMC or optimization).

@marcoct marcoct changed the title Add keyword args for common defaults for update and regenerate Add convenience forms for update and regenerate with optional args and argdiffs Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants