| 42 | } |
| 43 | |
| 44 | Status validate_arguments(const ITensorInfo *predictions, |
| 45 | const ITensorInfo *targets, |
| 46 | ITensorInfo *output, |
| 47 | const unsigned int k) |
| 48 | { |
| 49 | ARM_COMPUTE_UNUSED(k); |
| 50 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(predictions, targets, output); |
| 51 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(predictions, targets); |
| 52 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(predictions, ITensorInfo::one_channel, DataType::QASYMM8, |
| 53 | DataType::QASYMM8_SIGNED, DataType::S32, DataType::F16, |
| 54 | DataType::F32); |
| 55 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(targets, ITensorInfo::one_channel, DataType::U32); |
| 56 | |
| 57 | ARM_COMPUTE_RETURN_ERROR_ON(predictions->num_dimensions() > 2); |
| 58 | ARM_COMPUTE_RETURN_ERROR_ON(targets->num_dimensions() > 1); |
| 59 | ARM_COMPUTE_RETURN_ERROR_ON(targets->dimension(0) != predictions->dimension(1)); |
| 60 | // Validate configured output |
| 61 | if (output->total_size() != 0) |
| 62 | { |
| 63 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(output); |
| 64 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), targets->tensor_shape()); |
| 65 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, ITensorInfo::one_channel, DataType::U8); |
| 66 | } |
| 67 | else |
| 68 | { |
| 69 | const auto output_info = TensorInfo(targets->tensor_shape(), ITensorInfo::one_channel, DataType::U8); |
| 70 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output_info); |
| 71 | } |
| 72 | |
| 73 | return Status{}; |
| 74 | } |
| 75 | } // namespace |
| 76 | |
| 77 | template <typename T> |
no test coverage detected