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
b088ac70
Commit
b088ac70
authored
Jan 22, 2022
by
Shucai Xiao
Browse files
fixed the issue for non-standard input shape to the reshape operator
parent
4c90e9a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
src/eliminate_contiguous.cpp
src/eliminate_contiguous.cpp
+3
-2
src/onnx/onnx_parser.cpp
src/onnx/onnx_parser.cpp
+0
-5
src/simplify_reshapes.cpp
src/simplify_reshapes.cpp
+0
-1
No files found.
src/eliminate_contiguous.cpp
View file @
b088ac70
...
@@ -79,14 +79,15 @@ void eliminate_contiguous::apply(module& p) const
...
@@ -79,14 +79,15 @@ void eliminate_contiguous::apply(module& p) const
// Make a copy so we can modify it while we iterate
// Make a copy so we can modify it while we iterate
auto
args
=
ins
->
inputs
();
auto
args
=
ins
->
inputs
();
auto
new_args
=
args
;
auto
mod_args
=
ins
->
module_inputs
();
for
(
auto
arg
:
ins
->
inputs
())
for
(
auto
arg
:
ins
->
inputs
())
{
{
if
(
arg
->
name
()
==
op_name
)
if
(
arg
->
name
()
==
op_name
)
{
{
auto
new_args
=
args
;
auto
prev
=
arg
->
inputs
().
front
();
auto
prev
=
arg
->
inputs
().
front
();
replace
(
new_args
,
arg
,
prev
);
replace
(
new_args
,
arg
,
prev
);
if
(
try_compute_shape
(
ins
,
new_args
,
ins
->
module_inputs
()
))
if
(
try_compute_shape
(
ins
,
new_args
,
mod_args
))
{
{
instruction
::
replace_argument
(
ins
,
arg
,
prev
);
instruction
::
replace_argument
(
ins
,
arg
,
prev
);
}
}
...
...
src/onnx/onnx_parser.cpp
View file @
b088ac70
...
@@ -70,11 +70,6 @@ static literal from_repeated(shape::type_t t, const T& r)
...
@@ -70,11 +70,6 @@ static literal from_repeated(shape::type_t t, const T& r)
instruction_ref
onnx_parser
::
node_info
::
make_contiguous
(
instruction_ref
ins
)
const
instruction_ref
onnx_parser
::
node_info
::
make_contiguous
(
instruction_ref
ins
)
const
{
{
if
(
ins
->
get_shape
().
standard
())
{
return
ins
;
}
return
add_instruction
(
make_op
(
"contiguous"
),
ins
);
return
add_instruction
(
make_op
(
"contiguous"
),
ins
);
}
}
...
...
src/simplify_reshapes.cpp
View file @
b088ac70
...
@@ -26,7 +26,6 @@ const auto& reshaper_names()
...
@@ -26,7 +26,6 @@ const auto& reshaper_names()
static
const
std
::
unordered_set
<
std
::
string
>
names
=
{
static
const
std
::
unordered_set
<
std
::
string
>
names
=
{
"flatten"
,
"flatten"
,
"reshape"
,
"reshape"
,
"contiguous"
,
"squeeze"
,
"squeeze"
,
"unsqueeze"
"unsqueeze"
};
};
...
...
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