Introduce shape converter from NNAPI operand type to neurun shape
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
type->zeroPoint);
}
+const model::operand::Shape shapeFromOperandType(const ANeuralNetworksOperandType *type)
+{
+ model::operand::Shape shape(type->dimensionCount);
+
+ for (uint32_t axis = 0; axis < type->dimensionCount; ++axis)
+ {
+ shape.dim(axis) = type->dimensions[axis];
+ }
+
+ return shape;
+}
+
} // namespace util
} // namespace neurun
#include <NeuralNetworks.h>
#include "model/operand/TypeInfo.h"
+#include "model/operand/Shape.h"
namespace neurun
{
*/
const model::operand::TypeInfo typeInfoFromOperandType(const ANeuralNetworksOperandType *type);
+/**
+ * @brief Convert operand shape info from NNAPI to internal operand shape
+ * @param[in] type NNAPI's operand type
+ * @return neurun's internal operand shape
+ */
+const model::operand::Shape shapeFromOperandType(const ANeuralNetworksOperandType *type);
+
} // namespace neurun
} // namespace util