Skip to content
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

Add Finitary funsor for representing lazy op application #423

Merged
merged 10 commits into from
Feb 23, 2021

Conversation

eb8680
Copy link
Member

@eb8680 eb8680 commented Jan 12, 2021

Addresses #351. Blocked by #421, #422.

This PR adds a new term funsor.terms.Finitary that represents lazy op application, and refactors funsor.terms.Einsum into a new op EinsumOp that makes use of the find_domain extensibility added in #422.

Tested:

  • Exercised a bit by existing Einsum tests

@eb8680 eb8680 added Blocked Blocked by other issues WIP refactor labels Jan 12, 2021
@eb8680 eb8680 force-pushed the singledispatch-find-domain branch 2 times, most recently from a99c429 to 538fdb8 Compare January 13, 2021 23:35
Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from singledispatch-find-domain to master January 14, 2021 00:59
funsor/tensor.py Outdated Show resolved Hide resolved
Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

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

This is a great simplification!

Only one nit on keeping the standard np.einsum interface

test/test_distribution.py Outdated Show resolved Hide resolved
funsor/tensor.py Outdated Show resolved Hide resolved
@eb8680 eb8680 merged commit 0344765 into master Feb 23, 2021
@eb8680 eb8680 deleted the finitary-funsor branch February 23, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants