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
015d1ac4
Commit
015d1ac4
authored
Mar 01, 2019
by
Shucai Xiao
Browse files
clang format
parent
c2898ca7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+4
-3
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+6
-6
No files found.
src/onnx/onnx.cpp
View file @
015d1ac4
...
@@ -483,10 +483,11 @@ struct onnx_parser
...
@@ -483,10 +483,11 @@ struct onnx_parser
{
{
if
(
beta
!=
0.
f
&&
args
[
2
]
->
get_shape
().
elements
()
>
0
)
if
(
beta
!=
0.
f
&&
args
[
2
]
->
get_shape
().
elements
()
>
0
)
{
{
auto
out_lens
=
l1
->
get_shape
().
lens
();
auto
out_lens
=
l1
->
get_shape
().
lens
();
out_lens
.
back
()
=
l2
->
get_shape
().
lens
().
back
();
out_lens
.
back
()
=
l2
->
get_shape
().
lens
().
back
();
auto
l3
=
args
[
2
];
auto
l3
=
args
[
2
];
if
(
!
std
::
equal
(
out_lens
.
begin
(),
out_lens
.
end
(),
args
[
2
]
->
get_shape
().
lens
().
begin
()))
if
(
!
std
::
equal
(
out_lens
.
begin
(),
out_lens
.
end
(),
args
[
2
]
->
get_shape
().
lens
().
begin
()))
{
{
l3
=
prog
.
add_instruction
(
op
::
multibroadcast
{
out_lens
},
args
[
2
]);
l3
=
prog
.
add_instruction
(
op
::
multibroadcast
{
out_lens
},
args
[
2
]);
}
}
...
...
test/onnx/onnx_test.cpp
View file @
015d1ac4
...
@@ -575,12 +575,12 @@ TEST_CASE(gemm_test)
...
@@ -575,12 +575,12 @@ TEST_CASE(gemm_test)
TEST_CASE
(
gemm_ex
)
TEST_CASE
(
gemm_ex
)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
6
}});
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
6
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
7
}});
auto
l2
=
p
.
add_parameter
(
"3"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
6
,
7
}});
auto
l2
=
p
.
add_parameter
(
"3"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
6
,
7
}});
auto
t0
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
l0
);
auto
t0
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
l0
);
auto
alpha
=
0.5
f
;
auto
alpha
=
0.5
f
;
auto
beta
=
0.8
f
;
auto
beta
=
0.8
f
;
p
.
add_instruction
(
migraphx
::
op
::
dot
{
alpha
,
beta
},
t0
,
l1
,
l2
);
p
.
add_instruction
(
migraphx
::
op
::
dot
{
alpha
,
beta
},
t0
,
l1
,
l2
);
auto
prog
=
migraphx
::
parse_onnx
(
"gemm_test_ex.onnx"
);
auto
prog
=
migraphx
::
parse_onnx
(
"gemm_test_ex.onnx"
);
...
...
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