[Mlir-commits] [mlir] [mlir][python] fix up affine for (PR #74495)
Maksim Levental
llvmlistbot at llvm.org
Wed Dec 6 08:18:40 PST 2023
================
@@ -45,23 +46,50 @@ def __init__(
- `lower_bound_operands` is the list of arguments to substitute the dimensions,
then symbols in the `lower_bound` affine map, in an increasing order
- `upper_bound_operands` is the list of arguments to substitute the dimensions,
- then symbols in the `upper_bound` affine map, in an increasing order
+ then symbols in the `upper_bound` affine map, in an increasing order.
"""
+ if lower_bound_operands is None:
+ lower_bound_operands = []
+ if upper_bound_operands is None:
+ upper_bound_operands = []
+
+ if step is None:
+ step = 1
+ if upper_bound is None:
+ upper_bound, lower_bound = lower_bound, 0
+
+ if isinstance(lower_bound, int):
+ lower_bound = AffineMap.get_constant(lower_bound)
+ elif isinstance(lower_bound, (Operation, OpView, Value)):
----------------
makslevental wrote:
You know what's a better solution? To bump the minimum version of python to 3.10 :) - I had `isinstance(bound, _VariadicResultValueT)` but the windows bot failed where the Linux bot passed (because I guess the windows python version is lower than 3.10 but the linux version isn't). Anyay let me try.
https://github.com/llvm/llvm-project/pull/74495
More information about the Mlir-commits
mailing list