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
38f0d386
"src/vscode:/vscode.git/clone" did not exist on "806afeb6f4e1ee28086f46826c618e359849959a"
Commit
38f0d386
authored
Jun 22, 2022
by
charlie
Browse files
formatting
parent
2dff4dd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
src/onnx/parse_convolution.cpp
src/onnx/parse_convolution.cpp
+6
-6
test/onnx/gen_onnx.py
test/onnx/gen_onnx.py
+3
-1
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+6
-4
No files found.
src/onnx/parse_convolution.cpp
View file @
38f0d386
...
@@ -24,12 +24,12 @@ struct parse_convolution : op_parser<parse_convolution>
...
@@ -24,12 +24,12 @@ struct parse_convolution : op_parser<parse_convolution>
onnx_parser
::
node_info
info
,
onnx_parser
::
node_info
info
,
std
::
vector
<
instruction_ref
>
args
)
const
std
::
vector
<
instruction_ref
>
args
)
const
{
{
auto
op
=
make_op
(
opd
.
op_name
);
auto
op
=
make_op
(
opd
.
op_name
);
auto
values
=
op
.
to_value
();
auto
values
=
op
.
to_value
();
auto
l0
=
args
[
0
];
auto
l0
=
args
[
0
];
auto
weights
=
args
[
1
];
auto
weights
=
args
[
1
];
auto
l0_shape
=
l0
->
get_shape
();
auto
l0_shape
=
l0
->
get_shape
();
auto
in_lens
=
l0_shape
.
max_lens
();
auto
in_lens
=
l0_shape
.
max_lens
();
assert
(
in_lens
.
size
()
>
2
);
assert
(
in_lens
.
size
()
>
2
);
auto
kdims
=
in_lens
.
size
()
-
2
;
auto
kdims
=
in_lens
.
size
()
-
2
;
...
...
test/onnx/gen_onnx.py
View file @
38f0d386
...
@@ -827,6 +827,7 @@ def conv_bn_relu_maxpool_test():
...
@@ -827,6 +827,7 @@ def conv_bn_relu_maxpool_test():
return
([
node0
,
node1
,
node2
,
node3
],
[
x
,
y
,
z
,
m
,
n
,
k
,
l
],
[
out
])
return
([
node0
,
node1
,
node2
,
node3
],
[
x
,
y
,
z
,
m
,
n
,
k
,
l
],
[
out
])
@
onnx_test
@
onnx_test
def
conv_dynamic_batch_test
():
def
conv_dynamic_batch_test
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
5
,
5
])
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
None
,
3
,
5
,
5
])
...
@@ -840,7 +841,8 @@ def conv_dynamic_batch_test():
...
@@ -840,7 +841,8 @@ def conv_dynamic_batch_test():
@
onnx_test
@
onnx_test
def
conv_dynamic_img_test
():
def
conv_dynamic_img_test
():
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
1
,
3
,
None
,
None
])
x
=
helper
.
make_tensor_value_info
(
'0'
,
TensorProto
.
FLOAT
,
[
1
,
3
,
None
,
None
])
y
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
1
,
3
,
3
,
3
])
y
=
helper
.
make_tensor_value_info
(
'1'
,
TensorProto
.
FLOAT
,
[
1
,
3
,
3
,
3
])
out
=
helper
.
make_tensor_value_info
(
'2'
,
TensorProto
.
FLOAT
,
out
=
helper
.
make_tensor_value_info
(
'2'
,
TensorProto
.
FLOAT
,
[
1
,
1
,
None
,
None
])
[
1
,
1
,
None
,
None
])
...
...
test/onnx/onnx_test.cpp
View file @
38f0d386
...
@@ -777,8 +777,9 @@ TEST_CASE(conv_dynamic_batch_test)
...
@@ -777,8 +777,9 @@ TEST_CASE(conv_dynamic_batch_test)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
6
,
0
},
{
3
,
3
,
0
},
{
5
,
5
,
0
},
{
5
,
5
,
0
}}});
auto
l0
=
mm
->
add_parameter
(
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
"0"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
6
,
0
},
{
3
,
3
,
0
},
{
5
,
5
,
0
},
{
5
,
5
,
0
}}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
auto
c0
=
mm
->
add_instruction
(
auto
c0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
...
@@ -797,8 +798,9 @@ TEST_CASE(conv_dynamic_img_test)
...
@@ -797,8 +798,9 @@ TEST_CASE(conv_dynamic_img_test)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
1
,
0
},
{
3
,
3
,
0
},
{
5
,
10
,
0
},
{
5
,
10
,
0
}}});
auto
l0
=
mm
->
add_parameter
(
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
"0"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
1
,
0
},
{
3
,
3
,
0
},
{
5
,
10
,
0
},
{
5
,
10
,
0
}}});
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
auto
c0
=
mm
->
add_instruction
(
auto
c0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
...
...
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