9 const std::vector<const TensorInfo*>& inputs,
10 const std::vector<const TensorInfo*>& outputs,
13 std::string poolType = (poolDescriptor->
m_PoolType == PoolingAlgorithm::Max) ?
"Op_MAX" :
"Op_AVG";
14 Op opcode = (poolDescriptor->
m_PoolType == PoolingAlgorithm::Max) ? Op_MAX_POOL2D : Op_AVG_POOL2D;
16 std::string input0Name = std::string(
"input0_");
17 std::string outputName = std::string(
"output0_");
18 std::string blockName = std::string(
"Op_") + poolType + std::string(
"_POOL2D_block_") +
GetUniqueTosaMappingID();
32 std::vector<int> pad = {
static_cast<int>(poolDescriptor->
m_PadTop),
34 static_cast<int>(poolDescriptor->
m_PadLeft),
36 std::vector<int> kernel = {
static_cast<int>(poolDescriptor->
m_PoolHeight),
38 std::vector<int> stride = {
static_cast<int>(poolDescriptor->
m_StrideY),
39 static_cast<int>(poolDescriptor->
m_StrideX)};
40 TosaPoolAttribute attribute(pad, kernel, stride, 0, 0,
ArmNNToDType(inputs[0]->GetDataType()));
42 auto* op =
new TosaSerializationOperator(opcode,
43 Attribute_PoolAttribute,
48 std::vector<TosaSerializationTensor*> tensors;
53 if(input0Name.find(
"input0_") != std::string::npos)
56 DType inputDType0 =
ArmNNToDType(inputs[0]->GetDataType());
58 tensors.push_back(
new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {}));
62 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
64 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
68 return new TosaSerializationBasicBlock(blockName,