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
aa56068c
Commit
aa56068c
authored
Oct 11, 2023
by
Khalique Ahmed
Browse files
formatting
parent
90967138
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/auto_contiguous.cpp
src/auto_contiguous.cpp
+2
-2
test/auto_contiguous_test.cpp
test/auto_contiguous_test.cpp
+1
-1
No files found.
src/auto_contiguous.cpp
View file @
aa56068c
...
...
@@ -68,7 +68,8 @@ void auto_contiguous::apply(module& m) const
if
(
not
outputs
.
empty
())
// if contiguous was already inserted, skip
if
(
std
::
all_of
(
outputs
.
begin
(),
outputs
.
end
(),
[](
auto
output
)
{
return
output
->
name
()
==
"contiguous"
;}))
return
output
->
name
()
==
"contiguous"
;
}))
continue
;
shape
s
=
ins
->
get_shape
();
if
(
s
.
dynamic
())
...
...
@@ -79,7 +80,6 @@ void auto_contiguous::apply(module& m) const
continue
;
if
(
s
.
scalar
()
and
not
contains
(
ins
->
name
(),
"broadcast"
))
continue
;
auto
c
=
m
.
insert_instruction
(
std
::
next
(
ins
),
make_op
(
"contiguous"
),
ins
);
m
.
replace_instruction
(
ins
,
c
);
...
...
test/auto_contiguous_test.cpp
View file @
aa56068c
...
...
@@ -202,7 +202,7 @@ TEST_CASE(standard_reshape)
auto
data
=
m2
.
add_parameter
(
"2x2"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}});
auto
add
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"add"
),
data
,
data
);
auto
ca
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
add
);
auto
r
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
2
,
1
,
12
,
5
}}}),
ca
);
auto
r
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
2
,
1
,
12
,
5
}}}),
ca
);
auto
cr
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
r
);
m2
.
add_return
({
cr
});
}
...
...
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