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
ae513aa8
Commit
ae513aa8
authored
May 02, 2022
by
turneram
Browse files
Formatting
parent
f89638ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
33 deletions
+32
-33
src/include/migraphx/op/layernorm.hpp
src/include/migraphx/op/layernorm.hpp
+30
-31
src/onnx/parse_layernorm.cpp
src/onnx/parse_layernorm.cpp
+2
-2
No files found.
src/include/migraphx/op/layernorm.hpp
View file @
ae513aa8
...
@@ -72,7 +72,7 @@ struct layernorm
...
@@ -72,7 +72,7 @@ struct layernorm
mean_inv_std_dev_dim.at(i) = 1;
mean_inv_std_dev_dim.at(i) = 1;
} */
} */
if
(
args
.
size
()
==
3
)
if
(
args
.
size
()
==
3
)
{
{
visit_all
(
result
,
args
[
0
],
args
[
1
],
args
[
2
])(
visit_all
(
result
,
args
[
0
],
args
[
1
],
args
[
2
])(
[
&
](
auto
output
,
auto
data
,
auto
weights
,
auto
bias
)
{
[
&
](
auto
output
,
auto
data
,
auto
weights
,
auto
bias
)
{
...
@@ -101,8 +101,7 @@ struct layernorm
...
@@ -101,8 +101,7 @@ struct layernorm
}
}
else
else
{
{
visit_all
(
result
,
args
[
0
])(
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
data
)
{
[
&
](
auto
output
,
auto
data
)
{
par_for
(
norm_count
,
[
&
](
auto
idx
)
{
par_for
(
norm_count
,
[
&
](
auto
idx
)
{
auto
offset
=
idx
*
norm_size
;
auto
offset
=
idx
*
norm_size
;
double
mean
=
0
;
double
mean
=
0
;
...
...
src/onnx/parse_layernorm.cpp
View file @
ae513aa8
...
@@ -32,7 +32,7 @@ struct parse_layernorm : op_parser<parse_layernorm>
...
@@ -32,7 +32,7 @@ struct parse_layernorm : op_parser<parse_layernorm>
if
(
args
.
size
()
>=
2
)
if
(
args
.
size
()
>=
2
)
layernorm
=
info
.
add_instruction
(
make_op
(
"mul"
),
layernorm
,
args
.
at
(
1
));
layernorm
=
info
.
add_instruction
(
make_op
(
"mul"
),
layernorm
,
args
.
at
(
1
));
if
(
args
.
size
()
==
3
)
if
(
args
.
size
()
==
3
)
layernorm
=
info
.
add_instruction
(
make_op
(
"add"
),
layernorm
,
args
.
at
(
2
));
layernorm
=
info
.
add_instruction
(
make_op
(
"add"
),
layernorm
,
args
.
at
(
2
));
return
layernorm
;
return
layernorm
;
...
...
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