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
d495ea95
Commit
d495ea95
authored
Oct 31, 2022
by
charlie
Browse files
simplify compare to one_dyn_dim
change to shape::operator== makes it so this will work the same
parent
7388f491
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/common.cpp
src/common.cpp
+2
-2
No files found.
src/common.cpp
View file @
d495ea95
...
@@ -81,7 +81,7 @@ std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, sha
...
@@ -81,7 +81,7 @@ std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, sha
}
}
auto
offset
=
s1
.
ndim
()
-
s0
.
ndim
();
auto
offset
=
s1
.
ndim
()
-
s0
.
ndim
();
std
::
vector
<
shape
::
dynamic_dimension
>
out_dims
(
s1
.
dyn_dims
());
std
::
vector
<
shape
::
dynamic_dimension
>
out_dims
(
s1
.
dyn_dims
());
std
::
vector
<
shape
::
dynamic_dimension
>
one_dyn_dim
s
{
{
1
,
1
,
0
}
,
{
1
,
1
,
1
}}
;
shape
::
dynamic_dimension
one_dyn_dim
{
1
,
1
,
0
};
std
::
transform
(
std
::
transform
(
s0
.
dyn_dims
().
cbegin
(),
s0
.
dyn_dims
().
cbegin
(),
s0
.
dyn_dims
().
cend
(),
s0
.
dyn_dims
().
cend
(),
...
@@ -92,7 +92,7 @@ std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, sha
...
@@ -92,7 +92,7 @@ std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, sha
{
{
return
a
;
return
a
;
}
}
else
if
(
contains
(
one_dyn_dim
s
,
a
)
or
contains
(
one_dyn_dim
s
,
b
)
)
else
if
(
a
==
one_dyn_dim
or
b
==
one_dyn_dim
)
{
{
// setting opt to 0, may need to be changed
// setting opt to 0, may need to be changed
return
shape
::
dynamic_dimension
{
std
::
max
(
a
.
min
,
b
.
min
),
std
::
max
(
a
.
max
,
b
.
max
),
0
};
return
shape
::
dynamic_dimension
{
std
::
max
(
a
.
min
,
b
.
min
),
std
::
max
(
a
.
max
,
b
.
max
),
0
};
...
...
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