Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
88dac3b8
Commit
88dac3b8
authored
Jun 04, 2019
by
Khalique
Browse files
move header file
parent
af241716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
src/include/migraphx/pad_calc.hpp
src/include/migraphx/pad_calc.hpp
+0
-2
src/tf/tf.cpp
src/tf/tf.cpp
+7
-7
No files found.
src/include/migraphx/
op/
pad_calc.hpp
→
src/include/migraphx/pad_calc.hpp
View file @
88dac3b8
...
...
@@ -5,14 +5,12 @@
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
op
{
inline
size_t
calculate_padding
(
size_t
weight_dim
,
size_t
dilation
)
{
return
(
dilation
*
(
weight_dim
-
1
))
/
2
;
}
}
// namespace op
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
...
...
src/tf/tf.cpp
View file @
88dac3b8
...
...
@@ -17,7 +17,7 @@
#include <migraphx/instruction.hpp>
#include <migraphx/config.hpp>
#include <migraphx/tf.hpp>
#include <migraphx/
op/
pad_calc.hpp>
#include <migraphx/pad_calc.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
...
...
@@ -326,8 +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
]
=
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
...
...
@@ -409,8 +409,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
]
=
calculate_padding
(
weight_h
,
op
.
dilation
[
0
]);
op
.
padding
[
1
]
=
calculate_padding
(
weight_w
,
op
.
dilation
[
1
]);
}
else
if
(
pad_mode
.
find
(
"VALID"
)
!=
std
::
string
::
npos
)
{
...
...
@@ -573,8 +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
],
1
);
op
.
padding
[
1
]
=
op
::
calculate_padding
(
op
.
lengths
[
1
],
1
);
op
.
padding
[
0
]
=
calculate_padding
(
op
.
lengths
[
0
],
1
);
op
.
padding
[
1
]
=
calculate_padding
(
op
.
lengths
[
1
],
1
);
}
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