| 88 | } |
| 89 | |
| 90 | Status |
| 91 | CpuSoftmaxGeneric::validate(const ITensorInfo *src, const ITensorInfo *dst, float beta, int32_t axis, bool is_log) |
| 92 | { |
| 93 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuSoftmaxGeneric::validate"); |
| 94 | // Perform validation step |
| 95 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, dst); |
| 96 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src->num_dimensions() > 4, "Only up to 4 dimensions are supported"); |
| 97 | ARM_COMPUTE_UNUSED(beta); |
| 98 | ARM_COMPUTE_RETURN_ERROR_ON(axis < static_cast<int32_t>(-src->num_dimensions()) || |
| 99 | static_cast<int32_t>(src->num_dimensions()) <= axis); |
| 100 | |
| 101 | // Create intermediate tensor info |
| 102 | TensorInfo tensor_info_tmp; |
| 103 | |
| 104 | if (is_data_type_quantized_asymmetric(src->data_type())) |
| 105 | { |
| 106 | tensor_info_tmp = src->clone()->set_data_type(DataType::F32).set_is_resizable(true); |
| 107 | } |
| 108 | const unsigned int actual_axis = |
| 109 | static_cast<unsigned int>(wrap_around(axis, static_cast<int32_t>(src->num_dimensions()))); |
| 110 | |
| 111 | ARM_COMPUTE_RETURN_ON_ERROR( |
| 112 | kernels::CpuSoftmaxKernel::validate(src, dst, beta, actual_axis, is_log, &tensor_info_tmp)); |
| 113 | |
| 114 | return Status{}; |
| 115 | } |
| 116 | |
| 117 | void CpuSoftmaxGeneric::run(ITensorPack &tensors) |
| 118 | { |
nothing calls this directly
no test coverage detected