api: fix handling of multiple conditions for buffering#2850
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2850 +/- ##
========================================
Coverage 83.38% 83.38%
========================================
Files 248 248
Lines 51960 52065 +105
Branches 4480 4509 +29
========================================
+ Hits 43326 43414 +88
- Misses 7879 7892 +13
- Partials 755 759 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return CondNe(*self.args, evaluate=False) | ||
|
|
||
| @property | ||
| def _as_min(self): |
There was a problem hiding this comment.
I would drop this and rather have a singledispatch handler for CondEq where necessary
|
|
||
| def relational_shift(expr, s): | ||
| """ | ||
| Infer shift incurred by the expression. Generally only |
There was a problem hiding this comment.
I could use an example here to quickly visualise what's it trying to do
| expr = uxreplace(expr, {d: IntDiv(index, d.symbolic_factor)}) | ||
|
|
||
| # Merge conditionals when possible. E.g if we have an implicit_dim | ||
| # and there is a dimension with the same parent, we ca merged |
There was a problem hiding this comment.
Dimension
"ca merged"
"their conditions"
you could also make the example a bit more practical
| for d in input_expr.implicit_dims: | ||
| if d not in conditionals: | ||
| continue | ||
| for cd in dict(conditionals): |
| # Replace the ConditionalDimensions in `expr` | ||
| for d, cond in conditionals.items(): | ||
| # Replace dimension with index | ||
| index = d.index |
There was a problem hiding this comment.
you can spare this line
| ispace = IterationSpace(intervals, iterators) | ||
|
|
||
| # Construct the conditionals and replace the ConditionalDimensions in `expr` | ||
| # Construct the conditionals |
There was a problem hiding this comment.
I think we should place this whole block of code, which constructs/lowers the conditionals, into its own separate functions, and a docstring with some examples
ef708e5 to
b997156
Compare
7a1a6aa to
c7786ea
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
516047a to
f354a19
Compare
01f7a1c to
f904760
Compare
f904760 to
0500469
Compare
No description provided.