已合并
【PR】: [fix] [autofuse] fix codecheck. #4787
【PR】: [fix] [autofuse] fix codecheck. #4787
已合并
邢智雄创建于 1 天前
2 个文件变更+8-2
@@ -91,7 +91,6 @@ Status CubeFixpip(AscGraph &graph, const NodePtr &asc_node) {
91 return SUCCESS;91 return SUCCESS;
92 }92 }
93 // 当前不需要删除relu节点,以防遇到不支持fixpip的tiling key需要走ub模板93 // 当前不需要删除relu节点,以防遇到不支持fixpip的tiling key需要走ub模板
94- // GE_ASSERT_SUCCESS(asc_adapt::DelNode(graph, peer_in_node));
95 // 后续需要删除relu节点时在此处设置relu标记,不在下方is_relu_only分支设置GE_ASSERT_SUCCESS(SetReluAttr(node));94 // 后续需要删除relu节点时在此处设置relu标记,不在下方is_relu_only分支设置GE_ASSERT_SUCCESS(SetReluAttr(node));
96 is_relu_only = true;95 is_relu_only = true;
97 cube_node = node;96 cube_node = node;
@@ -23,6 +23,7 @@
23#include <fstream>23#include <fstream>
24#include "common/checker.h"24#include "common/checker.h"
25#include "graph/types.h"25#include "graph/types.h"
26+#include "graph/utils/file_utils.h"
26#include "mmpa/mmpa_api.h"27#include "mmpa/mmpa_api.h"
27 28 
28#include "autofuse/common/autofuse_base_type.h"29#include "autofuse/common/autofuse_base_type.h"
@@ -128,7 +129,13 @@ inline void Trim(std::string &str) {
128 129 
129inline void ParseSkipNodeNamesConfig(const std::string &config_path, std::unordered_set<std::string> &skip_node_types,130inline void ParseSkipNodeNamesConfig(const std::string &config_path, std::unordered_set<std::string> &skip_node_types,
130 std::unordered_set<std::string> &skip_node_names) {131 std::unordered_set<std::string> &skip_node_names) {
131- std::ifstream file(config_path);132+ const std::string real_config_path = RealPath(config_path.c_str());
133+ if (real_config_path.empty()) {
134+ GELOGW("Failed to get canonical path for skip node names config file: %s", config_path.c_str());
135+ return;
136+ }
137+ 
138+ std::ifstream file(real_config_path);
132 if (!file.is_open()) {139 if (!file.is_open()) {
133 GELOGW("Failed to open skip node names config file: %s", config_path.c_str());140 GELOGW("Failed to open skip node names config file: %s", config_path.c_str());
134 return;141 return;