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
33e5534c
Commit
33e5534c
authored
May 11, 2022
by
charlie
Browse files
avoid typedef
parent
ac0224a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/include/migraphx/shape.hpp
src/include/migraphx/shape.hpp
+1
-2
src/shape.cpp
src/shape.cpp
+4
-4
No files found.
src/include/migraphx/shape.hpp
View file @
33e5534c
...
...
@@ -103,8 +103,7 @@ struct shape
// shape(type_t, std::vector<std::size_t> l)
shape
(
type_t
t
,
std
::
initializer_list
<
std
::
size_t
>
d
);
typedef
std
::
vector
<
dynamic_dimension
>
dynamic_dimensions
;
shape
(
type_t
t
,
dynamic_dimensions
dims
);
shape
(
type_t
t
,
std
::
vector
<
dynamic_dimension
>
dims
);
template
<
class
Range
>
shape
(
type_t
t
,
const
Range
&
l
)
:
shape
(
t
,
std
::
vector
<
std
::
size_t
>
(
l
.
begin
(),
l
.
end
()))
...
...
src/shape.cpp
View file @
33e5534c
...
...
@@ -45,7 +45,7 @@ struct shape_impl
std
::
is_sorted
(
m_strides
.
rbegin
(),
m_strides
.
rend
());
}
shape_impl
(
shape
::
type_t
t
,
shape
::
dynamic_dimension
s
dims
)
shape_impl
(
shape
::
type_t
t
,
std
::
vector
<
shape
::
dynamic_dimension
>
dims
)
:
m_type
(
t
),
m_dyn_dims
(
std
::
move
(
dims
))
{
}
...
...
@@ -58,7 +58,7 @@ struct shape_impl
std
::
vector
<
shape
>
m_shapes
=
{};
bool
m_standard
=
false
;
std
::
vector
<
shape
::
dynamic_dimension
>
m_dyn_dims
=
{};
std
::
vector
<
shape
::
shape
::
dynamic_dimension
>
m_dyn_dims
=
{};
void
calculate_strides
()
{
...
...
@@ -159,7 +159,7 @@ shape::shape(type_t t, std::initializer_list<std::size_t> d)
{
}
shape
::
shape
(
type_t
t
,
dynamic_dimension
s
dims
)
shape
::
shape
(
type_t
t
,
std
::
vector
<
shape
::
dynamic_dimension
>
dims
)
:
impl
(
std
::
make_shared
<
shape_impl
>
(
t
,
std
::
move
(
dims
)))
{
}
...
...
@@ -510,7 +510,7 @@ void migraphx_from_value(const value& v, shape& s)
auto
opts
=
v
.
at
(
"opt_dyn_dims"
).
to_vector
<
std
::
size_t
>
();
assert
(
mins
.
size
()
==
maxes
.
size
()
and
maxes
.
size
()
==
opts
.
size
());
auto
num_dims
=
mins
.
size
();
shape
::
dynamic_dimension
s
dyn_dims
(
num_dims
);
std
::
vector
<
shape
::
dynamic_dimension
>
dyn_dims
(
num_dims
);
for
(
int
i
=
0
;
i
<
num_dims
;
++
i
)
{
dyn_dims
.
at
(
i
)
=
shape
::
dynamic_dimension
{
mins
[
i
],
maxes
[
i
],
opts
[
i
]};
...
...
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