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
e6158f10
Commit
e6158f10
authored
Jun 05, 2019
by
Shucai Xiao
Browse files
add quantize_int8 python interace.
parents
c63d2dd3
11a0f1a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/include/migraphx/quantization.hpp
src/include/migraphx/quantization.hpp
+2
-0
src/py/migraphx_py.cpp
src/py/migraphx_py.cpp
+2
-0
No files found.
src/include/migraphx/quantization.hpp
View file @
e6158f10
...
...
@@ -22,6 +22,8 @@ void capture_arguments(program& prog,
std
::
function
<
void
(
std
::
size_t
,
std
::
vector
<
argument
>
)
>
func
);
void
capture_arguments
(
program
&
prog
,
const
std
::
vector
<
std
::
string
>&
ins_names
);
void
quantize_int8
(
program
&
prog
);
void
quantize_int8
(
program
&
prog
,
const
std
::
vector
<
std
::
string
>&
ins_names
);
void
quantize_int8
(
program
&
prog
,
const
std
::
vector
<
std
::
string
>&
ins_names
,
const
std
::
vector
<
std
::
pair
<
float
,
float
>>&
quant_params
);
...
...
src/py/migraphx_py.cpp
View file @
e6158f10
...
...
@@ -153,6 +153,7 @@ PYBIND11_MODULE(migraphx, m)
py
::
class_
<
migraphx
::
target
>
(
m
,
"target"
);
py
::
class_
<
migraphx
::
program
>
(
m
,
"program"
)
.
def
(
"clone"
,
[](
migraphx
::
program
&
p
)
{
return
*
(
new
migraphx
::
program
(
p
));
})
.
def
(
"get_parameter_shapes"
,
&
migraphx
::
program
::
get_parameter_shapes
)
.
def
(
"get_shape"
,
&
migraphx
::
program
::
get_shape
)
.
def
(
"compile"
,
[](
migraphx
::
program
&
p
,
const
migraphx
::
target
&
t
)
{
p
.
compile
(
t
);
})
...
...
@@ -192,6 +193,7 @@ PYBIND11_MODULE(migraphx, m)
std
::
vector
<
std
::
pair
<
float
,
float
>>&
quant_params
)
{
migraphx
::
quantize_int8
(
p
,
ins_names
,
quant_params
);
});
m
.
def
(
"quantize_int8"
,
[](
migraphx
::
program
&
p
)
{
migraphx
::
quantize_int8
(
p
);
});
m
.
def
(
"capture_arguments"
,
[](
migraphx
::
program
&
p
,
const
std
::
vector
<
std
::
string
>&
ins_names
)
{
migraphx
::
capture_arguments
(
p
,
ins_names
);
...
...
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