Skip to content

Remove remaining dregs of tuple_select (oops) #8329

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

Merged
merged 2 commits into from
Jun 27, 2024
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
2 changes: 1 addition & 1 deletion python_bindings/src/halide/halide_/PyIROperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void define_operators(py::module &m) {
// We don't want to throw an error here, since the catch(...) would catch it,
// and it would be hard to distinguish from other errors. Just set the string here
// and jump to the error reporter outside the catch.
tuple_error_msg = "tuple_select() may not mix Expr and Tuple for the condition elements.";
tuple_error_msg = "select() on Tuples may not mix Expr and Tuple for the condition elements.";
goto handle_tuple_error;
}

Expand Down
2 changes: 1 addition & 1 deletion python_bindings/test/correctness/tuple_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_tuple_select():
# fmt: on
except hl.HalideError as e:
assert (
"select() may not mix Expr and Tuple for the condition elements."
"select() on Tuples may not mix Expr and Tuple for the condition elements."
in str(e)
)
else:
Expand Down
8 changes: 0 additions & 8 deletions src/IROperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,10 +1516,6 @@ Expr select(Expr condition, Expr true_value, Expr false_value) {
return Select::make(std::move(condition), std::move(true_value), std::move(false_value));
}

Tuple tuple_select(const Tuple &condition, const Tuple &true_value, const Tuple &false_value) {
return select(condition, true_value, false_value);
}

Tuple select(const Tuple &condition, const Tuple &true_value, const Tuple &false_value) {
user_assert(condition.size() == true_value.size() && true_value.size() == false_value.size())
<< "select() on Tuples requires all Tuples to have identical sizes.";
Expand All @@ -1530,10 +1526,6 @@ Tuple select(const Tuple &condition, const Tuple &true_value, const Tuple &false
return result;
}

Tuple tuple_select(const Expr &condition, const Tuple &true_value, const Tuple &false_value) {
return select(condition, true_value, false_value);
}

Tuple select(const Expr &condition, const Tuple &true_value, const Tuple &false_value) {
user_assert(true_value.size() == false_value.size())
<< "select() on Tuples requires all Tuples to have identical sizes.";
Expand Down