Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Sep 28, 2024
1 parent f52316f commit 8bd0003
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nQuantCpp/PnnLABGAQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ namespace PnnLABQuant
static double rotateLeft(double u, double v, double delta) {
auto theta = M_PI * randrange(minRatio, maxRatio) / exp(delta);
auto result = u * sin(theta) + v * cos(theta);
if (result <= minRatio || result >= maxRatio)
if (delta < 50 && (result <= minRatio || result >= maxRatio))
result = rotateLeft(u, v, delta + .5);
return result;
}

static double rotateRight(double u, double v, double delta) {
auto theta = M_PI * randrange(minRatio, maxRatio) / exp(delta);
auto result = u * cos(theta) - v * sin(theta);
if (result <= minRatio || result >= maxRatio)
if (delta < 50 && (result <= minRatio || result >= maxRatio))
result = rotateRight(u, v, delta + .5);
return result;
}
Expand Down

0 comments on commit 8bd0003

Please sign in to comment.