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
a24048bd
Commit
a24048bd
authored
Nov 10, 2023
by
Brian Pickrell
Browse files
work in progress. Need to support Upsample instruction
parent
35919b44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/onnx/parse_resize.cpp
src/onnx/parse_resize.cpp
+8
-4
No files found.
src/onnx/parse_resize.cpp
View file @
a24048bd
...
@@ -183,7 +183,9 @@ static std::string get_nearest_mode(const onnx_parser::attribute_map& attr)
...
@@ -183,7 +183,9 @@ static std::string get_nearest_mode(const onnx_parser::attribute_map& attr)
struct
parse_resize
:
op_parser
<
parse_resize
>
struct
parse_resize
:
op_parser
<
parse_resize
>
{
{
std
::
vector
<
op_desc
>
operators
()
const
{
return
{{
"Resize"
},
{
"Upsample"
}};
}
std
::
vector
<
op_desc
>
operators
()
const
{
return
{{
"Resize"
},
{
"Upsample"
}};
}
// A helper for one case of parse().
// A helper for one case of parse().
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
...
@@ -320,9 +322,9 @@ struct parse_resize : op_parser<parse_resize>
...
@@ -320,9 +322,9 @@ struct parse_resize : op_parser<parse_resize>
": no dynamic input shapes allowed except the first one"
);
": no dynamic input shapes allowed except the first one"
);
}
}
// skip first input and any empty inputs
// skip first input
(if dynamic)
and any empty inputs
auto
lens
=
arg
->
get_shape
().
to_static
(
1
).
lens
();
auto
lens
=
arg
->
get_shape
().
to_static
(
1
).
lens
();
if
(
arg
->
name
()
==
"undefined"
or
arg
==
args
.
front
(
)
or
lens
.
empty
())
if
(
arg
->
name
()
==
"undefined"
or
(
arg
==
args
[
0
]
and
arg
->
get_shape
().
dynamic
()
)
or
lens
.
empty
())
{
{
continue
;
continue
;
}
}
...
@@ -379,7 +381,9 @@ struct parse_resize : op_parser<parse_resize>
...
@@ -379,7 +381,9 @@ struct parse_resize : op_parser<parse_resize>
});
});
break
;
break
;
}
}
}
}
if
(
out_lens
.
size
()
==
0
)
MIGRAPHX_THROW
(
"PARSE_"
+
opd
.
op_name
+
": no input was given for scale or output size"
);
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
// dimension--batch size--can be non-fixed, and the only resize mode allowed is "nearest"
// dimension--batch size--can be non-fixed, and the only resize mode allowed is "nearest"
...
...
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