elvin-n commented on code in PR #12545:
URL: https://github.com/apache/tvm/pull/12545#discussion_r969214283
##########
python/tvm/autotvm/task/space.py:
##########
@@ -822,11 +826,262 @@ def valid(self):
"""
return not bool(self.errors)
+ def is_index_valid(self, index):
+ """Checks if the index satisfies the multi_filter condition
+
+ Parameters
+ ----------
+ index: int
+ index from the range of the space
+
+ Returns
+ -------
+ valid: bool
+ whether the index meets all the constraints
+ """
+ assert 0 <= index < self.range_length
+ if self._shared_filter is None:
+ return True
+ if self._shared_filter_cache is None:
+ self._make_shared_filter_cache()
+ return self._shared_filter_cache[index]
+
+ def multi_filter(self, filter): # pylint: disable=redefined-builtin
+ """Keeps a function as a multi_filter
Review Comment:
it would be better to explain what is a difference between existing filter
and new introduced multi_filter
The difference is in the fact that filter restricts the only parameter while
multi_filter can restrict combination of parameters. Implementation of the
filter and multi_filter is different that lead to the introduction of
total_length and filtered_length for multi_filter
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]