diff options
Diffstat (limited to 'ModelToINetworkConverter.cpp')
-rw-r--r-- | ModelToINetworkConverter.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ModelToINetworkConverter.cpp b/ModelToINetworkConverter.cpp index 2a79a279..96a65604 100644 --- a/ModelToINetworkConverter.cpp +++ b/ModelToINetworkConverter.cpp @@ -37,6 +37,8 @@ template<typename HalPolicy> void ModelToINetworkConverter<HalPolicy>::Convert() { using HalModel = typename HalPolicy::Model; + using Operand = typename HalPolicy::Operand; + using OperandType = typename HalPolicy::OperationType; ALOGV("ModelToINetworkConverter::Convert(): %s", GetModelSummary<HalModel>(m_Model).c_str()); @@ -68,7 +70,7 @@ void ModelToINetworkConverter<HalPolicy>::Convert() { // inputs in android nn are represented by operands uint32_t inputIndex = m_Model.inputIndexes[i]; - const V1_0::Operand& operand = m_Model.operands[inputIndex]; + const Operand& operand = m_Model.operands[inputIndex]; const armnn::TensorInfo& tensor = GetTensorInfoForOperand(operand); armnn::IConnectableLayer* layer = m_Data.m_Network->AddInputLayer(i); @@ -79,7 +81,7 @@ void ModelToINetworkConverter<HalPolicy>::Convert() m_Data.m_OutputSlotForOperand[inputIndex] = &outputSlot; } } - catch (UnsupportedOperand& e) + catch (UnsupportedOperand<OperandType>& e) { Fail("%s: Operand type %s not supported in ArmnnDriver", __func__, toString(e.m_type).c_str()); m_ConversionResult = ConversionResult::UnsupportedFeature; @@ -107,7 +109,7 @@ void ModelToINetworkConverter<HalPolicy>::Convert() { ok = HalPolicy::ConvertOperation(operation, m_Model, m_Data); } - catch (UnsupportedOperand& e) + catch (UnsupportedOperand<OperandType>& e) { Fail("%s: Operand type %s not supported in ArmnnDriver", __func__, toString(e.m_type).c_str()); ok = false; @@ -137,7 +139,7 @@ void ModelToINetworkConverter<HalPolicy>::Convert() { // outputs in android nn are represented by operands uint32_t outputIndex = m_Model.outputIndexes[i]; - const V1_0::Operand& operand = m_Model.operands[outputIndex]; + const Operand& operand = m_Model.operands[outputIndex]; const armnn::TensorInfo& tensor = GetTensorInfoForOperand(operand); armnn::IConnectableLayer* layer = m_Data.m_Network->AddOutputLayer(i); @@ -171,4 +173,9 @@ template class ModelToINetworkConverter<hal_1_0::HalPolicy>; template class ModelToINetworkConverter<hal_1_1::HalPolicy>; #endif +#ifdef ARMNN_ANDROID_NN_V1_2 +template class ModelToINetworkConverter<hal_1_1::HalPolicy>; +template class ModelToINetworkConverter<hal_1_2::HalPolicy>; +#endif + } // armnn_driver |