-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
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
Constant Funsor #548
Constant Funsor #548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation of Constant
Funsor with patterns for substitution
, unary
, binary
, some of the reduction
ops, and to_data, to_funsor
functions. One use case is in Delta.eager_reduce
as lazy Zero terms.
funsor/delta.py
Outdated
if point.inputs: | ||
scale += (point == point).all().log() | ||
scale += funsor.Constant(point.inputs, Number(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one use case (and line 191) for Constant
term.
After working on this I came to a conclusion that the counterpart of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for such a late review. This mostly looks good, and it's self-contained, so I'm OK merging modulo a few nits. It would be good to sync again about the larger context for this PR since it sounds like your thinking has changed.
@eb8680 I made the changes that we discussed over Zoom. |
Addresses #547