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
8c3a42e7
Commit
8c3a42e7
authored
Nov 21, 2018
by
Shucai Xiao
Browse files
Add onnx test example for operators asin acos atan sinh and cosh.
parent
d463391e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
1 deletion
+90
-1
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+5
-0
test/onnx/acos_test.onnx
test/onnx/acos_test.onnx
+0
-0
test/onnx/asin_test.onnx
test/onnx/asin_test.onnx
+1
-1
test/onnx/atan_test.onnx
test/onnx/atan_test.onnx
+0
-0
test/onnx/cosh_test.onnx
test/onnx/cosh_test.onnx
+11
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+60
-0
test/onnx/sinh_test.onnx
test/onnx/sinh_test.onnx
+13
-0
No files found.
src/onnx/onnx.cpp
View file @
8c3a42e7
...
...
@@ -54,6 +54,11 @@ struct onnx_parser
// disable dropout for inference
add_generic_op
(
"Dropout"
,
op
::
identity
{});
add_generic_op
(
"Identity"
,
op
::
identity
{});
add_generic_op
(
"Sinh"
,
op
::
sinh
{});
add_generic_op
(
"Cosh"
,
op
::
cosh
{});
add_generic_op
(
"Asin"
,
op
::
asin
{});
add_generic_op
(
"Acos"
,
op
::
acos
{});
add_generic_op
(
"Atan"
,
op
::
atan
{});
add_broadcastable_binary_op
(
"Add"
,
op
::
add
{});
add_broadcastable_binary_op
(
"Div"
,
op
::
div
{});
...
...
test/onnx/
onnx_acos
.onnx
→
test/onnx/
acos_test
.onnx
View file @
8c3a42e7
File moved
test/onnx/
onnx_asin
.onnx
→
test/onnx/
asin_test
.onnx
View file @
8c3a42e7
...
...
@@ -10,4 +10,4 @@ b
B
\ No newline at end of file
B
\ No newline at end of file
test/onnx/
onnx_atan
.onnx
→
test/onnx/
atan_test
.onnx
View file @
8c3a42e7
File moved
test/onnx/cosh_test.onnx
0 → 100644
View file @
8c3a42e7
cosh-example:;
xy"Cosh test_coshZ
x
b
y
B
\ No newline at end of file
test/onnx/onnx_test.cpp
View file @
8c3a42e7
...
...
@@ -169,6 +169,61 @@ void dropout_test()
EXPECT
(
p
==
prog
);
}
void
sinh_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
sinh
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"sinh_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
cosh_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
}});
p
.
add_instruction
(
migraphx
::
op
::
cosh
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"cosh_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
asin_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
asin
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"asin_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
acos_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
acos
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"acos_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
atan_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
atan
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"atan_test.onnx"
);
EXPECT
(
p
==
prog
);
}
int
main
()
{
pytorch_conv_bias_test
();
...
...
@@ -181,4 +236,9 @@ int main()
globalmaxpool_test
();
transpose_test
();
dropout_test
();
sinh_test
();
cosh_test
();
asin_test
();
acos_test
();
atan_test
();
}
test/onnx/sinh_test.onnx
0 → 100644
View file @
8c3a42e7
sinh-example:;
xy"Sinh test_sinhZ
x
b
y
B
\ No newline at end of file
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