ArmNN
 22.05
ExecuteNetworkParams.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/BackendId.hpp>
9 #include <armnn/Tensor.hpp>
10 
11 #if defined(ARMNN_TFLITE_DELEGATE)
12 #include <DelegateOptions.hpp>
13 #endif
14 
15 /// Holds all parameters necessary to execute a network
16 /// Check ExecuteNetworkProgramOptions.cpp for a description of each parameter
18 {
19  using TensorShapePtr = std::unique_ptr<armnn::TensorShape>;
20 
21  enum class TfLiteExecutor
22  {
26  };
27 
30  std::vector<armnn::BackendId> m_ComputeDevices;
33  std::string m_DynamicBackendsPath;
35  bool m_EnableFastMath = false;
37  bool m_EnableLayerDetails = false;
40  bool m_InferOutputShape = false;
41  bool m_EnableDelegate = false;
42  std::vector<std::string> m_InputNames;
43  std::vector<std::string> m_InputTensorDataFilePaths;
44  std::vector<TensorShapePtr> m_InputTensorShapes;
45  std::vector<std::string> m_InputTypes;
47  size_t m_Iterations;
48  std::string m_ModelFormat;
49  std::string m_ModelPath;
50  unsigned int m_NumberOfThreads;
53  std::vector<std::string> m_OutputNames;
54  std::vector<std::string> m_OutputTensorFiles;
55  std::vector<std::string> m_OutputTypes;
56  bool m_ParseUnsupported = false;
62  size_t m_SubgraphId;
65  std::string m_TuningPath;
66  std::string m_MLGOTuningFilePath;
71 
72  // Ensures that the parameters for ExecuteNetwork fit together
73  void ValidateParams();
74 
75 #if defined(ARMNN_TFLITE_DELEGATE)
76  /// A utility method that populates a DelegateOptions object from this ExecuteNetworkParams.
77  armnnDelegate::DelegateOptions ToDelegateOptions() const;
78 #endif
79 
80 };
std::vector< std::string > m_InputTypes
std::unique_ptr< armnn::TensorShape > TensorShapePtr
std::vector< TensorShapePtr > m_InputTensorShapes
std::vector< std::string > m_OutputNames
std::vector< std::string > m_OutputTensorFiles
std::vector< armnn::BackendId > m_ComputeDevices
std::vector< std::string > m_OutputTypes
Holds all parameters necessary to execute a network Check ExecuteNetworkProgramOptions.cpp for a description of each parameter.
std::vector< std::string > m_InputNames
std::vector< std::string > m_InputTensorDataFilePaths