Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jan 23, 2025
1 parent dc3b4a2 commit 4a4b6a8
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/layer/dequantize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,11 @@ int Dequantize::load_model(const ModelBin& mb)

static void dequantize(const int* intptr, float* ptr, float scale, float bias, int size)
{
if (bias == 0.f)
for (int i = 0; i < size; i++)
{
for (int i = 0; i < size; i++)
{
*ptr = *intptr * scale;
intptr++;
ptr++;
}
}
else
{
for (int i = 0; i < size; i++)
{
*ptr = *intptr * scale + bias;
intptr++;
ptr++;
}
*ptr = *intptr * scale + bias;
intptr++;
ptr++;
}
}

Expand Down

0 comments on commit 4a4b6a8

Please sign in to comment.