kfeng123 opened a new pull request, #15068:
URL: https://github.com/apache/tvm/pull/15068

   This PR improves the optimization of clip in simplify expr pass.
   Previously, there is a SimplifyCastClip class, it deals with the pattern 
"cast->clip": it checks if the a_min/a_max values of clip equals the min/max 
values of the data type of cast OP.
   This PR improve SimplifyCastClip in two aspects:
   
   1. In the original code, it is restricted that the OP before "clip" is a 
"cast" OP. This restriction is not necessary, and is relaxed.
   2. In the original code,  CheckDataTypeMaxMinValue checks if the a_min/a_max 
values of clip equals the min/max values of dtype. I relax this to check "a_max 
>= dtype.max and a_min <= dtype.min".
   
   Since the new optimization of "clip" does not rely on "cast", the name is 
changed to SimplifyClip.


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