| 279 | |
| 280 | template <typename T> |
| 281 | inline bool compareCTypes(std::string& descr) |
| 282 | { |
| 283 | if(descr.find("f4") != std::string::npos || descr.find("f8") != std::string::npos) |
| 284 | { |
| 285 | return std::is_same<T, float>::value; |
| 286 | } |
| 287 | else if (descr.find("i8") != std::string::npos) |
| 288 | { |
| 289 | return std::is_same<T, int64_t>::value; |
| 290 | } |
| 291 | else if (descr.find("i4") != std::string::npos) |
| 292 | { |
| 293 | return std::is_same<T, int32_t>::value; |
| 294 | } |
| 295 | else if (descr.find("i2") != std::string::npos) |
| 296 | { |
| 297 | return std::is_same<T, int16_t>::value; |
| 298 | } |
| 299 | else if (descr.find("i1") != std::string::npos) |
| 300 | { |
| 301 | return std::is_same<T, int8_t>::value; |
| 302 | } |
| 303 | else if (descr.find("u1") != std::string::npos) |
| 304 | { |
| 305 | return std::is_same<T, uint8_t>::value; |
| 306 | } |
| 307 | else |
| 308 | { |
| 309 | throw armnn::Exception(fmt::format("Numpy data type:{} not supported. {}", |
| 310 | descr, CHECK_LOCATION().AsString())); |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | inline unsigned int getNumElements(Header& header) |
| 315 | { |