| 39 | namespace |
| 40 | { |
| 41 | Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm) |
| 42 | { |
| 43 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output); |
| 44 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(input); |
| 45 | ARM_COMPUTE_RETURN_ERROR_ON(input->data_type() == DataType::UNKNOWN); |
| 46 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(perm.num_dimensions() > 4, "Only up to 4D permutation vectors are supported"); |
| 47 | |
| 48 | const TensorShape output_shape = misc::shape_calculator::compute_permutation_output_shape(*input, perm); |
| 49 | |
| 50 | // Validate configured output |
| 51 | if (output->total_size() != 0) |
| 52 | { |
| 53 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(output); |
| 54 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), output_shape); |
| 55 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output); |
| 56 | } |
| 57 | else |
| 58 | { |
| 59 | const auto output_info = TensorInfo(output_shape, input->num_channels(), input->data_type()); |
| 60 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output_info); |
| 61 | } |
| 62 | |
| 63 | return Status{}; |
| 64 | } |
| 65 | |
| 66 | } // namespace |
| 67 |
no test coverage detected