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
696b449a
Commit
696b449a
authored
Nov 20, 2018
by
Shucai Xiao
Browse files
Add onnx test for sin,cos,tan operators.
parent
35bbdce5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
0 deletions
+75
-0
test/onnx/cos_test.onnx
test/onnx/cos_test.onnx
+13
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+36
-0
test/onnx/sin_test.onnx
test/onnx/sin_test.onnx
+13
-0
test/onnx/tan_test.onnx
test/onnx/tan_test.onnx
+13
-0
No files found.
test/onnx/cos_test.onnx
0 → 100644
View file @
696b449a
cos-example:9
xy"Costest_cosZ
x
b
y
B
\ No newline at end of file
test/onnx/onnx_test.cpp
View file @
696b449a
...
@@ -169,6 +169,39 @@ void dropout_test()
...
@@ -169,6 +169,39 @@ void dropout_test()
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
void
sin_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
sin
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"sin_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
cos_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
cos
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"cos_test.onnx"
);
EXPECT
(
p
==
prog
);
}
void
tan_test
()
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
10
}});
p
.
add_instruction
(
migraphx
::
op
::
tan
{},
input
);
auto
prog
=
migraphx
::
parse_onnx
(
"tan_test.onnx"
);
EXPECT
(
p
==
prog
);
}
int
main
()
int
main
()
{
{
pytorch_conv_bias_test
();
pytorch_conv_bias_test
();
...
@@ -181,4 +214,7 @@ int main()
...
@@ -181,4 +214,7 @@ int main()
globalmaxpool_test
();
globalmaxpool_test
();
transpose_test
();
transpose_test
();
dropout_test
();
dropout_test
();
sin_test
();
cos_test
();
tan_test
();
}
}
test/onnx/sin_test.onnx
0 → 100644
View file @
696b449a
sin-example:9
xy"Sintest_sinZ
x
b
y
B
\ No newline at end of file
test/onnx/tan_test.onnx
0 → 100644
View file @
696b449a
tan-example:9
xy"Tantest_tanZ
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