A few days ago I was looking at the Relay prelude, and I found the following
function definition:
```
/*
* Filters a list, returning a sublist of only the values which satisfy the
given predicate.
*/
@filter[A](%f: fn(A) -> Tensor[(), bool], %xs: List[A]) -> List[A] {
match (%xs) {
Cons(%x, %rest) => {
if (%f(%x)) {
Cons(%x, @filter(%f, %rest))
} else {
@filter(%f, %rest)
}
},
Nil => Nil,
}
}
```
The name "filter" doesnt signal whether it filter in (accepting value in the
predicate) (select) or filter out (rejecting value in the predicate) (reject).
While this is a common functional programming convention that filter mean
"filter in (select)", a lot of ppl in tvm are not familiar with those language,
and filter only add mental overhead.
So, I propose to change the name to select.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-tvm/issues/4909