MCPcopy Create free account
hub / github.com/ARM-software/armnn / getNumpyDescr

Function getNumpyDescr

include/armnn/Numpy.hpp:255–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 }
254
255 inline std::string getNumpyDescr(armnn::DataType dType)
256 {
257 switch(dType)
258 {
259 case armnn::DataType::Float32:
260 return "f" + std::to_string(sizeof(float)); // size of float can be 4 or 8
261 case armnn::DataType::Float16:
262 return "f2";
263 case armnn::DataType::Signed64:
264 return "i8";
265 case armnn::DataType::Signed32:
266 return "i4";
267 case armnn::DataType::QSymmS16:
268 return "i2";
269 case armnn::DataType::QSymmS8:
270 case armnn::DataType::QAsymmS8:
271 return "i1";
272 case armnn::DataType::QAsymmU8:
273 return "u1";
274 default:
275 throw armnn::Exception(fmt::format("ArmNN to Numpy data type:{} not supported. {}",
276 dType, CHECK_LOCATION().AsString()));
277 }
278 }
279
280 template <typename T>
281 inline bool compareCTypes(std::string& descr)

Callers 1

WriteToNumpyFileFunction · 0.85

Calls 4

formatEnum · 0.85
ExceptionClass · 0.70
to_stringFunction · 0.50
AsStringMethod · 0.45

Tested by

no test coverage detected