You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: ModelImporter.hpp
+63-22
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,10 @@
7
7
#include"ImporterContext.hpp"
8
8
#include"NvInferPlugin.h"
9
9
#include"NvOnnxParser.h"
10
+
#include"errorHelpers.hpp"
10
11
#include"onnxOpCheckers.hpp"
11
12
#include"onnxOpImporters.hpp"
13
+
#include<stdexcept>
12
14
13
15
namespaceonnx2trt
14
16
{
@@ -24,32 +26,49 @@ Status parseGraph(ImporterContext* ctx, ::ONNX_NAMESPACE::GraphProto const& grap
24
26
25
27
classModelImporter : publicnvonnxparser::IParser
26
28
{
29
+
using SubGraphSupport_t = std::pair<std::vector<int64_t>, bool>;
30
+
using SubGraphSupportVector_t = std::vector<SubGraphSupport_t>;
31
+
27
32
protected:
28
33
StringMap<NodeImporter> _op_importers;
29
-
virtual Status importModel(::ONNX_NAMESPACE::ModelProto const& model);
34
+
virtual Status importModel(::ONNX_NAMESPACE::ModelProto const& model)noexcept;
30
35
31
36
private:
32
37
ImporterContext mImporterCtx;
33
38
std::vector<std::string> mPluginLibraryList; // Array of strings containing plugin libs
34
39
std::vector<charconst*>
35
40
mPluginLibraryListCStr; // Array of C-strings corresponding to the strings in mPluginLibraryList
36
41
std::list<::ONNX_NAMESPACE::ModelProto> mONNXModels; // Needed for ownership of weights
42
+
SubGraphSupportVector_t mSubGraphSupportVector;
37
43
intmCurrentNode;
38
-
std::vector<Status> mErrors;
39
-
nvonnxparser::OnnxParserFlags mOnnxParserFlags{1U << static_cast<uint32_t>(nvonnxparser::OnnxParserFlag::kNATIVE_INSTANCENORM)}; // kNATIVE_INSTANCENORM is ON by default.
44
+
mutable std::vector<Status> mErrors; // Marked as mutable so that errors could be reported from const functions
45
+
nvonnxparser::OnnxParserFlags mOnnxParserFlags{
46
+
1U << static_cast<uint32_t>(
47
+
nvonnxparser::OnnxParserFlag::kNATIVE_INSTANCENORM)}; // kNATIVE_INSTANCENORM is ON by default.
0 commit comments