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
a6b99124
"vscode:/vscode.git/clone" did not exist on "d770a7dc9725fbd2262628d54b6fd680d916852a"
Commit
a6b99124
authored
Aug 14, 2018
by
Paul
Browse files
Formatting
parent
a96fae91
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
src/eliminate_contiguous.cpp
src/eliminate_contiguous.cpp
+2
-2
test/eliminate_contiguous_test.cpp
test/eliminate_contiguous_test.cpp
+1
-1
test/include/basic_ops.hpp
test/include/basic_ops.hpp
+1
-1
No files found.
src/eliminate_contiguous.cpp
View file @
a6b99124
...
@@ -34,9 +34,9 @@ void eliminate_contiguous::apply(program& p) const
...
@@ -34,9 +34,9 @@ void eliminate_contiguous::apply(program& p) const
if
(
ends_with
(
arg
->
op
.
name
(),
"contiguous"
))
if
(
ends_with
(
arg
->
op
.
name
(),
"contiguous"
))
{
{
auto
new_args
=
args
;
auto
new_args
=
args
;
auto
prev
=
arg
->
arguments
.
front
();
auto
prev
=
arg
->
arguments
.
front
();
replace
(
new_args
,
arg
,
prev
);
replace
(
new_args
,
arg
,
prev
);
if
(
try_compute_shape
(
ins
->
op
,
new_args
))
if
(
try_compute_shape
(
ins
->
op
,
new_args
))
{
{
replace_argument
(
ins
,
arg
,
prev
);
replace_argument
(
ins
,
arg
,
prev
);
}
}
...
...
test/eliminate_contiguous_test.cpp
View file @
a6b99124
...
@@ -38,7 +38,7 @@ void non_standard_op()
...
@@ -38,7 +38,7 @@ void non_standard_op()
EXPECT
(
std
::
distance
(
p
.
begin
(),
p
.
end
())
==
(
count
-
1
));
EXPECT
(
std
::
distance
(
p
.
begin
(),
p
.
end
())
==
(
count
-
1
));
}
}
int
main
()
int
main
()
{
{
standard_op
();
standard_op
();
non_standard_op
();
non_standard_op
();
...
...
test/include/basic_ops.hpp
View file @
a6b99124
...
@@ -94,7 +94,7 @@ struct pass_standard_op
...
@@ -94,7 +94,7 @@ struct pass_standard_op
migraph
::
shape
compute_shape
(
std
::
vector
<
migraph
::
shape
>
inputs
)
const
migraph
::
shape
compute_shape
(
std
::
vector
<
migraph
::
shape
>
inputs
)
const
{
{
for
(
auto
&&
input
:
inputs
)
for
(
auto
&&
input
:
inputs
)
{
{
if
(
not
input
.
standard
())
if
(
not
input
.
standard
())
throw
std
::
runtime_error
(
"Not standard shape"
);
throw
std
::
runtime_error
(
"Not standard shape"
);
...
...
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