11 const std::vector<const TensorInfo*>& outputs,
12 bool isDepthwiseConv2dWeights =
false)
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,