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

Refactor output Type inference in RandomVariable and Scan #1253

Conversation

brandonwillard
Copy link
Member

@brandonwillard brandonwillard commented Oct 13, 2022

This PR provides initial fixes for #1252, and similar faulty logic that's based on the deprecated strict TensorType.broadcastable.

@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch from d3bd279 to 67bd9e0 Compare October 13, 2022 01:50
@brandonwillard brandonwillard added bug Something isn't working shape inference labels Oct 13, 2022
@brandonwillard brandonwillard marked this pull request as draft October 13, 2022 01:53
@brandonwillard brandonwillard changed the title Fix Elemwise.grad and RandomVariable.make_node deprecated TensorType.broadcastable usage Fix deprecated TensorType.broadcastable usage in Elemwise.grad and RandomVariable.make_node Oct 13, 2022
@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch 2 times, most recently from 8c27dd3 to d2a61ba Compare October 13, 2022 02:42
@brandonwillard

This comment was marked as outdated.

@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch from d2a61ba to 9b7021c Compare October 16, 2022 01:37
@brandonwillard brandonwillard changed the title Fix deprecated TensorType.broadcastable usage in Elemwise.grad and RandomVariable.make_node Refactor output Type inference in RandomVariable.make_node Oct 16, 2022
@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch 2 times, most recently from c52fa95 to 194ef41 Compare October 20, 2022 23:56
@brandonwillard
Copy link
Member Author

Looks like this required some long overdue updates to the use of TensorType.broadcastable in Scan. With these changes, Scan should propagate exact static shape information a lot better in certain cases.

@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch from 194ef41 to 6423330 Compare October 21, 2022 00:13
@brandonwillard brandonwillard force-pushed the fix-RandomVariable-shape-inference branch from 6423330 to 272880e Compare October 21, 2022 02:44
@brandonwillard brandonwillard marked this pull request as ready for review October 21, 2022 03:51
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #1253 (272880e) into main (240827c) will decrease coverage by 4.24%.
The diff coverage is 75.17%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
- Coverage   78.35%   74.10%   -4.25%     
==========================================
  Files         152      174      +22     
  Lines       47685    48624     +939     
  Branches    10881    10351     -530     
==========================================
- Hits        37364    36035    -1329     
- Misses       7773    10301    +2528     
+ Partials     2548     2288     -260     
Impacted Files Coverage Δ
aesara/compile/compiledir.py 0.00% <0.00%> (ø)
aesara/compile/io.py 83.01% <0.00%> (-5.67%) ⬇️
aesara/d3viz/d3viz.py 23.68% <ø> (ø)
aesara/d3viz/formatting.py 12.88% <ø> (ø)
aesara/gradient.py 76.90% <ø> (-0.33%) ⬇️
aesara/graph/basic.py 89.00% <ø> (+1.20%) ⬆️
aesara/graph/destroyhandler.py 69.55% <ø> (+0.56%) ⬆️
aesara/graph/features.py 64.69% <ø> (-1.27%) ⬇️
aesara/graph/fg.py 87.39% <ø> (+0.61%) ⬆️
aesara/graph/op.py 86.59% <ø> (+18.15%) ⬆️
... and 242 more

@brandonwillard brandonwillard changed the title Refactor output Type inference in RandomVariable.make_node Refactor output Type inference in RandomVariable and Scan Oct 21, 2022
@brandonwillard brandonwillard merged commit 471657a into aesara-devs:main Oct 21, 2022
@brandonwillard brandonwillard deleted the fix-RandomVariable-shape-inference branch October 21, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shape inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant