Skip to content

Commit

Permalink
[Fix][TIR] Fix tvm::arith::UnionLowerBound
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 15, 2023
1 parent 6eb4b87 commit 9471762
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/arith/int_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ IntSet UnionLowerBound(const Array<IntSet>& sets) {
PrimExpr min_inclusive{nullptr};
PrimExpr max_inclusive(nullptr);
for (const IntSet& int_set : sets) {
if (int_set.IsNothing()) continue;
if (const auto* interval_set = int_set.as<IntervalSetNode>()) {
PrimExpr new_min_inclusive = interval_set->min_value;
PrimExpr new_max_inclusive = interval_set->max_value;
Expand Down
3 changes: 2 additions & 1 deletion tests/python/unittest/test_arith_intset.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ def test_union_lower_bound():
pos_inf = tvm.arith.int_set.pos_inf()
set_0 = tvm.arith.IntervalSet(min_value=neg_inf, max_value=0)
set_1 = tvm.arith.IntervalSet(min_value=1, max_value=pos_inf)
result = tvm.arith.int_set.union_lower_bound([set_0, set_1])
set_2 = tvm.arith.IntervalSet(min_value=pos_inf, max_value=neg_inf)
result = tvm.arith.int_set.union_lower_bound([set_0, set_1, set_2])
assert result.min_value.same_as(neg_inf)
assert result.max_value.same_as(pos_inf)

Expand Down

0 comments on commit 9471762

Please sign in to comment.