This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
nihui
/
ncnn
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
46
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
constraint input value to [-127, +127] (
#1258
)
* constraint input value to [-127, +127] * keep new line at the end
tags/20191113
tpoisonooo
nihui
6 years ago
parent
e56fcc77c5
commit
8dbafe7764
9 changed files
with
10 additions
and
10 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
src/layer/arm/convolution_1x1_int8.h
+1
-1
src/layer/arm/convolutiondepthwise_3x3_int8.h
+1
-1
src/layer/arm/quantize_arm.cpp
+1
-1
src/layer/arm/requantize_arm.cpp
+1
-1
src/layer/quantize.cpp
+1
-1
src/layer/requantize.cpp
+1
-1
src/layer/x86/convolution_sgemm_int8.h
+1
-1
src/layer/x86/convolutiondepthwise_3x3_int8.h
+2
-2
tools/caffe/caffe2ncnn.cpp
+ 1
- 1
src/layer/arm/convolution_1x1_int8.h
View File
@@ -19,7 +19,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/arm/convolutiondepthwise_3x3_int8.h
View File
@@ -16,7 +16,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/arm/quantize_arm.cpp
View File
@@ -25,7 +25,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/arm/requantize_arm.cpp
View File
@@ -28,7 +28,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/quantize.cpp
View File
@@ -37,7 +37,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/requantize.cpp
View File
@@ -31,7 +31,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/x86/convolution_sgemm_int8.h
View File
@@ -16,7 +16,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 1
- 1
src/layer/x86/convolutiondepthwise_3x3_int8.h
View File
@@ -16,7 +16,7 @@ static inline signed char float2int8(float v)
{
int int32 = round(v);
if (int32 > 127) return 127;
if (int32 < -12
8) return -128
;
if (int32 < -12
7) return -127
;
return (signed char)int32;
}
+ 2
- 2
tools/caffe/caffe2ncnn.cpp
View File
@@ -108,8 +108,8 @@ static signed char float2int8(float value)
if (tmp > 127)
return 127;
if (tmp < -12
8
)
return -12
8
;
if (tmp < -12
7
)
return -12
7
;
return tmp;
}
Write
Preview
Loading…
Cancel
Save