cbalint13 opened a new pull request #5697:
URL: https://github.com/apache/incubator-tvm/pull/5697


   **Description**
   
   This PR fixes errors in ONNX Gemm operator import of bias-less dense 
operator.
   
   
   **Fixes**
   
   Gemm -> ```Y = alpha*A*B + beta*C```
   
   There are two cases fixed / optimized here:
   
   1. ```C``` is a zero valued constant (e.g. mxnet ```Dense(use_bias=False)``` 
exports).
   2. ```beta==0```, so we can skip the addition (usually is a bias vector).
   
   **Cases**
   
   In case of #1 without this fix:
   ```
     %11 = multiply(1f, %bias11) an internal invariant was violated while 
typechecking your program Check failed: t0->dtype == t1->dtype (float32 vs. 
int64)
   ```
   or worse (fixing type casts) we get size issues (```C``` is more like a 
constant instead of vector):
   ```
   %12 = nn.bias_add(%10, %11) unable to unify: `Tensor[(512), float32]` and 
`Tensor[(1), int64]`;
   ```
   
   
   Thank You !
   


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