10 const std::vector<const TensorInfo*>& inputs,
11 const std::vector<const TensorInfo*>& outputs)
13 std::string input0Name = std::string(
"input0_");
14 std::string input1Name = std::string(
"input1_");
15 std::string outputName = std::string(
"output0_");
16 std::string blockName;
33 TosaSerializationOperator* op =
nullptr;
36 case LayerType::Addition:
38 op =
new TosaSerializationOperator(Op_ADD,
41 {input0Name, input1Name},
46 case LayerType::Multiplication:
49 TosaMulAttribute mulAttribute(shift);
50 op =
new TosaSerializationOperator(Op_MUL,
51 Attribute_MulAttribute,
53 {input0Name, input1Name},
58 case LayerType::Subtraction:
60 op =
new TosaSerializationOperator(Op_SUB,
63 {input0Name, input1Name},
69 throw armnn::Exception(
"ConvertElementwiseBinaryToTosaOperator: Unsupported layer type.");
73 std::vector<TosaSerializationTensor*> tensors;
77 if(input0Name.find(
"input0_") != std::string::npos)
80 DType inputDType0 =
ArmNNToDType(inputs[0]->GetDataType());
81 tensors.push_back(
new TosaSerializationTensor(input0Name, inputShape0, inputDType0, {}));
83 if(input1Name.find(
"input1_") != std::string::npos)
86 DType inputDType1 =
ArmNNToDType(inputs[1]->GetDataType());
87 tensors.push_back(
new TosaSerializationTensor(input1Name, inputShape1, inputDType1, {}));
91 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
93 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
97 return new TosaSerializationBasicBlock(blockName,
101 {input0Name, input1Name},