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
d1efd555
Commit
d1efd555
authored
Feb 11, 2019
by
Khalique
Browse files
fix cppcheck issues
parent
5303ec34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/tf/tf.cpp
src/tf/tf.cpp
+6
-7
No files found.
src/tf/tf.cpp
View file @
d1efd555
...
@@ -44,6 +44,7 @@ struct tf_parser
...
@@ -44,6 +44,7 @@ struct tf_parser
case
1
:
dim
=
2
;
break
;
case
1
:
dim
=
2
;
break
;
case
2
:
dim
=
3
;
break
;
case
2
:
dim
=
3
;
break
;
case
3
:
dim
=
1
;
break
;
case
3
:
dim
=
1
;
break
;
default:
break
;
}
}
}
}
...
@@ -173,7 +174,7 @@ struct tf_parser
...
@@ -173,7 +174,7 @@ struct tf_parser
}
}
instruction_ref
instruction_ref
parse_biasadd
(
const
std
::
string
&
,
attribute_map
,
std
::
vector
<
instruction_ref
>
args
)
parse_biasadd
(
const
std
::
string
&
,
const
attribute_map
&
,
std
::
vector
<
instruction_ref
>
args
)
{
{
uint64_t
axis
=
1
;
uint64_t
axis
=
1
;
auto
l0
=
prog
.
add_instruction
(
op
::
broadcast
{
axis
,
args
[
0
]
->
get_shape
()},
args
[
1
]);
auto
l0
=
prog
.
add_instruction
(
op
::
broadcast
{
axis
,
args
[
0
]
->
get_shape
()},
args
[
1
]);
...
@@ -345,7 +346,7 @@ struct tf_parser
...
@@ -345,7 +346,7 @@ struct tf_parser
}
}
instruction_ref
instruction_ref
parse_reshape
(
const
std
::
string
&
,
attribute_map
,
std
::
vector
<
instruction_ref
>
args
)
parse_reshape
(
const
std
::
string
&
,
const
attribute_map
&
,
std
::
vector
<
instruction_ref
>
args
)
{
{
op
::
reshape
op
;
op
::
reshape
op
;
if
(
args
.
size
()
!=
2
)
if
(
args
.
size
()
!=
2
)
...
@@ -550,7 +551,7 @@ struct tf_parser
...
@@ -550,7 +551,7 @@ struct tf_parser
return
shape_type
;
return
shape_type
;
}
}
static
literal
parse_tensor
(
const
tensorflow
::
TensorProto
t
)
static
literal
parse_tensor
(
const
tensorflow
::
TensorProto
&
t
)
{
{
std
::
vector
<
size_t
>
dims
=
parse_dims
(
t
.
tensor_shape
());
std
::
vector
<
size_t
>
dims
=
parse_dims
(
t
.
tensor_shape
());
if
(
dims
.
empty
())
if
(
dims
.
empty
())
...
@@ -694,10 +695,8 @@ struct tf_parser
...
@@ -694,10 +695,8 @@ struct tf_parser
{
{
std
::
vector
<
size_t
>
dims
;
std
::
vector
<
size_t
>
dims
;
auto
input_dims
=
s
.
dim
();
auto
input_dims
=
s
.
dim
();
for
(
auto
dim
:
input_dims
)
std
::
transform
(
input_dims
.
begin
(),
input_dims
.
end
(),
std
::
back_inserter
(
dims
),
{
[](
tensorflow
::
TensorShapeProto_Dim
dim
)
{
return
dim
.
size
();
});
dims
.
push_back
(
dim
.
size
());
}
return
dims
;
return
dims
;
}
}
};
};
...
...
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