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
0adcc72b
Commit
0adcc72b
authored
May 29, 2019
by
Khalique
Browse files
formatting
parent
eb032acb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
src/tf/tf.cpp
src/tf/tf.cpp
+9
-15
No files found.
src/tf/tf.cpp
View file @
0adcc72b
...
...
@@ -326,10 +326,8 @@ struct tf_parser
if
(
pad_mode
.
find
(
"SAME"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
same
;
op
.
padding
[
0
]
=
op
::
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
op
.
padding
[
0
]
=
op
::
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
...
...
@@ -362,7 +360,7 @@ struct tf_parser
op
::
convolution
op
;
size_t
num_channels
=
args
[
0
]
->
get_shape
().
lens
()[
1
];
op
.
group
=
num_channels
;
if
(
contains
(
attributes
,
"strides"
))
{
std
::
vector
<
size_t
>
stride
;
...
...
@@ -401,20 +399,18 @@ struct tf_parser
weights
=
prog
.
add_instruction
(
op
::
transpose
{{
3
,
2
,
0
,
1
}},
args
[
1
]);
}
}
if
(
contains
(
attributes
,
"padding"
))
{
const
std
::
string
&
pad_mode
=
attributes
.
at
(
"padding"
).
s
();
const
std
::
string
&
pad_mode
=
attributes
.
at
(
"padding"
).
s
();
std
::
vector
<
size_t
>
weight_dims
=
weights
->
get_shape
().
lens
();
size_t
weight_h
=
weight_dims
[
2
];
size_t
weight_w
=
weight_dims
[
3
];
if
(
pad_mode
.
find
(
"SAME"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
same
;
op
.
padding
[
0
]
=
op
::
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
op
.
padding
[
0
]
=
op
::
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
...
...
@@ -577,10 +573,8 @@ struct tf_parser
if
(
pad_mode
.
find
(
"SAME"
)
!=
std
::
string
::
npos
)
{
op
.
padding_mode
=
op
::
padding_mode_t
::
same
;
op
.
padding
[
0
]
=
op
::
calculate_padding
(
op
.
lengths
[
0
],
0
);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
op
.
lengths
[
1
],
0
);
op
.
padding
[
0
]
=
op
::
calculate_padding
(
op
.
lengths
[
0
],
0
);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
op
.
lengths
[
1
],
0
);
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
...
...
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