Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuse Clip->Q to Q #10434

Merged
merged 5 commits into from
Feb 3, 2022
Merged

Fuse Clip->Q to Q #10434

merged 5 commits into from
Feb 3, 2022

Conversation

yihonglyu
Copy link
Contributor

@yihonglyu yihonglyu commented Jan 29, 2022

Implement a level 1 transformation ClipQuantFusion. It would check whether
Clip's range is larger than QuantizeLinear's, if it is, drop the Clip.

The range of QuantizeLinear is deducted according to following formulas:

  • For int8_t zero_point: scale * [-128 - zero_point, 127 - zero_point]
  • For uint8_t zero_point: scale * [0- zero_point, 255 - zero_point]

As GetClipConstantMinMax is used by transformations ClipQuantFusion and
ConvActivationFusion, move it to utils.h/utils.cc.

@yihonglyu yihonglyu requested a review from yufenglee January 29, 2022 18:41
@yihonglyu yihonglyu requested a review from yufenglee February 2, 2022 23:54
Copy link
Member

@yufenglee yufenglee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@yufenglee yufenglee merged commit a405658 into master Feb 3, 2022
@yufenglee yufenglee deleted the yilyu/fuse_clip_q branch February 3, 2022 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants