Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
277ae59c
"projects/vscode:/vscode.git/clone" did not exist on "bef959c75587f4cdba02c1a7e87581916bca5e29"
Commit
277ae59c
authored
Jun 05, 2019
by
Shucai Xiao
Browse files
Merge branch 'int8_quantize' into op_capture
parents
43d39b4e
4cf9bd01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/targets/gpu/device/convert.cpp
src/targets/gpu/device/convert.cpp
+4
-4
No files found.
src/targets/gpu/device/convert.cpp
View file @
277ae59c
...
@@ -20,10 +20,10 @@ void convert(hipStream_t stream,
...
@@ -20,10 +20,10 @@ void convert(hipStream_t stream,
if
(
target_type
==
shape
::
int8_type
)
if
(
target_type
==
shape
::
int8_type
)
{
{
gs_launch
(
stream
,
result
.
get_shape
().
elements
())([
=
](
auto
i
)
{
gs_launch
(
stream
,
result
.
get_shape
().
elements
())([
=
](
auto
i
)
{
float
res
=
input_ptr
[
i
]
*
scale
+
shift
;
float
res
=
input_ptr
[
i
]
*
scale
+
shift
;
int
factor
=
(
res
>
0
)
?
1
:
-
1
;
int
factor
=
(
res
>
0
)
?
1
:
-
1
;
output_ptr
[
i
]
=
output_ptr
[
i
]
=
static_cast
<
int8_t
>
(
std
::
min
<
int8_
t
>
(
std
::
max
<
float
>
(
-
128
,
res
+
factor
*
0.5
),
127
);
std
::
min
<
floa
t
>
(
std
::
max
<
float
>
(
-
128
.0
f
,
res
+
factor
*
0.5
),
127
.0
f
)
);
});
});
}
}
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment