jcf94 commented on a change in pull request #8607:
URL: https://github.com/apache/tvm/pull/8607#discussion_r680612911



##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -770,10 +770,8 @@ def flatten_to_nd(x, x_shape, nd=3):
                 # Convert a and b into 3 dimensional tensors.
                 a = flatten_to_nd(inputs[0], a_shape, 3)
                 b = flatten_to_nd(inputs[1], b_shape, 3)
-                # Transpose matrix dimensions of b.
-                b = _op.transpose(b, [0, 2, 1])
                 # Perform a batch matmul.
-                output = _op.nn.batch_matmul(a, b)
+                output = _op.nn.batch_matmul(a, b, transpose_b=False)

Review comment:
       Thanks! @ymwangg 
   
   Just a little concern about changing the default behavior of framework 
frontend, since currently the default topi schedule support for NN format is 
not as strong as the original NT one.
   This may cause confusions to those who have used onnx frontend before or who 
is using onnx frontend now.
   
   To give an example, I've added an extra config to TensorFlow frontend which 
uses the NT format by default but provides an option to use the normal format. 
I think that would be better before we have prepared a strong enough topi.
   
   p.s.: You see, I've also kept the default layout for `nn.batch_matmul` to be 
the original NT.
   
   
https://github.com/apache/tvm/blob/765397295410c7ec15a5df8be0df05c2e18d5ea0/python/tvm/relay/frontend/tensorflow_ops.py#L1191-L1199




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


Reply via email to