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
badacbcc
Commit
badacbcc
authored
Jul 18, 2019
by
Shucai Xiao
Browse files
fix a cppcheck error
parent
d7c1f9b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+8
-2
No files found.
src/onnx/onnx.cpp
View file @
badacbcc
...
@@ -931,7 +931,7 @@ struct onnx_parser
...
@@ -931,7 +931,7 @@ struct onnx_parser
if
(
args
.
empty
())
if
(
args
.
empty
())
{
{
MIGRAPHX_THROW
(
"
Parse
ConstantOfShape : must have 1 input!"
);
MIGRAPHX_THROW
(
"ConstantOfShape : must have 1 input!"
);
}
}
else
else
{
{
...
@@ -951,9 +951,15 @@ struct onnx_parser
...
@@ -951,9 +951,15 @@ struct onnx_parser
s
=
migraphx
::
shape
{
type
,
dims
};
s
=
migraphx
::
shape
{
type
,
dims
};
}
}
literal
l_out
;
literal
l_out
{}
;
l_val
.
visit
([
&
](
auto
val
)
{
l_val
.
visit
([
&
](
auto
val
)
{
// this #ifdef is to avoid a false cppcheck error, will remove later
// when a newer version of cppcheck is used
#ifdef CPPCHECK
using
type
=
float
;
#else
using
type
=
std
::
remove_cv_t
<
typename
decltype
(
val
)
::
value_type
>
;
using
type
=
std
::
remove_cv_t
<
typename
decltype
(
val
)
::
value_type
>
;
#endif
// l_val contains only one element
// l_val contains only one element
std
::
vector
<
type
>
out_vec
(
s
.
elements
(),
*
val
.
begin
());
std
::
vector
<
type
>
out_vec
(
s
.
elements
(),
*
val
.
begin
());
l_out
=
literal
(
s
,
out_vec
);
l_out
=
literal
(
s
,
out_vec
);
...
...
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