| @@ -50,6 +50,7 @@ using std::set; | |||||
| using std::string; | using std::string; | ||||
| using std::unordered_map; | using std::unordered_map; | ||||
| using std::vector; | using std::vector; | ||||
| using domi::Status; | |||||
| static std::map<std::vector<std::string>, std::vector<std::string>> params_share_map; | static std::map<std::vector<std::string>, std::vector<std::string>> params_share_map; | ||||
| class PARSER_FUNC_VISIBILITY CaffeModelParser : public domi::ModelParser { | class PARSER_FUNC_VISIBILITY CaffeModelParser : public domi::ModelParser { | ||||
| @@ -157,7 +157,7 @@ bool ValidateStr(const std::string &filePath, const std::string &mode); | |||||
| std::string CurrentTimeInStr(); | std::string CurrentTimeInStr(); | ||||
| template <typename T, typename... Args> | template <typename T, typename... Args> | ||||
| static inline std::shared_ptr<T> MakeShared(Args &&... args) { | |||||
| inline std::shared_ptr<T> MakeShared(Args &&... args) { | |||||
| using T_nc = typename std::remove_const<T>::type; | using T_nc = typename std::remove_const<T>::type; | ||||
| std::shared_ptr<T> ret(new (std::nothrow) T_nc(std::forward<Args>(args)...)); | std::shared_ptr<T> ret(new (std::nothrow) T_nc(std::forward<Args>(args)...)); | ||||
| return ret; | return ret; | ||||
| @@ -23,11 +23,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ArgOpOperator::ArgOpOperator() | |||||
| ArgOpOperator::~ArgOpOperator() {} | ArgOpOperator::~ArgOpOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ArgOpOperator &ArgOpOperator::Name(const std::string &name) { | |||||
| (void)ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ArgOpOperator &ArgOpOperator::Index(int64_t index) { | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ArgOpOperator &ArgOpOperator::Index(int64_t index) { | ||||
| Attr("index", static_cast<int64_t>(index)); | Attr("index", static_cast<int64_t>(index)); | ||||
| @@ -25,8 +25,6 @@ class ArgOpOperator : public ParserOperator { | |||||
| ~ArgOpOperator() override; | ~ArgOpOperator() override; | ||||
| ArgOpOperator &Name(const std::string &name); | |||||
| ArgOpOperator &Index(int64_t index); | ArgOpOperator &Index(int64_t index); | ||||
| int64_t GetIndex() const; | int64_t GetIndex() const; | ||||
| @@ -25,11 +25,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator::ConstantOpera | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator::~ConstantOperator() {} | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator::~ConstantOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOperator::VectorAttr( | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOperator::VectorAttr( | ||||
| std::string key, std::vector<int64_t> &value) { | std::string key, std::vector<int64_t> &value) { | ||||
| Attr(key, value); | Attr(key, value); | ||||
| @@ -26,7 +26,6 @@ class ConstantOperator : public ParserOperator { | |||||
| ConstantOperator(); | ConstantOperator(); | ||||
| ~ConstantOperator() override; | ~ConstantOperator() override; | ||||
| ConstantOperator &Name(const std::string &name); | |||||
| ConstantOperator &VectorAttr(std::string key, std::vector<int64_t> &value); | ConstantOperator &VectorAttr(std::string key, std::vector<int64_t> &value); | ||||
| ConstantOperator &DType(ge::DataType t); | ConstantOperator &DType(ge::DataType t); | ||||
| @@ -24,12 +24,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY FrameworkOpOperator::FrameworkO | |||||
| FrameworkOpOperator::~FrameworkOpOperator() {} | FrameworkOpOperator::~FrameworkOpOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY FrameworkOpOperator &FrameworkOpOperator::Name( | |||||
| const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY FrameworkOpOperator &FrameworkOpOperator::Index(int64_t index) { | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY FrameworkOpOperator &FrameworkOpOperator::Index(int64_t index) { | ||||
| Attr(RETVAL_ATTR_NAME_INDEX, static_cast<int64_t>(index)); | Attr(RETVAL_ATTR_NAME_INDEX, static_cast<int64_t>(index)); | ||||
| return *this; | return *this; | ||||
| @@ -26,8 +26,6 @@ class FrameworkOpOperator : public ParserOperator { | |||||
| ~FrameworkOpOperator() override; | ~FrameworkOpOperator() override; | ||||
| FrameworkOpOperator &Name(const std::string &name); | |||||
| FrameworkOpOperator &OriginalType(const std::string &type); | FrameworkOpOperator &OriginalType(const std::string &type); | ||||
| FrameworkOpOperator &NodeDefPkg(const std::string &nodedef_pkg); | FrameworkOpOperator &NodeDefPkg(const std::string &nodedef_pkg); | ||||
| @@ -22,9 +22,4 @@ namespace ge { | |||||
| FMK_FUNC_HOST_VISIBILITY NoOpOperator::NoOpOperator() : ParserOperator("NoOp") {} | FMK_FUNC_HOST_VISIBILITY NoOpOperator::NoOpOperator() : ParserOperator("NoOp") {} | ||||
| FMK_FUNC_HOST_VISIBILITY NoOpOperator::~NoOpOperator() {} | FMK_FUNC_HOST_VISIBILITY NoOpOperator::~NoOpOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY NoOpOperator &NoOpOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| } // namespace ge | } // namespace ge | ||||
| @@ -25,8 +25,6 @@ class NoOpOperator : public ParserOperator { | |||||
| public: | public: | ||||
| NoOpOperator(); | NoOpOperator(); | ||||
| ~NoOpOperator() override; | ~NoOpOperator() override; | ||||
| NoOpOperator &Name(const std::string &name); | |||||
| }; | }; | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -45,7 +45,7 @@ class FMK_FUNC_HOST_VISIBILITY ParserOperator { | |||||
| ParserOperator &AttrVector(std::string key, std::vector<int32_t> &value); | ParserOperator &AttrVector(std::string key, std::vector<int32_t> &value); | ||||
| ParserOperator &AttrVector(std::string key, std::vector<int64_t> &value); | ParserOperator &AttrVector(std::string key, std::vector<int64_t> &value); | ||||
| ParserOperator &Name(const std::string &name); | |||||
| virtual ParserOperator &Name(const std::string &name); | |||||
| ParserOperator &Type(const std::string &type); | ParserOperator &Type(const std::string &type); | ||||
| @@ -22,11 +22,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::RefSwitchOpe | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::~RefSwitchOperator() {} | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::~RefSwitchOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator &RefSwitchOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator &RefSwitchOperator::T(ge::DataType t) { | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator &RefSwitchOperator::T(ge::DataType t) { | ||||
| Attr("T", (int64_t)t); | Attr("T", (int64_t)t); | ||||
| return *this; | return *this; | ||||
| @@ -25,8 +25,6 @@ class RefSwitchOperator : public ParserOperator { | |||||
| public: | public: | ||||
| RefSwitchOperator(); | RefSwitchOperator(); | ||||
| ~RefSwitchOperator() override; | ~RefSwitchOperator() override; | ||||
| RefSwitchOperator &Name(const std::string &name); | |||||
| RefSwitchOperator &T(ge::DataType t); | RefSwitchOperator &T(ge::DataType t); | ||||
| }; | }; | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -24,11 +24,6 @@ FMK_FUNC_HOST_VISIBILITY ShapeNOperator::ShapeNOperator() : ParserOperator("Shap | |||||
| FMK_FUNC_HOST_VISIBILITY ShapeNOperator::~ShapeNOperator() {} | FMK_FUNC_HOST_VISIBILITY ShapeNOperator::~ShapeNOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::N(int64_t n) { | FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::N(int64_t n) { | ||||
| Attr(SHAPEN_ATTR_N, n); | Attr(SHAPEN_ATTR_N, n); | ||||
| return *this; | return *this; | ||||
| @@ -26,8 +26,6 @@ class ShapeNOperator : public ParserOperator { | |||||
| ShapeNOperator(); | ShapeNOperator(); | ||||
| ~ShapeNOperator() override; | ~ShapeNOperator() override; | ||||
| ShapeNOperator &Name(const std::string &name); | |||||
| ShapeNOperator &N(int64_t n); | ShapeNOperator &N(int64_t n); | ||||
| int64_t GetN() const; | int64_t GetN() const; | ||||
| ShapeNOperator &InType(ge::DataType t); | ShapeNOperator &InType(ge::DataType t); | ||||
| @@ -24,11 +24,6 @@ VarIsInitializedOpOperator::VarIsInitializedOpOperator() : ParserOperator(ge::pa | |||||
| VarIsInitializedOpOperator::~VarIsInitializedOpOperator() {} | VarIsInitializedOpOperator::~VarIsInitializedOpOperator() {} | ||||
| VarIsInitializedOpOperator &VarIsInitializedOpOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| VarIsInitializedOpOperator &VarIsInitializedOpOperator::VectorAttr(const std::string &key, | VarIsInitializedOpOperator &VarIsInitializedOpOperator::VectorAttr(const std::string &key, | ||||
| std::vector<int64_t> &value) { | std::vector<int64_t> &value) { | ||||
| Attr(key, value); | Attr(key, value); | ||||
| @@ -26,7 +26,6 @@ class VarIsInitializedOpOperator : public ParserOperator { | |||||
| VarIsInitializedOpOperator(); | VarIsInitializedOpOperator(); | ||||
| ~VarIsInitializedOpOperator() override; | ~VarIsInitializedOpOperator() override; | ||||
| VarIsInitializedOpOperator &Name(const std::string &name); | |||||
| VarIsInitializedOpOperator &VectorAttr(const std::string &key, std::vector<int64_t> &value); | VarIsInitializedOpOperator &VectorAttr(const std::string &key, std::vector<int64_t> &value); | ||||
| }; | }; | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -23,11 +23,6 @@ VariableOperator::VariableOperator() : ParserOperator(ge::parser::VARIABLE) {} | |||||
| VariableOperator::~VariableOperator() {} | VariableOperator::~VariableOperator() {} | ||||
| VariableOperator &VariableOperator::Name(const std::string &name) { | |||||
| ParserOperator::Name(name); | |||||
| return *this; | |||||
| } | |||||
| VariableOperator &VariableOperator::Container(const std::string &container) { | VariableOperator &VariableOperator::Container(const std::string &container) { | ||||
| Attr(VAR_ATTR_CONTAINER, container); | Attr(VAR_ATTR_CONTAINER, container); | ||||
| return *this; | return *this; | ||||
| @@ -27,8 +27,6 @@ class VariableOperator : public ParserOperator { | |||||
| VariableOperator(); | VariableOperator(); | ||||
| ~VariableOperator() override; | ~VariableOperator() override; | ||||
| VariableOperator &Name(const std::string &name); | |||||
| VariableOperator &Container(const std::string &container); | VariableOperator &Container(const std::string &container); | ||||
| VariableOperator &SharedName(const std::string &sharedname); | VariableOperator &SharedName(const std::string &sharedname); | ||||
| @@ -32,6 +32,7 @@ | |||||
| #endif | #endif | ||||
| #include <map> | #include <map> | ||||
| #include <memory> | |||||
| #include <functional> | #include <functional> | ||||
| #include "subgraph_adapter.h" | #include "subgraph_adapter.h" | ||||