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
3a3ae8b5
"vscode:/vscode.git/clone" did not exist on "abd4214b568e843fcf6001ce2013c0d73119db0f"
Commit
3a3ae8b5
authored
Aug 02, 2018
by
Scott Thornton
Browse files
converted previous spatial bool to enum type in ONNX
parent
e76bd729
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/include/migraph/operators.hpp
src/include/migraph/operators.hpp
+2
-2
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+8
-6
No files found.
src/include/migraph/operators.hpp
View file @
3a3ae8b5
...
...
@@ -22,8 +22,6 @@ struct batch_norm_inference
{
float
epsilon
=
1.0e-6
f
;
float
momentum
=
0.9
f
;
bool
spatial
=
true
;
bool
is_test
=
false
;
std
::
string
name
()
const
{
return
"batch_norm_inference"
;
}
...
...
@@ -35,6 +33,8 @@ struct batch_norm_inference
bn_infer_mode_t
bn_mode
=
spatial
;
bool
is_test
=
false
;
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
5
);
...
...
src/onnx/onnx.cpp
View file @
3a3ae8b5
...
...
@@ -171,10 +171,10 @@ struct onnx_parser
instruction_ref
parse_batchnorm
(
std
::
string
,
attribute_map
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
float
epsilon
=
1e-5
f
;
float
momentum
=
0.9
f
;
b
ool
spatial
=
true
;
bool
is_test
=
false
;
float
epsilon
=
1e-5
f
;
float
momentum
=
0.9
f
;
b
atch_norm_inference
::
bn_infer_mode_t
bn_mode
=
batch_norm_inference
::
spatial
;
bool
is_test
=
false
;
if
(
contains
(
attributes
,
"epsilon"
))
{
epsilon
=
parse_value
(
attributes
.
at
(
"epsilon"
)).
at
<
float
>
();
...
...
@@ -189,9 +189,11 @@ struct onnx_parser
}
if
(
contains
(
attributes
,
"spatial"
))
{
spatial
=
(
parse_value
(
attributes
.
at
(
"spatial"
)).
at
<
uint64_t
>
()
>
0
)
?
true
:
false
;
bn_mode
=
(
parse_value
(
attributes
.
at
(
"spatial"
)).
at
<
uint64_t
>
()
>
0
)
?
batch_norm_inference
::
spatial
:
batch_norm_inference
::
per_activation
;
}
batch_norm_inference
op
{
epsilon
,
momentum
,
spatial
,
is_test
};
batch_norm_inference
op
{
epsilon
,
momentum
,
bn_mode
,
is_test
};
return
prog
.
add_instruction
(
op
,
args
);
}
...
...
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