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
b9c81e2d
Commit
b9c81e2d
authored
Feb 20, 2019
by
Khalique
Browse files
fix logic for conv weights
parent
8a4f5778
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/tf/tf.cpp
src/tf/tf.cpp
+13
-7
No files found.
src/tf/tf.cpp
View file @
b9c81e2d
...
@@ -300,16 +300,22 @@ struct tf_parser
...
@@ -300,16 +300,22 @@ 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
=
args
[
1
];
auto
weights
=
args
[
1
];
// check if weights are from a constant
// check if weights are from a constant
if
(
l0
->
inputs
().
at
(
0
)
->
name
()
==
"@literal"
and
is_nhwc
)
if
(
weights
->
name
()
!=
"@param"
)
{
if
(
is_nhwc
)
{
{
l0
=
prog
.
add_instruction
(
op
::
transpose
{{
1
,
3
,
0
,
2
}},
args
[
1
]);
weights
=
prog
.
add_instruction
(
op
::
transpose
{{
1
,
3
,
0
,
2
}},
args
[
1
]);
}
else
{
weights
=
prog
.
add_instruction
(
op
::
transpose
{{
3
,
2
,
0
,
1
}},
args
[
1
]);
}
}
}
else
if
(
l0
->
name
()
!=
"@param"
)
MIGRAPHX_THROW
(
"cannot infer data format for weights"
);
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
l0
});
return
prog
.
add_instruction
(
op
,
{
args
[
0
],
weights
});
}
}
instruction_ref
parse_pooling
(
const
std
::
string
&
name
,
instruction_ref
parse_pooling
(
const
std
::
string
&
name
,
...
...
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