18 if (unaryDescriptor->
m_Operation != UnaryOperation::Exp)
20 throw armnn::Exception(
"ConvertExpOperator: Unsupported elementwise unary operation in descriptor.");
23 std::string inputName = std::string(
"input_");
24 std::string outputName = std::string(
"output0_");
35 std::vector<TosaSerializationTensor*> tensors;
36 std::vector<TosaSerializationOperator*> operators;
38 float input_scale = inputs[0]->GetQuantizationScale();
39 float output_scale = outputs[0]->GetQuantizationScale();
40 int32_t input_zp = inputs[0]->GetQuantizationOffset();
41 int32_t output_zp = outputs[0]->GetQuantizationOffset();
42 DataType inputDType = inputs[0]->GetDataType();
43 if (inputDType == DataType::QAsymmS8 ||
44 inputDType == DataType::QSymmS8)
46 auto exp_func = [](
float x) ->
float {
return std::exp(x); };
47 TosaTableAttribute attribute(
49 operators.push_back(
new TosaSerializationOperator(tosa::Op_TABLE,
50 Attribute_TableAttribute,
55 else if (inputDType == DataType::QSymmS16)
57 throw Exception(
"ConvertExpOperator() unsupported int 16 not implemented yet.");
75 else if (inputDType == DataType::Signed32 ||
76 inputDType == DataType::Signed64)
79 "ConvertExpOperator() unsupported int 32. Only int 8 and int 16 quantized types are supported.");
84 operators.push_back(
new TosaSerializationOperator(tosa::Op_EXP,
94 if(inputName.find(
"input_") != std::string::npos)
98 tensors.push_back(
new TosaSerializationTensor(inputName, inputShape0, inputDType0, {}));
106 DType outputDType0 =
ArmNNToDType(outputs[0]->GetDataType());
108 tensors.push_back(
new TosaSerializationTensor(outputName, outputShape0, outputDType0, {}));
112 return new TosaSerializationBasicBlock(blockName,