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
cbd244d1
Commit
cbd244d1
authored
Jan 28, 2019
by
Khalique
Browse files
formatting
parent
5e59bf45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
27 deletions
+24
-27
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+23
-22
src/tf/tf.cpp
src/tf/tf.cpp
+1
-5
No files found.
src/include/migraphx/operators.hpp
View file @
cbd244d1
...
@@ -17,11 +17,11 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -17,11 +17,11 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
op
{
namespace
op
{
enum
padding_mode_t
enum
padding_mode_t
{
{
default_
,
// NOLINT
default_
,
// NOLINT
same
,
same
,
valid
valid
};
};
struct
not_computable
struct
not_computable
{
{
...
@@ -65,7 +65,7 @@ struct convolution
...
@@ -65,7 +65,7 @@ struct convolution
std
::
array
<
std
::
size_t
,
2
>
padding
=
{{
0
,
0
}};
std
::
array
<
std
::
size_t
,
2
>
padding
=
{{
0
,
0
}};
std
::
array
<
std
::
size_t
,
2
>
stride
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
stride
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
dilation
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
dilation
=
{{
1
,
1
}};
padding_mode_t
padding_mode
=
default_
;
padding_mode_t
padding_mode
=
default_
;
int
group
=
1
;
int
group
=
1
;
...
@@ -191,7 +191,7 @@ struct pooling
...
@@ -191,7 +191,7 @@ struct pooling
std
::
array
<
std
::
size_t
,
2
>
padding
=
{{
0
,
0
}};
std
::
array
<
std
::
size_t
,
2
>
padding
=
{{
0
,
0
}};
std
::
array
<
std
::
size_t
,
2
>
stride
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
stride
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
lengths
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
lengths
=
{{
1
,
1
}};
padding_mode_t
padding_mode
=
default_
;
padding_mode_t
padding_mode
=
default_
;
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
...
@@ -217,7 +217,8 @@ struct pooling
...
@@ -217,7 +217,8 @@ struct pooling
if
(
padding_mode
==
default_
)
if
(
padding_mode
==
default_
)
{
{
return
{
t
,
return
{
t
,
{
{
input
.
lens
()[
0
],
input
.
lens
()[
0
],
input
.
lens
()[
1
],
input
.
lens
()[
1
],
...
@@ -246,20 +247,20 @@ struct pooling
...
@@ -246,20 +247,20 @@ struct pooling
else
if
(
padding_mode
==
valid
)
else
if
(
padding_mode
==
valid
)
{
{
return
{
t
,
return
{
t
,
{
{
input
.
lens
()[
0
],
input
.
lens
()[
0
],
input
.
lens
()[
1
],
input
.
lens
()[
1
],
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
1
,
1
,
std
::
ptrdiff_t
(
std
::
floor
((
input
.
lens
()[
2
]
-
lengths
[
0
])
/
std
::
ptrdiff_t
(
std
::
floor
((
input
.
lens
()[
2
]
-
lengths
[
0
])
/
static_cast
<
float
>
(
stride
[
0
])))
+
static_cast
<
float
>
(
stride
[
0
])))
+
1
)),
1
)),
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
1
,
1
,
std
::
ptrdiff_t
(
std
::
floor
((
input
.
lens
()[
3
]
-
lengths
[
1
])
/
std
::
ptrdiff_t
(
std
::
floor
((
input
.
lens
()[
3
]
-
lengths
[
1
])
/
static_cast
<
float
>
(
stride
[
1
])))
+
static_cast
<
float
>
(
stride
[
1
])))
+
1
)),
1
)),
}};
}};
}
}
else
else
{
{
...
...
src/tf/tf.cpp
View file @
cbd244d1
...
@@ -206,14 +206,12 @@ struct tf_parser
...
@@ -206,14 +206,12 @@ struct tf_parser
{
{
op
.
stride
[
0
]
=
stride
[
1
];
op
.
stride
[
0
]
=
stride
[
1
];
op
.
stride
[
1
]
=
stride
[
2
];
op
.
stride
[
1
]
=
stride
[
2
];
}
}
else
else
{
{
op
.
stride
[
0
]
=
stride
[
2
];
op
.
stride
[
0
]
=
stride
[
2
];
op
.
stride
[
1
]
=
stride
[
3
];
op
.
stride
[
1
]
=
stride
[
3
];
}
}
}
}
if
(
contains
(
attributes
,
"dilations"
))
if
(
contains
(
attributes
,
"dilations"
))
{
{
...
@@ -233,7 +231,6 @@ struct tf_parser
...
@@ -233,7 +231,6 @@ struct tf_parser
op
.
dilation
[
0
]
=
dilation
[
2
];
op
.
dilation
[
0
]
=
dilation
[
2
];
op
.
dilation
[
1
]
=
dilation
[
3
];
op
.
dilation
[
1
]
=
dilation
[
3
];
}
}
}
}
auto
l0
=
prog
.
add_instruction
(
op
::
transpose
{{
2
,
3
,
0
,
1
}},
args
[
1
]);
auto
l0
=
prog
.
add_instruction
(
op
::
transpose
{{
2
,
3
,
0
,
1
}},
args
[
1
]);
...
@@ -276,7 +273,6 @@ struct tf_parser
...
@@ -276,7 +273,6 @@ struct tf_parser
op
.
stride
[
0
]
=
stride
[
2
];
op
.
stride
[
0
]
=
stride
[
2
];
op
.
stride
[
1
]
=
stride
[
3
];
op
.
stride
[
1
]
=
stride
[
3
];
}
}
}
}
if
(
contains
(
attributes
,
"ksize"
))
if
(
contains
(
attributes
,
"ksize"
))
{
{
...
...
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