| 95 | } |
| 96 | |
| 97 | Status validate_arguments(const ITensorInfo &output, const float start, const float end, const float step) |
| 98 | { |
| 99 | ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output); |
| 100 | const auto *uk = get_implementation(RangeSelectorData{output.data_type()}); |
| 101 | ARM_COMPUTE_RETURN_ERROR_ON(uk == nullptr || uk->ukernel == nullptr); |
| 102 | |
| 103 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((start == end), "start of the requested sequence must not be equal to the end"); |
| 104 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(((start < end) && (step <= 0)), "step must be greater than 0 when start < end"); |
| 105 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(((start > end) && (step >= 0)), "step must be less than 0 when start > end"); |
| 106 | |
| 107 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(!check_value_range(start, output.data_type(), output.quantization_info()), |
| 108 | "start value is outside the range of the data type"); |
| 109 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(!check_value_range(end, output.data_type(), output.quantization_info()), |
| 110 | "end value is outside the range of the data type"); |
| 111 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(!check_value_range(step, output.data_type(), output.quantization_info()), |
| 112 | "step value is outside the range of the data type"); |
| 113 | |
| 114 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((start == end), "start of the requested sequence must not be equal to the end"); |
| 115 | |
| 116 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(output.num_dimensions() != 1, "Output has to be a 1-D tensor"); |
| 117 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(output.tensor_shape().total_size() < num_of_elements_in_range(start, end, step), |
| 118 | "Output tensor size is incorrect"); |
| 119 | |
| 120 | return Status{}; |
| 121 | } |
| 122 | } // namespace |
| 123 | |
| 124 | NERangeKernel::NERangeKernel() : _start(0), _end(1), _step(1), _output(nullptr) |
no test coverage detected