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
a5f62830
"...resnet50_tensorflow.git" did not exist on "658a45f2633512fcf17c12a8ae075423fcc11625"
Commit
a5f62830
authored
Apr 02, 2019
by
Khalique
Browse files
formatting
parent
ab855464
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
src/tf/tf.cpp
src/tf/tf.cpp
+8
-4
test/tf/tf_test.cpp
test/tf/tf_test.cpp
+6
-2
No files found.
src/tf/tf.cpp
View file @
a5f62830
...
@@ -354,16 +354,20 @@ struct tf_parser
...
@@ -354,16 +354,20 @@ struct tf_parser
MIGRAPHX_THROW
(
"MIGraphX does not support mean outside of GlobalAvgPool transformation"
);
MIGRAPHX_THROW
(
"MIGraphX does not support mean outside of GlobalAvgPool transformation"
);
}
}
instruction_ref
instruction_ref
parse_pack
(
const
std
::
string
&
,
parse_pack
(
const
std
::
string
&
,
const
attribute_map
&
attributes
,
std
::
vector
<
instruction_ref
>
args
)
const
attribute_map
&
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
{
// reinterpret as unsqueeze with concat
// reinterpret as unsqueeze with concat
std
::
vector
<
instruction_ref
>
unsqueezed_args
;
std
::
vector
<
instruction_ref
>
unsqueezed_args
;
int64_t
axis
=
0
;
int64_t
axis
=
0
;
if
(
contains
(
attributes
,
"axis"
))
if
(
contains
(
attributes
,
"axis"
))
axis
=
attributes
.
at
(
"axis"
).
i
();
axis
=
attributes
.
at
(
"axis"
).
i
();
std
::
transform
(
args
.
begin
(),
args
.
end
(),
std
::
back_inserter
(
unsqueezed_args
),
std
::
transform
(
[
&
](
instruction_ref
arg
){
return
prog
.
add_instruction
(
op
::
unsqueeze
{{
axis
}},
arg
);
});
args
.
begin
(),
args
.
end
(),
std
::
back_inserter
(
unsqueezed_args
),
[
&
](
instruction_ref
arg
)
{
return
prog
.
add_instruction
(
op
::
unsqueeze
{{
axis
}},
arg
);
});
return
prog
.
add_instruction
(
op
::
concat
{
static_cast
<
size_t
>
(
axis
)},
unsqueezed_args
);
return
prog
.
add_instruction
(
op
::
concat
{
static_cast
<
size_t
>
(
axis
)},
unsqueezed_args
);
}
}
...
...
test/tf/tf_test.cpp
View file @
a5f62830
...
@@ -139,8 +139,12 @@ TEST_CASE(pack_test)
...
@@ -139,8 +139,12 @@ TEST_CASE(pack_test)
std
::
vector
<
migraphx
::
instruction_ref
>
unsqueezed_args
;
std
::
vector
<
migraphx
::
instruction_ref
>
unsqueezed_args
;
int64_t
axis
=
1
;
int64_t
axis
=
1
;
std
::
transform
(
args
.
begin
(),
args
.
end
(),
std
::
back_inserter
(
unsqueezed_args
),
std
::
transform
(
args
.
begin
(),
[
&
](
migraphx
::
instruction_ref
arg
)
{
return
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
axis
}},
arg
);
});
args
.
end
(),
std
::
back_inserter
(
unsqueezed_args
),
[
&
](
migraphx
::
instruction_ref
arg
)
{
return
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
axis
}},
arg
);
});
p
.
add_instruction
(
migraphx
::
op
::
concat
{
static_cast
<
size_t
>
(
axis
)},
unsqueezed_args
);
p
.
add_instruction
(
migraphx
::
op
::
concat
{
static_cast
<
size_t
>
(
axis
)},
unsqueezed_args
);
auto
prog
=
migraphx
::
parse_tf
(
"pack_test.pb"
,
false
);
auto
prog
=
migraphx
::
parse_tf
(
"pack_test.pb"
,
false
);
...
...
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