diff options
| author | maxim-yurchuk <[email protected]> | 2024-10-09 12:29:46 +0300 |
|---|---|---|
| committer | maxim-yurchuk <[email protected]> | 2024-10-09 13:14:22 +0300 |
| commit | 9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch) | |
| tree | a8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp | |
| parent | a44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff) | |
publishFullContrib: true for ydb
<HIDDEN_URL>
commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp')
| -rw-r--r-- | contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp new file mode 100644 index 00000000000..6e0afe6fb3f --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp @@ -0,0 +1,28 @@ +#ifndef PYTHONIC_NUMPY_NDARRAY_FLATTEN_HPP +#define PYTHONIC_NUMPY_NDARRAY_FLATTEN_HPP + +#include "pythonic/include/numpy/ndarray/flatten.hpp" + +#include "pythonic/utils/functor.hpp" +#include "pythonic/types/ndarray.hpp" + +PYTHONIC_NS_BEGIN + +namespace numpy +{ + + namespace ndarray + { + template <class T, class pS> + types::ndarray<T, types::pshape<long>> + flatten(types::ndarray<T, pS> const &a) + { + return {a.mem, types::pshape<long>{a.flat_size()}}; + } + + NUMPY_EXPR_TO_NDARRAY0_IMPL(flatten); + } +} +PYTHONIC_NS_END + +#endif |
