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
6f99b12f
Commit
6f99b12f
authored
Oct 29, 2018
by
Khalique
Browse files
formatting
parent
89dfaaff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+5
-4
No files found.
test/onnx/onnx_test.cpp
View file @
6f99b12f
...
@@ -104,12 +104,13 @@ void imagescaler_test()
...
@@ -104,12 +104,13 @@ void imagescaler_test()
{
{
migraph
::
program
p
;
migraph
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
16
,
16
}};
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
16
,
16
}};
auto
l0
=
p
.
add_parameter
(
"0"
,
s
);
auto
l0
=
p
.
add_parameter
(
"0"
,
s
);
auto
scale_val
=
p
.
add_literal
(
0.5
f
);
auto
scale_val
=
p
.
add_literal
(
0.5
f
);
auto
bias_vals
=
p
.
add_literal
(
migraph
::
literal
{
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
3
}},
{
0.01
,
0.02
,
0.03
}});
auto
bias_vals
=
p
.
add_literal
(
migraph
::
literal
{
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
3
}},
{
0.01
,
0.02
,
0.03
}});
auto
scaled_tensor
=
p
.
add_instruction
(
migraph
::
op
::
scalar
{
s
},
scale_val
);
auto
scaled_tensor
=
p
.
add_instruction
(
migraph
::
op
::
scalar
{
s
},
scale_val
);
auto
img_scaled
=
p
.
add_instruction
(
migraph
::
op
::
mul
{},
l0
,
scaled_tensor
);
auto
img_scaled
=
p
.
add_instruction
(
migraph
::
op
::
mul
{},
l0
,
scaled_tensor
);
auto
bias_bcast
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
1
,
s
},
bias_vals
);
auto
bias_bcast
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
1
,
s
},
bias_vals
);
p
.
add_instruction
(
migraph
::
op
::
add
{},
img_scaled
,
bias_bcast
);
p
.
add_instruction
(
migraph
::
op
::
add
{},
img_scaled
,
bias_bcast
);
auto
prog
=
migraph
::
parse_onnx
(
"imagescaler_test.onnx"
);
auto
prog
=
migraph
::
parse_onnx
(
"imagescaler_test.onnx"
);
...
...
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