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
704752eb
Commit
704752eb
authored
Feb 13, 2019
by
Paul
Browse files
Formatting
parent
0df28887
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/py/migraphx_py.cpp
src/py/migraphx_py.cpp
+6
-6
No files found.
src/py/migraphx_py.cpp
View file @
704752eb
...
...
@@ -61,9 +61,8 @@ py::buffer_info to_buffer_info(T& x)
{
migraphx
::
shape
s
=
x
.
get_shape
();
auto
strides
=
s
.
strides
();
std
::
transform
(
strides
.
begin
(),
strides
.
end
(),
strides
.
begin
(),
[
&
](
auto
i
)
{
return
i
*
s
.
type_size
();
});
std
::
transform
(
strides
.
begin
(),
strides
.
end
(),
strides
.
begin
(),
[
&
](
auto
i
)
{
return
i
*
s
.
type_size
();
});
py
::
buffer_info
b
;
visit_type
(
s
,
[
&
](
auto
as
)
{
b
=
py
::
buffer_info
(
x
.
data
(),
...
...
@@ -81,7 +80,8 @@ migraphx::shape to_shape(const py::buffer_info& info)
migraphx
::
shape
::
type_t
t
;
std
::
size_t
n
=
0
;
visit_types
([
&
](
auto
as
)
{
if
(
info
.
format
==
py
::
format_descriptor
<
decltype
(
as
())
>::
format
())
{
if
(
info
.
format
==
py
::
format_descriptor
<
decltype
(
as
())
>::
format
())
{
t
=
as
.
type_enum
();
n
=
sizeof
(
as
());
}
...
...
@@ -89,7 +89,7 @@ migraphx::shape to_shape(const py::buffer_info& info)
});
auto
strides
=
info
.
strides
;
std
::
transform
(
strides
.
begin
(),
strides
.
end
(),
strides
.
begin
(),
[
&
](
auto
i
)
->
std
::
size_t
{
if
(
n
>
0
)
if
(
n
>
0
)
return
n
*
i
;
else
return
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