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
69e4955e
Commit
69e4955e
authored
Jun 16, 2022
by
charlie
Browse files
Formatting
parent
abf62c5d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
src/onnx/include/migraphx/onnx/onnx_parser.hpp
src/onnx/include/migraphx/onnx/onnx_parser.hpp
+1
-1
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+4
-4
src/onnx/onnx_parser.cpp
src/onnx/onnx_parser.cpp
+9
-13
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+6
-2
No files found.
src/onnx/include/migraphx/onnx/onnx_parser.hpp
View file @
69e4955e
src/onnx/onnx.cpp
View file @
69e4955e
...
@@ -21,7 +21,7 @@ program parse_onnx_from(const onnx_options& options, Ts&&... xs)
...
@@ -21,7 +21,7 @@ program parse_onnx_from(const onnx_options& options, Ts&&... xs)
parser
.
map_input_dims
=
options
.
map_input_dims
;
parser
.
map_input_dims
=
options
.
map_input_dims
;
parser
.
map_dyn_input_dims
=
options
.
map_dyn_input_dims
;
parser
.
map_dyn_input_dims
=
options
.
map_dyn_input_dims
;
auto
dim_val
=
options
.
default_dim_value
;
auto
dim_val
=
options
.
default_dim_value
;
if
(
dim_val
!=
0
)
if
(
dim_val
!=
0
)
{
{
parser
.
default_dyn_dim_value
=
{
dim_val
,
dim_val
,
0
};
parser
.
default_dyn_dim_value
=
{
dim_val
,
dim_val
,
0
};
}
}
...
...
src/onnx/onnx_parser.cpp
View file @
69e4955e
...
@@ -452,17 +452,13 @@ shape onnx_parser::parse_type(const onnx::TypeProto& t,
...
@@ -452,17 +452,13 @@ shape onnx_parser::parse_type(const onnx::TypeProto& t,
{
{
return
{
shape_type
};
return
{
shape_type
};
}
}
if
(
std
::
all_of
(
dynamic_dims
.
begin
(),
dynamic_dims
.
end
(),
[](
auto
dd
)
{
return
dd
.
is_fixed
();
}))
if
(
std
::
all_of
(
dynamic_dims
.
begin
(),
dynamic_dims
.
end
(),
[](
auto
dd
)
{
return
dd
.
is_fixed
();
}))
{
{
std
::
vector
<
std
::
size_t
>
dims
;
std
::
vector
<
std
::
size_t
>
dims
;
std
::
transform
(
std
::
transform
(
dynamic_dims
.
begin
(),
dynamic_dims
.
begin
(),
dynamic_dims
.
end
(),
dynamic_dims
.
end
(),
std
::
back_inserter
(
dims
),
std
::
back_inserter
(
dims
),
[](
auto
d
)
{
[](
auto
d
)
{
return
d
.
max
;
});
return
d
.
max
;
}
);
return
{
shape_type
,
dims
};
return
{
shape_type
,
dims
};
}
}
return
{
shape_type
,
dynamic_dims
};
return
{
shape_type
,
dynamic_dims
};
...
...
test/onnx/onnx_test.cpp
View file @
69e4955e
...
@@ -5431,7 +5431,9 @@ TEST_CASE(variable_batch_user_input_test2)
...
@@ -5431,7 +5431,9 @@ TEST_CASE(variable_batch_user_input_test2)
{
{
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
{
migraphx
::
shape
::
float_type
,
{{
2
,
5
,
0
},
{
3
,
3
,
0
},
{
16
,
16
,
0
},
{
16
,
16
,
0
}}});
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
2
,
5
,
0
},
{
3
,
3
,
0
},
{
16
,
16
,
0
},
{
16
,
16
,
0
}}});
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"identity"
),
l0
);
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"identity"
),
l0
);
mm
->
add_return
({
r
});
mm
->
add_return
({
r
});
...
@@ -5447,7 +5449,9 @@ TEST_CASE(variable_batch_user_input_test3)
...
@@ -5447,7 +5449,9 @@ TEST_CASE(variable_batch_user_input_test3)
{
{
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
{
migraphx
::
shape
::
float_type
,
{{
2
,
5
,
0
},
{
3
,
3
,
0
},
{
16
,
16
,
0
},
{
16
,
16
,
0
}}});
auto
l0
=
mm
->
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
2
,
5
,
0
},
{
3
,
3
,
0
},
{
16
,
16
,
0
},
{
16
,
16
,
0
}}});
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"identity"
),
l0
);
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"identity"
),
l0
);
mm
->
add_return
({
r
});
mm
->
add_return
({
r
});
...
...
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