Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions tests/python/unittest/test_arith_intset.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ def test_union_lower_bound():
result = tvm.arith.int_set.union_lower_bound([set_0, set_1])
assert result.min_value.same_as(neg_inf)
assert result.max_value.same_as(pos_inf)
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])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to preserve original case and just append new cases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code updated,thanks for your great advice!

assert result.min_value.same_as(neg_inf)
assert result.max_value.same_as(pos_inf)


if __name__ == "__main__":
Expand Down