| 44 | namespace |
| 45 | { |
| 46 | std::pair<arm_compute::TensorShape, arm_compute::PermutationVector> |
| 47 | compute_permutation_parameters(const arm_compute::TensorShape &shape, arm_compute::DataLayout data_layout) |
| 48 | { |
| 49 | // Set permutation parameters if needed |
| 50 | arm_compute::TensorShape permuted_shape = shape; |
| 51 | arm_compute::PermutationVector perm; |
| 52 | // Permute only if num_dimensions greater than 2 |
| 53 | if (shape.num_dimensions() > 2) |
| 54 | { |
| 55 | perm = (data_layout == arm_compute::DataLayout::NHWC) ? arm_compute::PermutationVector(2U, 0U, 1U) |
| 56 | : arm_compute::PermutationVector(1U, 2U, 0U); |
| 57 | |
| 58 | arm_compute::PermutationVector perm_shape = (data_layout == arm_compute::DataLayout::NCHW) |
| 59 | ? arm_compute::PermutationVector(2U, 0U, 1U) |
| 60 | : arm_compute::PermutationVector(1U, 2U, 0U); |
| 61 | arm_compute::permute(permuted_shape, perm_shape); |
| 62 | } |
| 63 | |
| 64 | return std::make_pair(permuted_shape, perm); |
| 65 | } |
| 66 | } // namespace |
| 67 | |
| 68 | TFPreproccessor::TFPreproccessor(float min_range, float max_range) : _min_range(min_range), _max_range(max_range) |
no test coverage detected