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
cc09f36e
Commit
cc09f36e
authored
May 01, 2019
by
Khalique
Browse files
formatting
parent
94cba9e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/tf/tf.cpp
src/tf/tf.cpp
+8
-7
No files found.
src/tf/tf.cpp
View file @
cc09f36e
...
@@ -340,12 +340,13 @@ struct tf_parser
...
@@ -340,12 +340,13 @@ struct tf_parser
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
weights
});
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
weights
});
}
}
instruction_ref
instruction_ref
parse_depthwiseconv
(
const
std
::
string
&
,
parse_depthwiseconv
(
const
std
::
string
&
,
attribute_map
attributes
,
std
::
vector
<
instruction_ref
>
args
)
attribute_map
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
{
op
::
convolution
op
;
op
::
convolution
op
;
size_t
num_channels
=
args
[
0
]
->
get_shape
().
lens
()[
1
];
size_t
num_channels
=
args
[
0
]
->
get_shape
().
lens
()[
1
];
op
.
group
=
num_channels
;
op
.
group
=
num_channels
;
if
(
contains
(
attributes
,
"padding"
))
if
(
contains
(
attributes
,
"padding"
))
{
{
const
std
::
string
&
pad_mode
=
attributes
.
at
(
"padding"
).
s
();
const
std
::
string
&
pad_mode
=
attributes
.
at
(
"padding"
).
s
();
...
@@ -378,16 +379,16 @@ struct tf_parser
...
@@ -378,16 +379,16 @@ struct tf_parser
else
else
{
{
weights
=
prog
.
add_instruction
(
op
::
transpose
{{
3
,
2
,
0
,
1
}},
args
[
1
]);
weights
=
prog
.
add_instruction
(
op
::
transpose
{{
3
,
2
,
0
,
1
}},
args
[
1
]);
}
}
}
}
std
::
vector
<
int64_t
>
new_weights_shape
;
std
::
vector
<
int64_t
>
new_weights_shape
;
copy
(
weights
->
get_shape
().
lens
(),
std
::
back_inserter
(
new_weights_shape
));
copy
(
weights
->
get_shape
().
lens
(),
std
::
back_inserter
(
new_weights_shape
));
int64_t
multiplier
=
new_weights_shape
[
0
];
int64_t
multiplier
=
new_weights_shape
[
0
];
int64_t
out_channels
=
num_channels
*
multiplier
;
int64_t
out_channels
=
num_channels
*
multiplier
;
new_weights_shape
[
0
]
=
out_channels
;
new_weights_shape
[
0
]
=
out_channels
;
new_weights_shape
[
1
]
=
1
;
new_weights_shape
[
1
]
=
1
;
auto
new_weights
=
prog
.
add_instruction
(
op
::
reshape
{
new_weights_shape
},
weights
);
auto
new_weights
=
prog
.
add_instruction
(
op
::
reshape
{
new_weights_shape
},
weights
);
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
new_weights
});
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
new_weights
});
}
}
...
...
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