| 163 | } |
| 164 | |
| 165 | std::string string_from_pixel_value(const PixelValue &value, const DataType data_type) |
| 166 | { |
| 167 | std::stringstream ss; |
| 168 | std::string converted_string; |
| 169 | |
| 170 | switch (data_type) |
| 171 | { |
| 172 | case DataType::U8: |
| 173 | case DataType::QASYMM8: |
| 174 | // Needs conversion to 32 bit, otherwise interpreted as ASCII values |
| 175 | ss << uint32_t(value.get<uint8_t>()); |
| 176 | converted_string = ss.str(); |
| 177 | break; |
| 178 | case DataType::S8: |
| 179 | case DataType::QASYMM8_SIGNED: |
| 180 | case DataType::QSYMM8_PER_CHANNEL: |
| 181 | // Needs conversion to 32 bit, otherwise interpreted as ASCII values |
| 182 | ss << int32_t(value.get<int8_t>()); |
| 183 | converted_string = ss.str(); |
| 184 | break; |
| 185 | case DataType::U16: |
| 186 | case DataType::QASYMM16: |
| 187 | ss << value.get<uint16_t>(); |
| 188 | converted_string = ss.str(); |
| 189 | break; |
| 190 | case DataType::S16: |
| 191 | case DataType::QSYMM16: |
| 192 | ss << value.get<int16_t>(); |
| 193 | converted_string = ss.str(); |
| 194 | break; |
| 195 | case DataType::U32: |
| 196 | ss << value.get<uint32_t>(); |
| 197 | converted_string = ss.str(); |
| 198 | break; |
| 199 | case DataType::S32: |
| 200 | ss << value.get<int32_t>(); |
| 201 | converted_string = ss.str(); |
| 202 | break; |
| 203 | case DataType::F32: |
| 204 | converted_string = float_to_string_with_full_precision(value.get<float>()); |
| 205 | break; |
| 206 | case DataType::F16: |
| 207 | static_assert(sizeof(half) == 2, "Half must be 16 bit"); |
| 208 | ss << value.get<half>(); |
| 209 | converted_string = ss.str(); |
| 210 | break; |
| 211 | default: |
| 212 | ARM_COMPUTE_ERROR("Not handled"); |
| 213 | } |
| 214 | |
| 215 | return converted_string; |
| 216 | } |
| 217 | |
| 218 | PadStrideInfo calculate_same_pad(TensorShape input_shape, |
| 219 | TensorShape weights_shape, |
no test coverage detected