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
Commit
3a3ae8b5
authored
Aug 02, 2018
by
Scott Thornton
Browse files
converted previous spatial bool to enum type in ONNX
parent
e76bd729
Changes
2
Show 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
...
@@ -22,8 +22,6 @@ struct batch_norm_inference
{
{
float
epsilon
=
1.0e-6
f
;
float
epsilon
=
1.0e-6
f
;
float
momentum
=
0.9
f
;
float
momentum
=
0.9
f
;
bool
spatial
=
true
;
bool
is_test
=
false
;
std
::
string
name
()
const
{
return
"batch_norm_inference"
;
}
std
::
string
name
()
const
{
return
"batch_norm_inference"
;
}
...
@@ -35,6 +33,8 @@ struct batch_norm_inference
...
@@ -35,6 +33,8 @@ struct batch_norm_inference
bn_infer_mode_t
bn_mode
=
spatial
;
bn_infer_mode_t
bn_mode
=
spatial
;
bool
is_test
=
false
;
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
check_shapes
{
inputs
,
*
this
}.
has
(
5
);
check_shapes
{
inputs
,
*
this
}.
has
(
5
);
...
...
src/onnx/onnx.cpp
View file @
3a3ae8b5
...
@@ -173,7 +173,7 @@ struct onnx_parser
...
@@ -173,7 +173,7 @@ struct onnx_parser
{
{
float
epsilon
=
1e-5
f
;
float
epsilon
=
1e-5
f
;
float
momentum
=
0.9
f
;
float
momentum
=
0.9
f
;
b
ool
spatial
=
true
;
b
atch_norm_inference
::
bn_infer_mode_t
bn_mode
=
batch_norm_inference
::
spatial
;
bool
is_test
=
false
;
bool
is_test
=
false
;
if
(
contains
(
attributes
,
"epsilon"
))
if
(
contains
(
attributes
,
"epsilon"
))
{
{
...
@@ -189,9 +189,11 @@ struct onnx_parser
...
@@ -189,9 +189,11 @@ struct onnx_parser
}
}
if
(
contains
(
attributes
,
"spatial"
))
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
);
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