14 std::string outputName = std::string(
"constant_");
17 std::vector<uint8_t> uint8Data;
23 outputName.append(std::to_string(layer->
GetGuid()));
24 blockName.append(std::to_string(layer->
GetGuid()));
26 auto constantLayer = PolymorphicDowncast<const armnn::ConstantLayer*>(layer);
27 auto tensorInfo = constantLayer->GetOutputSlot().GetTensorInfo();
32 auto* op =
new TosaSerializationOperator(Op_CONST, Attribute_NONE,
nullptr, {}, {outputName});
34 std::vector<int32_t> outputShape0;
36 if(isDepthwiseConv2dWeights)
42 unsigned int multiplier = outputs[0]->GetShape()[3]/inputShape[3];
46 static_cast<int32_t
>(outputs[0]->GetShape()[1]),
47 static_cast<int32_t
>(outputs[0]->GetShape()[2]),
48 static_cast<int32_t
>(inputShape[3]),
49 static_cast<int32_t
>(multiplier)
57 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
60 auto* outputTensor0 =
new TosaSerializationTensor(outputName, outputShape0, outputDType0, uint8Data);
62 return new TosaSerializationBasicBlock(blockName,
const std::string mainName
DType ArmNNToDType(const DataType &type)
std::vector< int32_t > GetTosaTensorShape(const TensorShape &shape)
std::string GetUniqueTosaMappingID()
std::vector< uint8_t > ConvertConstantTensorDataToBuffer(const std::shared_ptr< ConstTensorHandle > &tensorHandle)
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
LayerGuid GetGuid() const final
Returns the unique id of the layer.
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
const InputSlot * GetConnection(unsigned int index) const override
const TensorShape & GetShape() const