ganler commented on code in PR #14312:
URL: https://github.com/apache/tvm/pull/14312#discussion_r1137816436
##########
python/tvm/relax/dpl/pattern.py:
##########
@@ -1115,3 +1115,30 @@ def make_fused_bias_activation_pattern(op_name,
with_bias=False, activation=None
return is_op(activation)(out)
return out
+
+
+def rewrite(
+ pattern: DFPattern, callback: Callable[[Expr, Dict[DFPattern, Expr]],
Expr], func: Function
Review Comment:
It actually took me some time to understand how `callback` works and can be
written. Not sure if there are better ways to simplify it. But it could be just
me.
--
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]