icemelon9 commented on a change in pull request #4644: [WIP] Relay op strategy
URL: https://github.com/apache/incubator-tvm/pull/4644#discussion_r377403661
##########
File path: python/tvm/schedule.py
##########
@@ -650,4 +650,38 @@ def opengl(self):
"""
_api_internal._StageOpenGL(self)
+@tvm._ffi.register_object
+class SpecializedCondition(Object):
+ """Specialized condition to enable op specialization."""
+ def __init__(self, conditions):
+ """Create a specialized condition.
+
+ .. note::
+ Conditions are represented in conjunctive joint form (CNF).
+ Each condition should be a simple expression, e.g., n > 16,
+ m % 8 == 0, etc., where n, m are tvm.Var that represents a
+ dimension in the tensor shape.
+
+ Parameters
+ ----------
+ conditions : List of tvm.Expr
+ List of conditions in conjunctive joint form (CNF).
+ """
+ if not isinstance(conditions, (list, _container.Array)):
+ conditions = [conditions]
+ self.__init_handle_by_constructor__(
+ _api_internal._CreateSpecializedCondition, conditions)
+
+ def __enter__(self):
+ _api_internal._EnterSpecializationScope(self)
+ return self
+
+ def __exit__(self, ptype, value, trace):
+ _api_internal._ExitSpecializationScope(self)
+
+
Review comment:
Fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services