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
4d59204f
Commit
4d59204f
authored
Nov 17, 2022
by
charlie
Browse files
Simplify compare to 1 dyn_dim
parent
ed2c235e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/include/migraphx/op/squeeze.hpp
src/include/migraphx/op/squeeze.hpp
+3
-3
No files found.
src/include/migraphx/op/squeeze.hpp
View file @
4d59204f
...
@@ -59,9 +59,9 @@ struct squeeze
...
@@ -59,9 +59,9 @@ struct squeeze
auto
input_shape
=
inputs
[
0
];
auto
input_shape
=
inputs
[
0
];
if
(
input_shape
.
dynamic
())
if
(
input_shape
.
dynamic
())
{
{
std
::
vector
<
shape
::
dynamic_dimension
>
one_dyn_dim
s
{
{
1
,
1
,
0
}
,
{
1
,
1
,
1
}}
;
shape
::
dynamic_dimension
one_dyn_dim
{
1
,
1
,
0
};
if
(
std
::
any_of
(
axes
.
begin
(),
axes
.
end
(),
[
&
](
auto
axis
)
{
if
(
std
::
any_of
(
axes
.
begin
(),
axes
.
end
(),
[
&
](
auto
axis
)
{
return
not
contains
(
one_dyn_dims
,
input_shape
.
dyn_dims
()[
axis
]
)
;
return
input_shape
.
dyn_dims
()[
axis
]
!=
one_dyn_dim
;
}))
}))
{
{
MIGRAPHX_THROW
(
MIGRAPHX_THROW
(
...
@@ -73,7 +73,7 @@ struct squeeze
...
@@ -73,7 +73,7 @@ struct squeeze
for
(
auto
i
:
range
(
input_shape
.
ndim
()))
for
(
auto
i
:
range
(
input_shape
.
ndim
()))
{
{
auto
dd
=
input_shape
.
dyn_dims
()[
i
];
auto
dd
=
input_shape
.
dyn_dims
()[
i
];
if
(
not
contains
(
one_dyn_dim
s
,
dd
)
)
if
(
dd
!=
one_dyn_dim
)
{
{
dyn_dims
.
push_back
(
dd
);
dyn_dims
.
push_back
(
dd
);
}
}
...
...
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