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
2d192cc9
Commit
2d192cc9
authored
Dec 08, 2022
by
charlie
Browse files
Formatting
parent
1decc5fc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
28 deletions
+28
-28
src/onnx/parse_pad.cpp
src/onnx/parse_pad.cpp
+1
-1
src/shape.cpp
src/shape.cpp
+3
-3
test/onnx/gen_onnx.py
test/onnx/gen_onnx.py
+5
-3
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+7
-5
test/op_shape_test.cpp
test/op_shape_test.cpp
+12
-16
No files found.
src/onnx/parse_pad.cpp
View file @
2d192cc9
src/shape.cpp
View file @
2d192cc9
test/onnx/gen_onnx.py
View file @
2d192cc9
...
...
@@ -4172,6 +4172,7 @@ def pad_reflect_multiaxis_test():
return
([
arg_pad
,
node
],
[
x
],
[
y
])
@
onnx_test
def
pad_attr_dyn_test
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
None
])
...
...
@@ -4184,6 +4185,7 @@ def pad_attr_dyn_test():
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
pad_cnst_dyn_test
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
None
])
...
...
@@ -4199,12 +4201,11 @@ def pad_cnst_dyn_test():
outputs
=
[
'arg_pad'
],
value
=
pad_tensor
)
node
=
onnx
.
helper
.
make_node
(
'Pad'
,
inputs
=
[
'0'
,
'arg_pad'
],
outputs
=
[
'1'
])
node
=
onnx
.
helper
.
make_node
(
'Pad'
,
inputs
=
[
'0'
,
'arg_pad'
],
outputs
=
[
'1'
])
return
([
arg_pad
,
node
],
[
x
],
[
y
])
@
onnx_test
def
pad_dyn_reflect_error
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
None
])
...
...
@@ -4218,6 +4219,7 @@ def pad_dyn_reflect_error():
return
([
node
],
[
x
],
[
y
])
@
onnx_test
def
pow_test
():
arg0
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
2
,
3
,
4
,
5
])
...
...
test/onnx/onnx_test.cpp
View file @
2d192cc9
...
...
@@ -4010,7 +4010,8 @@ TEST_CASE(pad_attr_dyn_test)
{
migraphx::program p;
auto* mm = p.get_main_module();
auto
x
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
2
,
4
,
2
},
{
2
,
4
,
2
}}});
auto x = mm->add_parameter(
"0", migraphx::shape{migraphx::shape::float_type, {{2, 4, 2}, {2, 4, 2}}});
auto ret = mm->add_instruction(migraphx::make_op("pad", {{"pads", {1, 1, 1, 1}}}), x);
mm->add_return({ret});
...
...
@@ -4024,7 +4025,8 @@ TEST_CASE(pad_cnst_dyn_test)
{
migraphx::program p;
auto* mm = p.get_main_module();
auto
x
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
2
,
4
,
2
},
{
2
,
4
,
2
}}});
auto x = mm->add_parameter(
"0", migraphx::shape{migraphx::shape::float_type, {{2, 4, 2}, {2, 4, 2}}});
mm->add_literal({migraphx::shape{migraphx::shape::int32_type, {4}}, {0, 2, 0, 1}});
auto ret = mm->add_instruction(migraphx::make_op("pad", {{"pads", {0, 2, 0, 1}}}), x);
mm->add_return({ret});
...
...
test/op_shape_test.cpp
View file @
2d192cc9
...
...
@@ -1667,36 +1667,32 @@ TEST_CASE(pad_shape0)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
3
,
3
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
5
,
5
}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}),
input
);
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}),
input
);
}
TEST_CASE
(
pad_shape1
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
3
,
3
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
6
,
6
}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
2
,
2
,
0
,
0
,
1
,
1
}}}),
input
);
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
2
,
2
,
0
,
0
,
1
,
1
}}}),
input
);
}
TEST_CASE
(
pad_dyn_shape0
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
3
,
0
},
{
3
,
3
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
5
,
5
,
0
},
{
5
,
5
,
0
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}
),
input
);
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
3
,
0
},
{
3
,
3
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
}
,
{
5
,
5
,
0
}
,
{
5
,
5
,
0
}}}
;
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}),
input
);
}
TEST_CASE
(
pad_dyn_shape1
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
5
,
5
},
{
3
,
5
,
5
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
5
,
7
,
7
},
{
5
,
7
,
7
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}
),
input
);
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
},
{
3
,
5
,
5
},
{
3
,
5
,
5
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
2
},
{
3
,
3
,
0
}
,
{
5
,
7
,
7
},
{
5
,
7
,
7
}}}
;
expect_shape
(
output
,
migraphx
::
make_op
(
"pad"
,
{{
"pads"
,
{
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
}}}),
input
);
}
TEST_CASE
(
pooling_shape0
)
...
...
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