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
44774583
"docs/vscode:/vscode.git/clone" did not exist on "524535b5f20b2c0987549580ded8706f905a4d37"
Commit
44774583
authored
Jan 16, 2019
by
Khalique
Browse files
formatting
parent
ad25a036
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+2
-2
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+5
-6
No files found.
src/include/migraphx/operators.hpp
View file @
44774583
...
@@ -611,7 +611,7 @@ struct reshape
...
@@ -611,7 +611,7 @@ struct reshape
struct
pad
struct
pad
{
{
std
::
vector
<
int64_t
>
pads
;
std
::
vector
<
int64_t
>
pads
;
float
value
=
0.0
f
;
float
value
=
0.0
f
;
std
::
string
mode
=
"constant"
;
std
::
string
mode
=
"constant"
;
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
...
@@ -632,7 +632,7 @@ struct pad
...
@@ -632,7 +632,7 @@ struct pad
{
{
rdims
[
i
]
+=
pads
[
i
]
+
pads
[
i
+
num_dims
];
rdims
[
i
]
+=
pads
[
i
]
+
pads
[
i
+
num_dims
];
}
}
shape
s
{
inputs
.
front
().
type
(),
rdims
};
shape
s
{
inputs
.
front
().
type
(),
rdims
};
return
s
;
return
s
;
}
}
...
...
src/targets/cpu/lowering.cpp
View file @
44774583
...
@@ -306,16 +306,15 @@ struct cpu_pad
...
@@ -306,16 +306,15 @@ struct cpu_pad
{
{
assert
(
output_shape
.
standard
());
assert
(
output_shape
.
standard
());
argument
result
{
output_shape
};
argument
result
{
output_shape
};
result
.
visit
([
&
](
auto
output
)
{
result
.
visit
([
&
](
auto
output
)
{
std
::
fill
(
output
.
begin
(),
output
.
end
(),
op
.
value
);
});
std
::
fill
(
output
.
begin
(),
output
.
end
(),
op
.
value
);
});
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
input
)
{
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
input
)
{
shape_for_each
(
output
.
get_shape
(),
[
&
](
const
auto
&
idx
)
{
shape_for_each
(
output
.
get_shape
(),
[
&
](
const
auto
&
idx
)
{
std
::
vector
<
std
::
size_t
>
new_idx
(
idx
.
size
());
std
::
vector
<
std
::
size_t
>
new_idx
(
idx
.
size
());
std
::
transform
(
idx
.
begin
(),
idx
.
end
(),
op
.
pads
.
begin
(),
new_idx
.
begin
(),
[](
auto
i
,
auto
j
)
{
std
::
transform
(
return
i
+
j
;
idx
.
begin
(),
idx
.
end
(),
op
.
pads
.
begin
(),
new_idx
.
begin
(),
[](
auto
i
,
auto
j
)
{
});
return
i
+
j
;
});
output
(
new_idx
.
begin
(),
new_idx
.
end
())
=
input
(
idx
.
begin
(),
idx
.
end
());
output
(
new_idx
.
begin
(),
new_idx
.
end
())
=
input
(
idx
.
begin
(),
idx
.
end
());
});
});
});
});
...
...
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