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

Fix handling of constant inputs to SubsumingElemwise #93

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

brandonwillard
Copy link
Member

@brandonwillard brandonwillard commented Jan 10, 2023

This fixes the error seen in #90.

The underlying issue is that SubsumingElemwise extends OpFromGraph and the latter does not accept constant inputs (e.g. an OpFromGraph representing 1 / x should only take x as an input, and not also 1). This PR removes constant inputs when the OpFromGraph is constructed and also strips them from calls to SubsumingElemwise.make_node. The assumption is that the inputs provided in both cases (i.e. when the Op is constructed and when the constructed Op is used to create a node) refer to the same constants, which they absolutely should in this scenario.

  • Extend the new test so that it more directly confirms that the result is correct

@brandonwillard brandonwillard marked this pull request as ready for review January 10, 2023 03:03
@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Base: 98.28% // Head: 98.29% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (55632f1) compared to base (6fe3c54).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   98.28%   98.29%           
=======================================
  Files          10       10           
  Lines         698      702    +4     
  Branches       62       65    +3     
=======================================
+ Hits          686      690    +4     
  Misses          5        5           
  Partials        7        7           
Impacted Files Coverage Δ
aemcmc/basic.py 100.00% <100.00%> (ø)
aemcmc/rewriting.py 98.70% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rlouf rlouf merged commit d294026 into aesara-devs:main Jan 31, 2023
@brandonwillard brandonwillard deleted the fix-subsuming-constants branch January 31, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logistic regression with time-varying coefficients: cannot construct sampler
2 participants