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
59b0d9e6
Commit
59b0d9e6
authored
Jan 10, 2019
by
Khalique
Browse files
added test for group_conv
parent
09ed8ee2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+1
-1
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+17
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+11
-0
No files found.
src/targets/gpu/lowering.cpp
View file @
59b0d9e6
...
...
@@ -56,7 +56,7 @@ struct miopen_apply
void
check_shape
(
shape
x
,
instruction_ref
i
)
{
assert
(
x
.
lens
()
==
i
->
get_shape
()
.
lens
()
);
assert
(
x
==
i
->
get_shape
());
(
void
)
x
;
(
void
)
i
;
}
...
...
test/gpu/miopen.cpp
View file @
59b0d9e6
...
...
@@ -534,6 +534,22 @@ struct test_conv2
}
};
struct
test_group_conv
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
input
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
16
,
16
}});
auto
weights
=
p
.
add_parameter
(
"w"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
1
,
3
,
3
}});
migraphx
::
op
::
convolution
op
;
op
.
group
=
4
;
p
.
add_instruction
(
op
,
input
,
weights
);
return
p
;
}
};
struct
test_conv_relu
{
migraphx
::
program
create_program
()
const
...
...
@@ -1034,6 +1050,7 @@ int main()
verify_program
<
test_softmax2
>
();
verify_program
<
test_conv
>
();
verify_program
<
test_conv2
>
();
verify_program
<
test_group_conv
>
();
verify_program
<
test_conv_relu
>
();
verify_program
<
test_conv_relu_half
>
();
verify_program
<
test_add_relu
>
();
...
...
test/onnx/onnx_test.cpp
View file @
59b0d9e6
...
...
@@ -484,4 +484,15 @@ TEST_CASE(add_scalar_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
group_conv_test
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
16
,
16
}});
auto
l1
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
1
,
3
,
3
}});
migraphx
::
op
::
convolution
op
;
op
.
group
=
4
;
p
.
add_instruction
(
op
,
l0
,
l1
);
auto
prog
=
migraphx
::
parse_onnx
(
"group_conv_test.onnx"
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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