46 const unsigned int width = src.
shape()[0];
47 const unsigned int height = src.
shape()[1];
48 const unsigned int depth = src.
shape()[2];
51 std::array<bool, 4> to_reverse = { {
false,
false,
false,
false } };
54 to_reverse[axis[i]] =
true;
60 #pragma omp parallel for 62 for(uint32_t i = 0; i < num_elements; ++i)
65 const unsigned int dst_x = to_reverse[0] ? width - src_coord[0] - 1 : src_coord[0];
66 const unsigned int dst_y = to_reverse[1] ? height - src_coord[1] - 1 : src_coord[1];
67 const unsigned int dst_z = to_reverse[2] ? depth - src_coord[2] - 1 : src_coord[2];
68 const unsigned int dst_w = to_reverse[3] ? batches - src_coord[3] - 1 : src_coord[3];
SimpleTensor< T > reverse(const SimpleTensor< T > &src, const SimpleTensor< uint32_t > &axis)
DataType data_type() const override
Data type of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
TensorShape shape() const override
Shape of the tensor.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
int coord2index(const TensorShape &shape, const Coordinates &coord)
Linearise the given coordinate.
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_channels() const override
Number of channels of the tensor.
int num_elements() const override
Number of elements of the tensor.
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.