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
77ba9cb1
"git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "ba589b88fc32c4af6e91cb8eeca377cd58eb611f"
Commit
77ba9cb1
authored
May 09, 2022
by
charlie
Browse files
Tidy fix: emplace_back() over for loop
parent
de4c1b44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
src/include/migraphx/shape.hpp
src/include/migraphx/shape.hpp
+2
-0
src/shape.cpp
src/shape.cpp
+4
-3
No files found.
src/include/migraphx/shape.hpp
View file @
77ba9cb1
...
@@ -65,6 +65,8 @@ struct shape
...
@@ -65,6 +65,8 @@ struct shape
std
::
size_t
max
=
0
;
std
::
size_t
max
=
0
;
std
::
size_t
opt
=
1
;
std
::
size_t
opt
=
1
;
dynamic_dimension
()
=
default
;
dynamic_dimension
(
std
::
size_t
i_min
,
std
::
size_t
i_max
,
std
::
size_t
i_opt
)
dynamic_dimension
(
std
::
size_t
i_min
,
std
::
size_t
i_max
,
std
::
size_t
i_opt
)
:
min
(
i_min
),
max
(
i_max
),
opt
(
i_opt
)
:
min
(
i_min
),
max
(
i_max
),
opt
(
i_opt
)
{
{
...
...
src/shape.cpp
View file @
77ba9cb1
...
@@ -501,10 +501,11 @@ void migraphx_from_value(const value& v, shape& s)
...
@@ -501,10 +501,11 @@ void migraphx_from_value(const value& v, shape& s)
auto
maxes
=
v
.
at
(
"max_dyn_dims"
).
to_vector
<
std
::
size_t
>
();
auto
maxes
=
v
.
at
(
"max_dyn_dims"
).
to_vector
<
std
::
size_t
>
();
auto
opts
=
v
.
at
(
"opt_dyn_dims"
).
to_vector
<
std
::
size_t
>
();
auto
opts
=
v
.
at
(
"opt_dyn_dims"
).
to_vector
<
std
::
size_t
>
();
assert
(
mins
.
size
()
==
maxes
.
size
()
and
maxes
.
size
()
==
opts
.
size
());
assert
(
mins
.
size
()
==
maxes
.
size
()
and
maxes
.
size
()
==
opts
.
size
());
std
::
vector
<
shape
::
dynamic_dimension
>
dyn_dims
;
auto
num_dims
=
mins
.
size
();
for
(
int
i
=
0
;
i
<
mins
.
size
();
++
i
)
std
::
vector
<
shape
::
dynamic_dimension
>
dyn_dims
(
num_dims
);
for
(
int
i
=
0
;
i
<
num_dims
;
++
i
)
{
{
dyn_dims
.
emplace_back
(
mins
[
i
],
maxes
[
i
],
opts
[
i
]
)
;
dyn_dims
.
at
(
i
)
=
shape
::
dynamic_dimension
{
mins
[
i
],
maxes
[
i
],
opts
[
i
]
}
;
}
}
s
=
shape
{
migraphx
::
shape
::
dyn_data
{
shape
::
parse_type
(
t
),
dyn_dims
}};
s
=
shape
{
migraphx
::
shape
::
dyn_data
{
shape
::
parse_type
(
t
),
dyn_dims
}};
}
}
...
...
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