| 22 | // of size original dims according to axes specified in flip |
| 23 | template<typename T> |
| 24 | static detail::Array<T> flip(const detail::Array<T>& in, |
| 25 | const std::array<bool, AF_MAX_DIMS> flip) { |
| 26 | std::vector<af_seq> index(4, af_span); |
| 27 | const af::dim4& dims = in.dims(); |
| 28 | |
| 29 | for (int i = 0; i < AF_MAX_DIMS; ++i) { |
| 30 | if (flip[i]) { |
| 31 | index[i] = {static_cast<double>(dims[i] - 1), 0.0, -1.0}; |
| 32 | } |
| 33 | } |
| 34 | return createSubArray(in, index); |
| 35 | } |
| 36 | |
| 37 | } // namespace common |
| 38 | } // namespace arrayfire |
no test coverage detected