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
660336a7
Commit
660336a7
authored
Dec 07, 2022
by
Brian Pickrell
Browse files
Update onnx reducel1_dyn_test for no-axis default
parent
59bbd918
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
test/onnx/gen_onnx.py
test/onnx/gen_onnx.py
+1
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+4
-3
No files found.
test/onnx/gen_onnx.py
View file @
660336a7
...
@@ -4651,6 +4651,7 @@ def reducel1_dyn_test():
...
@@ -4651,6 +4651,7 @@ def reducel1_dyn_test():
return
([
node
],
[
x
],
[
y
])
return
([
node
],
[
x
],
[
y
])
@
onnx_test
@
onnx_test
def
reducel1_dyn_noaxes_test
():
def
reducel1_dyn_noaxes_test
():
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
None
])
x
=
helper
.
make_tensor_value_info
(
'x'
,
TensorProto
.
FLOAT
,
[
None
])
...
...
test/onnx/onnx_test.cpp
View file @
660336a7
...
@@ -4466,14 +4466,15 @@ TEST_CASE(reducel1_dyn_test)
...
@@ -4466,14 +4466,15 @@ TEST_CASE(reducel1_dyn_test)
{
{
migraphx::program p;
migraphx::program p;
auto* mm = p.get_main_module();
auto* mm = p.get_main_module();
//
a shape with 4 dynamic dimensions
//
No axes given in the onnx file. Parser should default to all axes.
auto l0 = mm->add_parameter("x",
auto l0 = mm->add_parameter("x",
migraphx::shape{migraphx::shape::float_type,
migraphx::shape{migraphx::shape::float_type,
{{3, 3, 0}, {3, 5, 0}, {4, 6, 5}, {5, 7, 6}}});
{{3, 3, 0}, {3, 5, 0}, {4, 6, 5}, {5, 7, 6}}});
auto abs_ins = mm->add_instruction(migraphx::make_op("abs"), l0);
auto abs_ins = mm->add_instruction(migraphx::make_op("abs"), l0);
auto sum_ins =
auto sum_ins =
mm
->
add_instruction
(
migraphx
::
make_op
(
"reduce_sum"
,
{{
"axes"
,
{}}}),
abs_ins
);
mm->add_instruction(migraphx::make_op("reduce_sum", {{"axes", {0, 1, 2, 3}}}), abs_ins);
auto
sq_ins
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{}}}),
sum_ins
);
auto sq_ins =
mm->add_instruction(migraphx::make_op("squeeze", {{"axes", {0, 1, 2, 3}}}), sum_ins);
mm->add_return({sq_ins});
mm->add_return({sq_ins});
migraphx::onnx_options options;
migraphx::onnx_options options;
...
...
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