| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3799515 commit 0f48d46
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,11 +28,14 @@ namespace pybind11 | |||
| 28 | 28 | template<typename Type> | |
| 29 | 29 | handle xtensor_array_cast(Type const &src, handle base = handle(), bool writeable = true) | |
| 30 | 30 | { | |
| 31 | - std::vector<ssize_t> python_strides(src.strides().size()); | ||
| 32 | - std::transform(src.strides().begin(), src.strides().end(), python_strides.data(), | ||
| 31 | + std::vector<size_t> python_strides(src.strides().size()); | ||
| 32 | + std::transform(src.strides().begin(), src.strides().end(), python_strides.begin(), | ||
| 33 | 33 | [](auto v) { return sizeof(typename Type::value_type) * v; }); | |
| 34 | 34 | ||
| 35 | - array a(src.shape(), python_strides, src.begin(), base); | ||
| 35 | + std::vector<size_t> python_shape(src.shape().size()); | ||
| 36 | + std::copy(src.shape().begin(), src.shape().end(), python_shape.begin()); | ||
| 37 | + | ||
| 38 | + array a(python_shape, python_strides, src.begin(), base); | ||
| 36 | 39 | ||
| 37 | 40 | if (!writeable) | |
| 38 | 41 | { | |
@@ -151,9 +154,9 @@ namespace pybind11 | |||
| 151 | 154 | } | |
| 152 | 155 | ||
| 153 | 156 | template <typename T> | |
| 154 | - using cast_op_type = movable_cast_op_type<T>; | ||
| 157 | + using cast_op_type = cast_op_type<T>; | ||
| 155 | 158 | }; | |
| 156 | 159 | } | |
| 157 | 160 | } | |
| 158 | 161 | ||
| 159 | - #endif | ||
| 162 | + #endif | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments