| @@ -17,6 +17,20 @@ | |||||
| #ifndef INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ | #ifndef INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ | ||||
| #define INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ | #define INC_EXTERNAL_ACL_GRAPH_CAFFE_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <memory> | #include <memory> | ||||
| #include <string> | #include <string> | ||||
| #include <vector> | #include <vector> | ||||
| @@ -27,9 +41,9 @@ | |||||
| #include "graph/types.h" | #include "graph/types.h" | ||||
| namespace ge { | namespace ge { | ||||
| graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, ge::Graph &graph); | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, ge::Graph &graph); | |||||
| graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, | |||||
| const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -17,16 +17,30 @@ | |||||
| #ifndef INC_EXTERNAL_PARSER_ONNX_PARSER_H_ | #ifndef INC_EXTERNAL_PARSER_ONNX_PARSER_H_ | ||||
| #define INC_EXTERNAL_PARSER_ONNX_PARSER_H_ | #define INC_EXTERNAL_PARSER_ONNX_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include "graph/ascend_string.h" | #include "graph/ascend_string.h" | ||||
| #include "graph/ge_error_codes.h" | #include "graph/ge_error_codes.h" | ||||
| #include "graph/graph.h" | #include "graph/graph.h" | ||||
| #include "graph/types.h" | #include "graph/types.h" | ||||
| namespace ge { | namespace ge { | ||||
| graphStatus aclgrphParseONNX(const char *model_file, | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseONNX(const char *model_file, | |||||
| const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | ||||
| graphStatus aclgrphParseONNXFromMem(const char *buffer, size_t size, | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseONNXFromMem(const char *buffer, size_t size, | |||||
| const std::map<ge::AscendString, ge::AscendString> &parser_params, | const std::map<ge::AscendString, ge::AscendString> &parser_params, | ||||
| ge::Graph &graph); | ge::Graph &graph); | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ | #ifndef INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ | ||||
| #define INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ | #define INC_EXTERNAL_ACL_PARSER_TENSORFLOW_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <atomic> | #include <atomic> | ||||
| #include <memory> | #include <memory> | ||||
| #include <string> | #include <string> | ||||
| @@ -28,8 +42,8 @@ | |||||
| #include "graph/types.h" | #include "graph/types.h" | ||||
| namespace ge { | namespace ge { | ||||
| graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph); | |||||
| graphStatus aclgrphParseTensorFlow(const char *model_file, | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph); | |||||
| PARSER_FUNC_VISIBILITY graphStatus aclgrphParseTensorFlow(const char *model_file, | |||||
| const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | const std::map<ge::AscendString, ge::AscendString> &parser_params, ge::Graph &graph); | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -50,12 +50,14 @@ target_compile_options(fmk_parser PRIVATE | |||||
| -Werror | -Werror | ||||
| -Wno-deprecated-declarations | -Wno-deprecated-declarations | ||||
| -fno-common | -fno-common | ||||
| -fvisibility=hidden | |||||
| ) | ) | ||||
| target_compile_definitions(fmk_parser PRIVATE | target_compile_definitions(fmk_parser PRIVATE | ||||
| PROTOBUF_INLINE_NOT_IN_HEADERS=0 | PROTOBUF_INLINE_NOT_IN_HEADERS=0 | ||||
| google=ascend_private | google=ascend_private | ||||
| $<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC> | $<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC> | ||||
| FUNC_VISIBILITY | |||||
| ) | ) | ||||
| target_include_directories(fmk_parser PRIVATE | target_include_directories(fmk_parser PRIVATE | ||||
| @@ -92,6 +94,10 @@ target_include_directories(fmk_parser PRIVATE | |||||
| ${METADEF_DIR}/third_party/fwkacllib/inc | ${METADEF_DIR}/third_party/fwkacllib/inc | ||||
| ) | ) | ||||
| target_link_options(fmk_parser PRIVATE | |||||
| -Wl,-Bsymbolic | |||||
| ) | |||||
| target_link_libraries(fmk_parser | target_link_libraries(fmk_parser | ||||
| $<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
| static_mmpa | static_mmpa | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/caffe/caffe_op_parser.h" | #include "parser/caffe/caffe_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class CaffeCustomParserAdapter : public CaffeOpParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeCustomParserAdapter : public CaffeOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -78,7 +78,7 @@ Status CaffeDataParser::ParseParamsForInput(const domi::caffe::LayerParameter *l | |||||
| for (int i = 0; i < input_param.shape_size(); i++) { | for (int i = 0; i < input_param.shape_size(); i++) { | ||||
| const domi::caffe::BlobShape &blob_shape = input_param.shape(i); | const domi::caffe::BlobShape &blob_shape = input_param.shape(i); | ||||
| vector<int64_t> shape; | vector<int64_t> shape; | ||||
| unordered_map<string, vector<int64_t>> &shape_map = GetParserContext().input_dims; | |||||
| std::map<string, vector<int64_t>> &shape_map = GetParserContext().input_dims; | |||||
| std::vector<int64_t> model_dims; | std::vector<int64_t> model_dims; | ||||
| for (auto &blob_shape_dim_temp : blob_shape.dim()) { | for (auto &blob_shape_dim_temp : blob_shape.dim()) { | ||||
| model_dims.push_back(blob_shape_dim_temp); | model_dims.push_back(blob_shape_dim_temp); | ||||
| @@ -91,7 +91,7 @@ Status CaffeDataParser::ParseParamsForInput(const domi::caffe::LayerParameter *l | |||||
| } else { | } else { | ||||
| // Get from external input | // Get from external input | ||||
| const ge::ParserContext &ctx = GetParserContext(); | const ge::ParserContext &ctx = GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| string name = layer->name(); | string name = layer->name(); | ||||
| auto search = input_dims.find(name); | auto search = input_dims.find(name); | ||||
| if (search == input_dims.end()) { | if (search == input_dims.end()) { | ||||
| @@ -124,7 +124,7 @@ Status CaffeDataParser::ParseParamsForDummyData(const domi::caffe::LayerParamete | |||||
| const domi::caffe::BlobShape &blob_shape = dummy_data_param.shape(i); | const domi::caffe::BlobShape &blob_shape = dummy_data_param.shape(i); | ||||
| vector<int64_t> shape; | vector<int64_t> shape; | ||||
| unordered_map<string, vector<int64_t>> &shape_map = GetParserContext().input_dims; | |||||
| std::map<string, vector<int64_t>> &shape_map = GetParserContext().input_dims; | |||||
| std::vector<int64_t> model_dims; | std::vector<int64_t> model_dims; | ||||
| for (auto &blob_shape_dim_temp : blob_shape.dim()) { | for (auto &blob_shape_dim_temp : blob_shape.dim()) { | ||||
| model_dims.push_back(blob_shape_dim_temp); | model_dims.push_back(blob_shape_dim_temp); | ||||
| @@ -138,7 +138,7 @@ Status CaffeDataParser::ParseParamsForDummyData(const domi::caffe::LayerParamete | |||||
| } else { | } else { | ||||
| // Get from external input | // Get from external input | ||||
| const ge::ParserContext &ctx = GetParserContext(); | const ge::ParserContext &ctx = GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| string name = layer->name(); | string name = layer->name(); | ||||
| auto search = input_dims.find(name); | auto search = input_dims.find(name); | ||||
| if (search == input_dims.end()) { | if (search == input_dims.end()) { | ||||
| @@ -23,7 +23,7 @@ | |||||
| #include "parser/common/data_op_parser.h" | #include "parser/common/data_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class CaffeDataParser : public CaffeOpParser, public DataOpParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeDataParser : public CaffeOpParser, public DataOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef PARSER_CAFFE_CAFFE_OP_PARSER_H_ | #ifndef PARSER_CAFFE_CAFFE_OP_PARSER_H_ | ||||
| #define PARSER_CAFFE_CAFFE_OP_PARSER_H_ | #define PARSER_CAFFE_CAFFE_OP_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <vector> | #include <vector> | ||||
| #include "graph/debug/ge_attr_define.h" | #include "graph/debug/ge_attr_define.h" | ||||
| #include "common/util.h" | #include "common/util.h" | ||||
| @@ -54,7 +68,7 @@ namespace ge { | |||||
| * @ingroup ge_omg | * @ingroup ge_omg | ||||
| * @brief Used to parse Caffe operator information | * @brief Used to parse Caffe operator information | ||||
| */ | */ | ||||
| class CaffeOpParser : public OpParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeOpParser : public OpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||
| @@ -330,7 +330,7 @@ Status CaffeModelParser::ParseInput(domi::caffe::NetParameter &proto_message, bo | |||||
| } | } | ||||
| } else { | } else { | ||||
| const ge::ParserContext &ctx = ge::GetParserContext(); | const ge::ParserContext &ctx = ge::GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| for (int i = 0; i < proto_message.input_size(); i++) { | for (int i = 0; i < proto_message.input_size(); i++) { | ||||
| string name = proto_message.input(i); | string name = proto_message.input(i); | ||||
| if (input_dims.count(name) == 0) { // Input defined by model does not exist in input of external input | if (input_dims.count(name) == 0) { // Input defined by model does not exist in input of external input | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef PARSER_CAFFE_CAFFE_PARSER_H_ | #ifndef PARSER_CAFFE_CAFFE_PARSER_H_ | ||||
| #define PARSER_CAFFE_CAFFE_PARSER_H_ | #define PARSER_CAFFE_CAFFE_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <map> | #include <map> | ||||
| #include <set> | #include <set> | ||||
| #include <string> | #include <string> | ||||
| @@ -39,7 +53,7 @@ using std::unordered_map; | |||||
| using std::vector; | using std::vector; | ||||
| 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 CaffeModelParser : public domi::ModelParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeModelParser : public domi::ModelParser { | |||||
| public: | public: | ||||
| CaffeModelParser() {} | CaffeModelParser() {} | ||||
| virtual ~CaffeModelParser() {} | virtual ~CaffeModelParser() {} | ||||
| @@ -362,10 +376,10 @@ class CaffeModelParser : public domi::ModelParser { | |||||
| std::map<std::string, ge::NodePtr> node_map; | std::map<std::string, ge::NodePtr> node_map; | ||||
| // key: blob name, value: layer name and index | // key: blob name, value: layer name and index | ||||
| std::unordered_map<std::string, std::vector<std::pair<std::string, int32_t>>> bottom_blobs_map_; | |||||
| std::map<std::string, std::vector<std::pair<std::string, int32_t>>> bottom_blobs_map_; | |||||
| // key: blob name, value: layer name and index | // key: blob name, value: layer name and index | ||||
| std::unordered_map<std::string, std::vector<std::pair<std::string, int32_t>>> top_blobs_map_; | |||||
| std::map<std::string, std::vector<std::pair<std::string, int32_t>>> top_blobs_map_; | |||||
| std::vector<ge::Operator> custom_operator_; | std::vector<ge::Operator> custom_operator_; | ||||
| std::map<std::string, std::vector<std::string>> layer_tops_map_; | std::map<std::string, std::vector<std::string>> layer_tops_map_; | ||||
| @@ -375,7 +389,7 @@ class CaffeModelParser : public domi::ModelParser { | |||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| * @brief Caffe weight parser | * @brief Caffe weight parser | ||||
| */ | */ | ||||
| class CaffeWeightsParser : public domi::WeightsParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeWeightsParser : public domi::WeightsParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/caffe/caffe_op_parser.h" | #include "parser/caffe/caffe_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class CaffeReshapeParser : public CaffeOpParser { | |||||
| class PARSER_FUNC_VISIBILITY CaffeReshapeParser : public CaffeOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -74,6 +74,10 @@ target_include_directories(parser_common PRIVATE | |||||
| ${METADEF_DIR}/third_party/fwkacllib/inc | ${METADEF_DIR}/third_party/fwkacllib/inc | ||||
| ) | ) | ||||
| target_link_options(parser_common PRIVATE | |||||
| -Wl,-Bsymbolic | |||||
| ) | |||||
| target_link_libraries(parser_common PRIVATE | target_link_libraries(parser_common PRIVATE | ||||
| $<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
| static_mmpa | static_mmpa | ||||
| @@ -20,11 +20,13 @@ target_compile_options(fmk_onnx_parser PRIVATE | |||||
| -Werror | -Werror | ||||
| -Wno-deprecated-declarations | -Wno-deprecated-declarations | ||||
| -fno-common | -fno-common | ||||
| -fvisibility=hidden | |||||
| ) | ) | ||||
| target_compile_definitions(fmk_onnx_parser PRIVATE | target_compile_definitions(fmk_onnx_parser PRIVATE | ||||
| PROTOBUF_INLINE_NOT_IN_HEADERS=0 | PROTOBUF_INLINE_NOT_IN_HEADERS=0 | ||||
| google=ascend_private | google=ascend_private | ||||
| FUNC_VISIBILITY | |||||
| ) | ) | ||||
| target_include_directories(fmk_onnx_parser PRIVATE | target_include_directories(fmk_onnx_parser PRIVATE | ||||
| @@ -62,6 +64,10 @@ target_include_directories(fmk_onnx_parser PRIVATE | |||||
| ${METADEF_DIR}/third_party/fwkacllib/inc | ${METADEF_DIR}/third_party/fwkacllib/inc | ||||
| ) | ) | ||||
| target_link_options(fmk_onnx_parser PRIVATE | |||||
| -Wl,-Bsymbolic | |||||
| ) | |||||
| target_link_libraries(fmk_onnx_parser PRIVATE | target_link_libraries(fmk_onnx_parser PRIVATE | ||||
| $<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
| static_mmpa | static_mmpa | ||||
| @@ -69,7 +75,7 @@ target_link_libraries(fmk_onnx_parser PRIVATE | |||||
| ascend_protobuf | ascend_protobuf | ||||
| register | register | ||||
| c_sec | c_sec | ||||
| parser_common | |||||
| parser_common | |||||
| graph | graph | ||||
| slog | slog | ||||
| -Wl,--as-needed | -Wl,--as-needed | ||||
| @@ -24,7 +24,7 @@ | |||||
| using ge::onnx::NodeProto; | using ge::onnx::NodeProto; | ||||
| namespace ge { | namespace ge { | ||||
| class OnnxConstantParser : public OnnxOpParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxConstantParser : public OnnxOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::Operator &op_def) override; | Status ParseParams(const Message *op_src, ge::Operator &op_def) override; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/onnx/onnx_op_parser.h" | #include "parser/onnx/onnx_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class OnnxCustomParserAdapter : public OnnxOpParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxCustomParserAdapter : public OnnxOpParser { | |||||
| public: | public: | ||||
| /// @brief Parsing model file information | /// @brief Parsing model file information | ||||
| /// @param [in] op_src model data to be parsed | /// @param [in] op_src model data to be parsed | ||||
| @@ -94,7 +94,7 @@ Status OnnxDataParser::ParseInputFromModel(const Message *op_src, ge::Operator & | |||||
| } | } | ||||
| Status OnnxDataParser::ParseInputFromUser(const ge::Operator &op_def) { | Status OnnxDataParser::ParseInputFromUser(const ge::Operator &op_def) { | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = GetParserContext().input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = GetParserContext().input_dims; | |||||
| // User not designate the input_shape | // User not designate the input_shape | ||||
| std::string name = op_def.GetName(); | std::string name = op_def.GetName(); | ||||
| if (input_dims.count(name) == 0) { | if (input_dims.count(name) == 0) { | ||||
| @@ -23,7 +23,7 @@ | |||||
| #include "parser/onnx/onnx_op_parser.h" | #include "parser/onnx/onnx_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class OnnxDataParser : public OnnxOpParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxDataParser : public OnnxOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::Operator &op_def) override; | Status ParseParams(const Message *op_src, ge::Operator &op_def) override; | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef GE_PARSER_ONNX_ONNX_OP_PARSER_H_ | #ifndef GE_PARSER_ONNX_ONNX_OP_PARSER_H_ | ||||
| #define GE_PARSER_ONNX_ONNX_OP_PARSER_H_ | #define GE_PARSER_ONNX_ONNX_OP_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <string> | #include <string> | ||||
| #include <vector> | #include <vector> | ||||
| #include "framework/common/op/attr_value_util.h" | #include "framework/common/op/attr_value_util.h" | ||||
| @@ -28,7 +42,7 @@ | |||||
| using Status = domi::Status; | using Status = domi::Status; | ||||
| namespace ge { | namespace ge { | ||||
| class OnnxOpParser : public OpParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxOpParser : public OpParser { | |||||
| public: | public: | ||||
| /// @brief parse params | /// @brief parse params | ||||
| /// @param [in] op_src op to be parsed | /// @param [in] op_src op to be parsed | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef PARSER_ONNX_ONNX_PARSER_H_ | #ifndef PARSER_ONNX_ONNX_PARSER_H_ | ||||
| #define PARSER_ONNX_ONNX_PARSER_H_ | #define PARSER_ONNX_ONNX_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <map> | #include <map> | ||||
| #include <string> | #include <string> | ||||
| #include <vector> | #include <vector> | ||||
| @@ -27,7 +41,7 @@ | |||||
| #include "proto/onnx/ge_onnx.pb.h" | #include "proto/onnx/ge_onnx.pb.h" | ||||
| namespace ge { | namespace ge { | ||||
| class OnnxModelParser : public domi::ModelParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxModelParser : public domi::ModelParser { | |||||
| public: | public: | ||||
| OnnxModelParser() {} | OnnxModelParser() {} | ||||
| virtual ~OnnxModelParser() {} | virtual ~OnnxModelParser() {} | ||||
| @@ -96,12 +110,12 @@ class OnnxModelParser : public domi::ModelParser { | |||||
| std::vector<std::string> input_node_names_; | std::vector<std::string> input_node_names_; | ||||
| std::unordered_map<std::string, std::vector<std::pair<std::string, int>>> inputs_map_; | |||||
| std::map<std::string, std::vector<std::pair<std::string, int>>> inputs_map_; | |||||
| std::unordered_map<std::string, std::vector<std::pair<std::string, int>>> outputs_map_; | |||||
| std::map<std::string, std::vector<std::pair<std::string, int>>> outputs_map_; | |||||
| }; | }; | ||||
| class OnnxWeightsParser : public domi::WeightsParser { | |||||
| class PARSER_FUNC_VISIBILITY OnnxWeightsParser : public domi::WeightsParser { | |||||
| public: | public: | ||||
| Status Parse(const char *file, ge::Graph &graph) override { return domi::SUCCESS; } | Status Parse(const char *file, ge::Graph &graph) override { return domi::SUCCESS; } | ||||
| @@ -15,6 +15,10 @@ target_include_directories(_caffe_parser PRIVATE | |||||
| ${CMAKE_CURRENT_LIST_DIR} | ${CMAKE_CURRENT_LIST_DIR} | ||||
| ) | ) | ||||
| target_link_options(_caffe_parser PRIVATE | |||||
| -Wl,-Bsymbolic | |||||
| ) | |||||
| target_link_libraries(_caffe_parser PRIVATE | target_link_libraries(_caffe_parser PRIVATE | ||||
| $<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
| -Wl,--no-as-needed | -Wl,--no-as-needed | ||||
| @@ -112,7 +112,7 @@ domi::Status ComputeArgRange(const domi::tensorflow::NodeDef &node_def, const do | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| using NameRangeMap = std::unordered_map<string, std::pair<int, int>>; | |||||
| using NameRangeMap = std::map<string, std::pair<int, int>>; | |||||
| domi::Status NameRangesHelper(const domi::tensorflow::NodeDef &node_def, | domi::Status NameRangesHelper(const domi::tensorflow::NodeDef &node_def, | ||||
| const google::protobuf::RepeatedPtrField<domi::tensorflow::OpDef_ArgDef> &args, | const google::protobuf::RepeatedPtrField<domi::tensorflow::OpDef_ArgDef> &args, | ||||
| @@ -136,8 +136,8 @@ domi::Status NameRangesForNode(const domi::tensorflow::NodeDef &node_def, const | |||||
| } | } | ||||
| domi::Status RemapFunctionDef(FunctionDef *fdef, const string &name, NameMapHelper &node_names, | domi::Status RemapFunctionDef(FunctionDef *fdef, const string &name, NameMapHelper &node_names, | ||||
| std::unordered_map<string, string> &tensor_renaming, | |||||
| std::unordered_map<string, string> &return_values) { | |||||
| std::map<string, string> &tensor_renaming, | |||||
| std::map<string, string> &return_values) { | |||||
| GE_CHECK_NOTNULL(fdef); | GE_CHECK_NOTNULL(fdef); | ||||
| // Detect missing function inputs.. | // Detect missing function inputs.. | ||||
| for (int i = 0; i < fdef->signature().input_arg_size(); ++i) { | for (int i = 0; i < fdef->signature().input_arg_size(); ++i) { | ||||
| @@ -324,8 +324,8 @@ domi::Status GraphToFunctionDef::DavGraphToFunctionDef(ge::ComputeGraphPtr graph | |||||
| GE_CHECK_NOTNULL(fdef); | GE_CHECK_NOTNULL(fdef); | ||||
| fdef->mutable_signature()->set_name(name); | fdef->mutable_signature()->set_name(name); | ||||
| std::unordered_map<string, string> tensor_renaming; | |||||
| std::unordered_map<string, string> return_values; | |||||
| std::map<string, string> tensor_renaming; | |||||
| std::map<string, string> return_values; | |||||
| NameMapHelper node_names; | NameMapHelper node_names; | ||||
| for (const ge::NodePtr &node : graph->GetDirectNode()) { | for (const ge::NodePtr &node : graph->GetDirectNode()) { | ||||
| @@ -83,7 +83,7 @@ class NameMapHelper { | |||||
| string GetUniqueName(const string &name); | string GetUniqueName(const string &name); | ||||
| std::set<string> used_names_; | std::set<string> used_names_; | ||||
| std::unordered_map<string, string> name_mapping_; | |||||
| std::map<string, string> name_mapping_; | |||||
| }; | }; | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowAutoMappingParserAdapter : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowAutoMappingParserAdapter : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||
| }; | }; | ||||
| @@ -25,7 +25,7 @@ | |||||
| using domi::tensorflow::NodeDef; | using domi::tensorflow::NodeDef; | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowConstantParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowConstantParser : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowCustomParserAdapter : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowCustomParserAdapter : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -102,7 +102,7 @@ Status TensorFlowDataParser::ParseInputFromUser(const Message *op_src, const ge: | |||||
| GE_CHECK_NOTNULL(op_def); | GE_CHECK_NOTNULL(op_def); | ||||
| (void)op_src; | (void)op_src; | ||||
| const ge::ParserContext &ctx = GetParserContext(); | const ge::ParserContext &ctx = GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| // User not designate the input_shape | // User not designate the input_shape | ||||
| std::string name = op_def->GetName(); | std::string name = op_def->GetName(); | ||||
| if (input_dims.count(name) == 0) { | if (input_dims.count(name) == 0) { | ||||
| @@ -23,7 +23,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowDataParser : public TensorFlowOpParser, public DataOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowDataParser : public TensorFlowOpParser, public DataOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowEnterParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowEnterParser : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_desc) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_desc) override; | ||||
| }; | }; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_fusion_op_parser.h" | #include "parser/tensorflow/tensorflow_fusion_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowFusionCustomParserAdapter : public TensorFlowFusionOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowFusionCustomParserAdapter : public TensorFlowFusionOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_parser | * @ingroup domi_parser | ||||
| @@ -37,7 +37,7 @@ namespace ge { | |||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| * @brief Used to parse TensorFlow operator information | * @brief Used to parse TensorFlow operator information | ||||
| */ | */ | ||||
| class TensorFlowFusionOpParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowFusionOpParser : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowIdentityParser : public TensorFlowOpParser {}; | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowIdentityParser : public TensorFlowOpParser {}; | |||||
| } // namespace ge | } // namespace ge | ||||
| #endif // GE_PARSER_TENSORFLOW_TENSORFLOW_IDENTITY_H_ | #endif // GE_PARSER_TENSORFLOW_TENSORFLOW_IDENTITY_H_ | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowMergeParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowMergeParser : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_desc) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_desc) override; | ||||
| }; | }; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowNoOpParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowNoOpParser : public TensorFlowOpParser { | |||||
| // AUTO GEN PLEASE DO NOT MODIFY IT | // AUTO GEN PLEASE DO NOT MODIFY IT | ||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||
| @@ -17,6 +17,20 @@ | |||||
| #ifndef OMG_PARSER_TENSORFLOW_TENSORFLOW_OP_PARSER_H_ | #ifndef OMG_PARSER_TENSORFLOW_TENSORFLOW_OP_PARSER_H_ | ||||
| #define OMG_PARSER_TENSORFLOW_TENSORFLOW_OP_PARSER_H_ | #define OMG_PARSER_TENSORFLOW_TENSORFLOW_OP_PARSER_H_ | ||||
| #if defined(_MSC_VER) | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY _declspec(dllexport) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #else | |||||
| #ifdef FUNC_VISIBILITY | |||||
| #define PARSER_FUNC_VISIBILITY __attribute__((visibility("default"))) | |||||
| #else | |||||
| #define PARSER_FUNC_VISIBILITY | |||||
| #endif | |||||
| #endif | |||||
| #include <string> | #include <string> | ||||
| #include <vector> | #include <vector> | ||||
| #include "framework/common/op/attr_value_util.h" | #include "framework/common/op/attr_value_util.h" | ||||
| @@ -52,7 +66,7 @@ namespace ge { | |||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| * @brief used to parse TensorFlow operator information | * @brief used to parse TensorFlow operator information | ||||
| */ | */ | ||||
| class TensorFlowOpParser : public OpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowOpParser : public OpParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| @@ -2962,7 +2962,7 @@ Status TensorFlowModelParser::TrimGraphByInput(const domi::tensorflow::GraphDef | |||||
| TensorShapeProto *data_shape = attr_value.mutable_shape(); | TensorShapeProto *data_shape = attr_value.mutable_shape(); | ||||
| GE_CHECK_NOTNULL(data_shape); | GE_CHECK_NOTNULL(data_shape); | ||||
| const ge::ParserContext &ctx = ge::GetParserContext(); | const ge::ParserContext &ctx = ge::GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::vector<int64_t> designated_dims = input_dims.at(node.name()); | std::vector<int64_t> designated_dims = input_dims.at(node.name()); | ||||
| for (int32_t i = 0; i < (int32_t)designated_dims.size(); i++) { | for (int32_t i = 0; i < (int32_t)designated_dims.size(); i++) { | ||||
| data_shape->add_dim()->set_size(designated_dims[i]); | data_shape->add_dim()->set_size(designated_dims[i]); | ||||
| @@ -3035,7 +3035,7 @@ Status TensorFlowModelParser::TrimGraphByOutput(const domi::tensorflow::GraphDef | |||||
| TensorShapeProto *data_shape = attr_value.mutable_shape(); | TensorShapeProto *data_shape = attr_value.mutable_shape(); | ||||
| GE_CHECK_NOTNULL(data_shape); | GE_CHECK_NOTNULL(data_shape); | ||||
| const ge::ParserContext &ctx = ge::GetParserContext(); | const ge::ParserContext &ctx = ge::GetParserContext(); | ||||
| std::unordered_map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::map<std::string, std::vector<int64_t>> input_dims = ctx.input_dims; | |||||
| std::vector<int64_t> designated_dims = input_dims.at(node.name()); | std::vector<int64_t> designated_dims = input_dims.at(node.name()); | ||||
| for (int32_t i = 0; i < (int32_t)designated_dims.size(); i++) { | for (int32_t i = 0; i < (int32_t)designated_dims.size(); i++) { | ||||
| data_shape->add_dim()->set_size(designated_dims[i]); | data_shape->add_dim()->set_size(designated_dims[i]); | ||||
| @@ -74,7 +74,7 @@ struct OpNodeContext { | |||||
| }; | }; | ||||
| struct DelTransposeInfo; | struct DelTransposeInfo; | ||||
| class TensorFlowModelParser : public domi::ModelParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowModelParser : public domi::ModelParser { | |||||
| public: | public: | ||||
| TensorFlowModelParser() {} | TensorFlowModelParser() {} | ||||
| virtual ~TensorFlowModelParser() {} | virtual ~TensorFlowModelParser() {} | ||||
| @@ -649,15 +649,15 @@ class TensorFlowModelParser : public domi::ModelParser { | |||||
| /** | /** | ||||
| * save <node_name, nodeDefList> | * save <node_name, nodeDefList> | ||||
| */ | */ | ||||
| unordered_map<string, vector<const NodeDef *>> fusion_op_nodedef_map_; | |||||
| map<string, vector<const NodeDef *>> fusion_op_nodedef_map_; | |||||
| // Policy types of fusion operators,true:scope_pass match,false:prefix match | // Policy types of fusion operators,true:scope_pass match,false:prefix match | ||||
| unordered_map<string, bool> fusion_op_policy_; | |||||
| map<string, bool> fusion_op_policy_; | |||||
| // The names of all children operators and the description of fusion operators | // The names of all children operators and the description of fusion operators | ||||
| unordered_map<string, ge::ScopeFusionOpInfo> fusion_op_children_; | unordered_map<string, ge::ScopeFusionOpInfo> fusion_op_children_; | ||||
| /** | /** | ||||
| * save <node_name, {fusionOpName,description}> | * save <node_name, {fusionOpName,description}> | ||||
| */ | */ | ||||
| unordered_map<string, vector<string>> fusion_op_type_map_; | |||||
| map<string, vector<string>> fusion_op_type_map_; | |||||
| /** | /** | ||||
| * save nodedef of the fusion operator | * save nodedef of the fusion operator | ||||
| */ | */ | ||||
| @@ -665,17 +665,17 @@ class TensorFlowModelParser : public domi::ModelParser { | |||||
| /** | /** | ||||
| * control edge,{Key=NodeName,Value=index} | * control edge,{Key=NodeName,Value=index} | ||||
| */ | */ | ||||
| unordered_map<string, vector<int32_t>> edges_control_map; | |||||
| map<string, vector<int32_t>> edges_control_map; | |||||
| unordered_map<string, const domi::tensorflow::NodeDef *> framework_ops_; | unordered_map<string, const domi::tensorflow::NodeDef *> framework_ops_; | ||||
| /** | /** | ||||
| * save <node_name, op_type> | * save <node_name, op_type> | ||||
| */ | */ | ||||
| unordered_map<string, string> adaptedOpTypeMap_; | |||||
| map<string, string> adaptedOpTypeMap_; | |||||
| // { node_name <{input_node_name}, {output_node_name}> } | // { node_name <{input_node_name}, {output_node_name}> } | ||||
| unordered_map<string, std::pair<set<string>, set<string>>> node_inputs_outputs_map_; | |||||
| map<string, std::pair<set<string>, set<string>>> node_inputs_outputs_map_; | |||||
| unordered_map<string, const ge::Operator *> scope_inner_node_map_; | unordered_map<string, const ge::Operator *> scope_inner_node_map_; | ||||
| }; | }; | ||||
| @@ -684,7 +684,7 @@ class TensorFlowModelParser : public domi::ModelParser { | |||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| * @brief Tensorflow weight parse | * @brief Tensorflow weight parse | ||||
| */ | */ | ||||
| class TensorFlowWeightsParser : public domi::WeightsParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowWeightsParser : public domi::WeightsParser { | |||||
| public: | public: | ||||
| /** | /** | ||||
| * @ingroup domi_omg | * @ingroup domi_omg | ||||
| @@ -33,13 +33,13 @@ | |||||
| using domi::tensorflow::NodeDef; | using domi::tensorflow::NodeDef; | ||||
| namespace ge { | namespace ge { | ||||
| class TensorflowFinalizeable { | |||||
| class PARSER_FUNC_VISIBILITY TensorflowFinalizeable { | |||||
| public: | public: | ||||
| virtual bool Finalize() = 0; | virtual bool Finalize() = 0; | ||||
| virtual ~TensorflowFinalizeable() {} | virtual ~TensorflowFinalizeable() {} | ||||
| }; | }; | ||||
| class TensorflowReceiver { | |||||
| class PARSER_FUNC_VISIBILITY TensorflowReceiver { | |||||
| public: | public: | ||||
| TensorflowReceiver(TensorflowFinalizeable &f) { f.Finalize(); } | TensorflowReceiver(TensorflowFinalizeable &f) { f.Finalize(); } | ||||
| ~TensorflowReceiver() {} | ~TensorflowReceiver() {} | ||||
| @@ -49,7 +49,7 @@ namespace tensorflow_parser { | |||||
| template <typename Param> | template <typename Param> | ||||
| class TensorflowParserBuilder; | class TensorflowParserBuilder; | ||||
| class TensorflowWeightParserBuilder : public TensorflowFinalizeable { | |||||
| class PARSER_FUNC_VISIBILITY TensorflowWeightParserBuilder : public TensorflowFinalizeable { | |||||
| public: | public: | ||||
| virtual ~TensorflowWeightParserBuilder() {} | virtual ~TensorflowWeightParserBuilder() {} | ||||
| }; | }; | ||||
| @@ -58,7 +58,7 @@ template <typename Param> | |||||
| class TensorflowOpParserAdapter; | class TensorflowOpParserAdapter; | ||||
| template <typename Param> | template <typename Param> | ||||
| class TensorflowParserBuilder : public TensorflowWeightParserBuilder { | |||||
| class PARSER_FUNC_VISIBILITY TensorflowParserBuilder : public TensorflowWeightParserBuilder { | |||||
| public: | public: | ||||
| using ParseParamsFn = std::function<domi::Status(const domi::tensorflow::NodeDef *, Param *)>; | using ParseParamsFn = std::function<domi::Status(const domi::tensorflow::NodeDef *, Param *)>; | ||||
| @@ -91,7 +91,7 @@ class TensorflowParserBuilder : public TensorflowWeightParserBuilder { | |||||
| }; | }; | ||||
| template <typename Param> | template <typename Param> | ||||
| class TensorflowOpParserAdapter : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorflowOpParserAdapter : public TensorFlowOpParser { | |||||
| using ParseParamsFn = std::function<domi::Status(const domi::tensorflow::NodeDef *, Param *)>; | using ParseParamsFn = std::function<domi::Status(const domi::tensorflow::NodeDef *, Param *)>; | ||||
| public: | public: | ||||
| @@ -23,7 +23,7 @@ | |||||
| using domi::tensorflow::NodeDef; | using domi::tensorflow::NodeDef; | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowRefSwitchParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowRefSwitchParser : public TensorFlowOpParser { | |||||
| // AUTO GEN PLEASE DO NOT MODIFY IT | // AUTO GEN PLEASE DO NOT MODIFY IT | ||||
| public: | public: | ||||
| /** | /** | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowReshapeParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowReshapeParser : public TensorFlowOpParser { | |||||
| private: | private: | ||||
| Status ParseDesc(const domi::tensorflow::AttrValue &attr_value, ge::GeTensorDesc &ge_desc); | Status ParseDesc(const domi::tensorflow::AttrValue &attr_value, ge::GeTensorDesc &ge_desc); | ||||
| @@ -23,7 +23,7 @@ | |||||
| using domi::tensorflow::NodeDef; | using domi::tensorflow::NodeDef; | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowShapeNParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowShapeNParser : public TensorFlowOpParser { | |||||
| // AUTO GEN PLEASE DO NOT MODIFY IT | // AUTO GEN PLEASE DO NOT MODIFY IT | ||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "parser/tensorflow/tensorflow_op_parser.h" | #include "parser/tensorflow/tensorflow_op_parser.h" | ||||
| namespace ge { | namespace ge { | ||||
| class TensorFlowSqueezeParser : public TensorFlowOpParser { | |||||
| class PARSER_FUNC_VISIBILITY TensorFlowSqueezeParser : public TensorFlowOpParser { | |||||
| public: | public: | ||||
| Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; | ||||