Commit 704752eb authored by Paul's avatar Paul
Browse files

Formatting

parent 0df28887
...@@ -61,9 +61,8 @@ py::buffer_info to_buffer_info(T& x) ...@@ -61,9 +61,8 @@ py::buffer_info to_buffer_info(T& x)
{ {
migraphx::shape s = x.get_shape(); migraphx::shape s = x.get_shape();
auto strides = s.strides(); auto strides = s.strides();
std::transform(strides.begin(), strides.end(), strides.begin(), [&](auto i) { std::transform(
return i * s.type_size(); strides.begin(), strides.end(), strides.begin(), [&](auto i) { return i * s.type_size(); });
});
py::buffer_info b; py::buffer_info b;
visit_type(s, [&](auto as) { visit_type(s, [&](auto as) {
b = py::buffer_info(x.data(), b = py::buffer_info(x.data(),
...@@ -81,7 +80,8 @@ migraphx::shape to_shape(const py::buffer_info& info) ...@@ -81,7 +80,8 @@ migraphx::shape to_shape(const py::buffer_info& info)
migraphx::shape::type_t t; migraphx::shape::type_t t;
std::size_t n = 0; std::size_t n = 0;
visit_types([&](auto as) { 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(); t = as.type_enum();
n = sizeof(as()); n = sizeof(as());
} }
...@@ -89,7 +89,7 @@ migraphx::shape to_shape(const py::buffer_info& info) ...@@ -89,7 +89,7 @@ migraphx::shape to_shape(const py::buffer_info& info)
}); });
auto strides = info.strides; auto strides = info.strides;
std::transform(strides.begin(), strides.end(), strides.begin(), [&](auto i) -> std::size_t { std::transform(strides.begin(), strides.end(), strides.begin(), [&](auto i) -> std::size_t {
if (n > 0) if(n > 0)
return n * i; return n * i;
else else
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment