luyaor opened a new issue, #12305:
URL: https://github.com/apache/tvm/issues/12305

   ## Description
   
   When compiling following model, TVM will produce wrong result. The 
model(with ONNX as frontend) with error is as follows, check bug.onnx in 
[reproduce.zip](https://github.com/apache/tvm/files/9259136/reproduce.zip)
   
   The semantic of the model is to sum up input tensors with five times. For 
example, the first element in the input tensor is -0.7491791248321533, so the 
first element in output should be -0.7491791248321533 * 5 = -3.74, however, the 
element in the output is -11.986866.
   
   <img width="1020" alt="image" 
src="https://user-images.githubusercontent.com/7541296/182831586-cf464fff-2d42-465d-9f9a-b19041879f98.png";>
   
   ## How to reproduce
   
   ### Expected behavior
   
   Output should be as follows:
   ```
    [array([[[[-3.7458956 ,  2.2319033 ,  4.721547  ]],
   
           [[-2.5541332 , -1.010938  , -1.2561022 ]],
   
           [[-2.432028  ,  2.1270378 , -2.2868755 ]]],
   
   
          [[[ 0.14414614, -3.7024972 ,  3.4796305 ]],
   
           [[ 1.8737267 ,  0.38758603,  1.1408547 ]],
   
           [[-2.7563024 ,  3.4405584 , -3.7759078 ]]]], dtype=float32)]
   ```
   ### Actual behavior
   
   This is the output of running model with TVM compiled.
   ```
   [[[[-11.986866     7.142091    15.108952  ]]
   
     [[ -8.173226    -3.2350018   -4.019527  ]]
   
     [[ -7.78249      6.806521    -7.3180013 ]]]
   
   
    [[[  0.46126765 -11.847991    11.134817  ]]
   
     [[  5.9959254    1.2402753    3.6507351 ]]
   
     [[ -8.820168    11.009787   -12.082905  ]]]]
   ```
   ### Environment
   
   Python3, with tvm, onnx, numpy, onnxruntime(optional)
   
   1. Download  
[reproduce.zip](https://github.com/apache/tvm/files/9259136/reproduce.zip)
   
   2. Run `python check.py`.
   
   To check with the actual output, you could check with the commented code.
   
   


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