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
b5a4851e
Commit
b5a4851e
authored
Apr 22, 2019
by
Shucai Xiao
Browse files
clang format
parent
db4bc970
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/eliminate_contiguous.cpp
src/eliminate_contiguous.cpp
+7
-7
No files found.
src/eliminate_contiguous.cpp
View file @
b5a4851e
...
...
@@ -15,7 +15,7 @@ bool try_compute_shape(instruction_ref ins, const std::vector<shape>& inputs)
{
shape
new_shape
=
ins
->
get_operator
().
compute_shape
(
inputs
);
// If the output shape is a standard shape, no need to try its output
if
(
new_shape
.
standard
())
if
(
new_shape
.
standard
())
{
return
true
;
}
...
...
@@ -23,21 +23,21 @@ bool try_compute_shape(instruction_ref ins, const std::vector<shape>& inputs)
auto
outputs
=
ins
->
outputs
();
// If the current instruction has no output, it means the last output shape
// is non-standard, then we cannot eliminate the contiguous
if
(
outputs
.
empty
())
if
(
outputs
.
empty
())
{
return
false
;
}
for
(
auto
output
:
outputs
)
for
(
auto
output
:
outputs
)
{
auto
args
=
output
->
inputs
();
std
::
vector
<
shape
>
input_shapes
;
for
(
auto
arg
:
args
)
for
(
auto
arg
:
args
)
{
input_shapes
.
push_back
((
arg
==
ins
)
?
new_shape
:
arg
->
get_shape
());
}
if
(
!
try_compute_shape
(
output
,
input_shapes
))
if
(
!
try_compute_shape
(
output
,
input_shapes
))
{
return
false
;
}
...
...
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