Menooker commented on a change in pull request #5357:
URL: https://github.com/apache/incubator-tvm/pull/5357#discussion_r415206359



##########
File path: src/relay/transforms/fold_scale_axis.cc
##########
@@ -518,13 +564,30 @@ Expr Conv2DForwardRewrite(const Call& ref_call,
 
   // match the ic_axis
   if (is_depthwise_conv2d) {
-    Expr scale = ExpandBiasToMatchAxis(
-        sdata->scale, kernel_layout.ndim(), {big_oc_axis});
-    weight = Multiply(weight, scale);
+    if (is_simple) {
+      Expr scale = ExpandBiasToMatchAxis(
+          sdata->scale, kernel_layout.ndim(), {big_ko_axis});
+      weight = Multiply(weight, scale);
+    } else {
+      weight = Multiply(weight, ReshapeToMatchAxis(sdata->scale,
+          weight->type_as<TensorTypeNode>()->shape,
+          {big_ko_axis, small_ko_axis}));
+      if (!weight.defined())
+        return Expr();

Review comment:
       If I am understanding correctly, line 166~175 in 
`src/relay/transforms/forward_rewrite.cc` will take care of `Expr()`




----------------------------------------------------------------
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]


Reply via email to