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
072459db
Commit
072459db
authored
Feb 14, 2019
by
Paul
Browse files
Formatting
parent
3032998d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
src/include/migraphx/tensor_view.hpp
src/include/migraphx/tensor_view.hpp
+1
-4
src/py/migraphx_py.cpp
src/py/migraphx_py.cpp
+7
-8
No files found.
src/include/migraphx/tensor_view.hpp
View file @
072459db
...
@@ -124,10 +124,7 @@ struct tensor_view
...
@@ -124,10 +124,7 @@ struct tensor_view
return
m_data
+
this
->
size
();
return
m_data
+
this
->
size
();
}
}
std
::
vector
<
T
>
to_vector
()
const
std
::
vector
<
T
>
to_vector
()
const
{
return
std
::
vector
<
T
>
(
this
->
begin
(),
this
->
end
());
}
{
return
std
::
vector
<
T
>
(
this
->
begin
(),
this
->
end
());
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
tensor_view
<
T
>&
x
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
tensor_view
<
T
>&
x
)
{
{
...
...
src/py/migraphx_py.cpp
View file @
072459db
...
@@ -47,7 +47,7 @@ struct skip_half
...
@@ -47,7 +47,7 @@ struct skip_half
}
}
void
operator
()(
migraphx
::
shape
::
as
<
migraphx
::
half
>
)
const
{}
void
operator
()(
migraphx
::
shape
::
as
<
migraphx
::
half
>
)
const
{}
void
operator
()(
migraphx
::
tensor_view
<
migraphx
::
half
>
)
const
{}
void
operator
()(
migraphx
::
tensor_view
<
migraphx
::
half
>
)
const
{}
};
};
...
@@ -137,13 +137,12 @@ PYBIND11_MODULE(migraphx, m)
...
@@ -137,13 +137,12 @@ PYBIND11_MODULE(migraphx, m)
new
(
&
x
)
migraphx
::
argument
(
to_shape
(
info
),
info
.
ptr
);
new
(
&
x
)
migraphx
::
argument
(
to_shape
(
info
),
info
.
ptr
);
})
})
.
def
(
"get_shape"
,
&
migraphx
::
argument
::
get_shape
)
.
def
(
"get_shape"
,
&
migraphx
::
argument
::
get_shape
)
.
def
(
"tolist"
,
[](
migraphx
::
argument
&
x
)
{
.
def
(
"tolist"
,
py
::
list
l
{
x
.
get_shape
().
elements
()};
[](
migraphx
::
argument
&
x
)
{
visit
(
x
,
[
&
](
auto
data
)
{
py
::
list
l
{
x
.
get_shape
().
elements
()};
l
=
py
::
cast
(
data
.
to_vector
());
visit
(
x
,
[
&
](
auto
data
)
{
l
=
py
::
cast
(
data
.
to_vector
());
});
});
return
l
;
return
l
;
})
})
.
def
(
"__eq__"
,
std
::
equal_to
<
migraphx
::
argument
>
{})
.
def
(
"__eq__"
,
std
::
equal_to
<
migraphx
::
argument
>
{})
.
def
(
"__ne__"
,
std
::
not_equal_to
<
migraphx
::
argument
>
{})
.
def
(
"__ne__"
,
std
::
not_equal_to
<
migraphx
::
argument
>
{})
.
def
(
"__repr__"
,
[](
const
migraphx
::
argument
&
x
)
{
return
migraphx
::
to_string
(
x
);
});
.
def
(
"__repr__"
,
[](
const
migraphx
::
argument
&
x
)
{
return
migraphx
::
to_string
(
x
);
});
...
...
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