10 const std::vector<const TensorInfo*>& inputs,
11 const std::vector<const TensorInfo*>& outputs,
14 std::string input0Name = std::string(
"input0_");
15 std::string input1Name = std::string(
"input1_");
16 std::string outputName = std::string(
"output0_");
17 std::string blockName;
34 TosaSerializationOperator* op =
nullptr;
37 case LayerType::Addition:
39 op =
new TosaSerializationOperator(Op_ADD,
42 {input0Name, input1Name},
47 case LayerType::ElementwiseBinary:
53 op =
new TosaSerializationOperator(Op_MAXIMUM,
56 {input0Name, input1Name},
62 throw armnn::Exception(
"ConvertElementwiseBinaryToTosaOperator: Unsupported layer type.");
66 case LayerType::Multiplication:
69 TosaMulAttribute mulAttribute(shift);
70 op =
new TosaSerializationOperator(Op_MUL,
71 Attribute_MulAttribute,
73 {input0Name, input1Name},
78 case LayerType::Subtraction:
80 op =
new TosaSerializationOperator(Op_SUB,
83 {input0Name, input1Name},
89 throw armnn::Exception(
"ConvertElementwiseBinaryToTosaOperator: Unsupported layer type.");
93 std::vector<TosaSerializationTensor*> tensors;
97 if(input0Name.find(
"input0_") != std::string::npos)
100 DType inputDType0 =
ArmNNToDType(inputs[0]->GetDataType());
101 tensors.push_back(
new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {}));
103 if(input1Name.find(
"input1_") != std::string::npos)
106 DType inputDType1 =
ArmNNToDType(inputs[1]->GetDataType());
107 tensors.push_back(
new TosaSerializationTensor(input1Name, inputShape1, inputDType1, {}));
111 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
113 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
117 return new TosaSerializationBasicBlock(blockName,
121 {input0Name, input1Name},