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(
"input_");
17 std::string outputName = std::string(
"output0_");
18 std::string blockName = std::string(
"Op_") + poolType + std::string(
"_POOL2D_block_") +
GetUniqueTosaMappingID();
28 std::vector<int> pad = {
static_cast<int>(poolDescriptor->
m_PadTop),
30 static_cast<int>(poolDescriptor->
m_PadLeft),
32 std::vector<int> kernel = {
static_cast<int>(poolDescriptor->
m_PoolHeight),
34 std::vector<int> stride = {
static_cast<int>(poolDescriptor->
m_StrideY),
35 static_cast<int>(poolDescriptor->
m_StrideX)};
36 TosaPoolAttribute attribute(pad, kernel, stride, 0, 0,
ArmNNToDType(inputs[0]->GetDataType()));
38 auto* op =
new TosaSerializationOperator(opcode,
39 Attribute_PoolAttribute,
44 std::vector<TosaSerializationTensor*> tensors;
49 if(input0Name.find(
"input_") != std::string::npos)
52 DType inputDType0 =
ArmNNToDType(inputs[0]->GetDataType());
54 tensors.push_back(
new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {}));
58 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
60 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
64 return new TosaSerializationBasicBlock(blockName,