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
7bab863d
Commit
7bab863d
authored
Feb 01, 2019
by
Shucai Xiao
Browse files
clang format.
parent
a7a3f867
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+1
-1
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+1
-1
src/rewrite_rnn.cpp
src/rewrite_rnn.cpp
+7
-4
No files found.
src/include/migraphx/operators.hpp
View file @
7bab863d
src/onnx/onnx.cpp
View file @
7bab863d
src/rewrite_rnn.cpp
View file @
7bab863d
...
@@ -95,7 +95,8 @@ void rewrite_rnn::apply(program& prog) const
...
@@ -95,7 +95,8 @@ void rewrite_rnn::apply(program& prog) const
instruction_ref
hidden_output
{};
instruction_ref
hidden_output
{};
if
(
ret_forward
[
0
]
==
prog
.
end
())
if
(
ret_forward
[
0
]
==
prog
.
end
())
{
{
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
1
},
ret_forward
[
1
],
ret_reverse
[
1
]);
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
1
},
ret_forward
[
1
],
ret_reverse
[
1
]);
}
}
else
else
{
{
...
@@ -103,7 +104,8 @@ void rewrite_rnn::apply(program& prog) const
...
@@ -103,7 +104,8 @@ void rewrite_rnn::apply(program& prog) const
prog
.
insert_instruction
(
ins
,
op
::
concat
{
0
},
ret_forward
[
0
],
ret_forward
[
1
]);
prog
.
insert_instruction
(
ins
,
op
::
concat
{
0
},
ret_forward
[
0
],
ret_forward
[
1
]);
ret_reverse
[
0
]
=
ret_reverse
[
0
]
=
prog
.
insert_instruction
(
ins
,
op
::
concat
{
0
},
ret_reverse
[
1
],
ret_reverse
[
0
]);
prog
.
insert_instruction
(
ins
,
op
::
concat
{
0
},
ret_reverse
[
1
],
ret_reverse
[
0
]);
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
1
},
{
ret_forward
[
0
],
ret_reverse
[
0
]});
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
1
},
{
ret_forward
[
0
],
ret_reverse
[
0
]});
}
}
map_last_output
[
hidden_output
]
=
last_output
;
map_last_output
[
hidden_output
]
=
last_output
;
}
}
...
@@ -151,7 +153,8 @@ void rewrite_rnn::apply(program& prog) const
...
@@ -151,7 +153,8 @@ void rewrite_rnn::apply(program& prog) const
{
{
auto
concat_arg0
=
is_forward
?
ret
[
0
]
:
ret
[
1
];
auto
concat_arg0
=
is_forward
?
ret
[
0
]
:
ret
[
1
];
auto
concat_arg1
=
is_forward
?
ret
[
1
]
:
ret
[
0
];
auto
concat_arg1
=
is_forward
?
ret
[
1
]
:
ret
[
0
];
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
0
},
concat_arg0
,
concat_arg1
);
hidden_output
=
prog
.
replace_instruction
(
ins
,
op
::
concat
{
0
},
concat_arg0
,
concat_arg1
);
}
}
map_last_output
[
hidden_output
]
=
last_output
;
map_last_output
[
hidden_output
]
=
last_output
;
}
}
...
@@ -166,7 +169,7 @@ void rewrite_rnn::apply(program& prog) const
...
@@ -166,7 +169,7 @@ void rewrite_rnn::apply(program& prog) const
auto
inputs
=
ins
->
inputs
();
auto
inputs
=
ins
->
inputs
();
assert
(
inputs
.
size
()
==
1
);
assert
(
inputs
.
size
()
==
1
);
auto
arg
=
inputs
[
0
];
auto
arg
=
inputs
[
0
];
if
(
map_last_output
.
count
(
arg
)
==
0
)
if
(
map_last_output
.
count
(
arg
)
==
0
)
{
{
MIGRAPHX_THROW
(
"RNN_LAST_OUTPUT: no related rnn operator as its input"
);
MIGRAPHX_THROW
(
"RNN_LAST_OUTPUT: no related rnn operator as its input"
);
}
}
...
...
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