Browse Source

!733 用“_”修饰内部属性file_constant_path

Merge pull request !733 from 刘豪/add_fileconstant_attr
ge_dev
刘豪 i-robot 2 years ago
parent
commit
5e95a9bfa8
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      metadef
  2. +1
    -1
      parser/onnx/onnx_file_constant_parser.cc
  3. +2
    -2
      tests/ut/parser/testcase/onnx_parser_testcase/onnx_parser_unittest.cc

+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit c796c53d1971952beb1941fb3699dacc907d9625
Subproject commit 14cecde0518e5d65fc78fbb5e1e34f209211c57a

+ 1
- 1
parser/onnx/onnx_file_constant_parser.cc View File

@@ -33,7 +33,7 @@ using namespace ge::parser;
namespace { namespace {
const char *const kAttrShape = "shape"; const char *const kAttrShape = "shape";
const char *const kAttrDataType = "dtype"; const char *const kAttrDataType = "dtype";
const char *const kFileConstantPath = "file_constant_path";
const char *const kFileConstantPath = "_file_constant_path";
const char *const kLocation = "location"; const char *const kLocation = "location";
const char *const kOffset = "offset"; const char *const kOffset = "offset";
const int64_t kOffsetCoefficient = 4096; const int64_t kOffsetCoefficient = 4096;


+ 2
- 2
tests/ut/parser/testcase/onnx_parser_testcase/onnx_parser_unittest.cc View File

@@ -525,7 +525,7 @@ TEST_F(UtestOnnxParser, FileConstantParsePath)
// check location // check location
std::string attr_value; std::string attr_value;
ge::NamedAttrs attrs; ge::NamedAttrs attrs;
AttrUtils::GetNamedAttrs(op_desc_src, "file_constant_path", attrs);
AttrUtils::GetNamedAttrs(op_desc_src, "_file_constant_path", attrs);
AttrUtils::GetStr(attrs, "location", attr_value); AttrUtils::GetStr(attrs, "location", attr_value);
EXPECT_EQ(attr_value, "/usr/local"); EXPECT_EQ(attr_value, "/usr/local");
} }
@@ -567,7 +567,7 @@ TEST_F(UtestOnnxParser, FileConstantParseParam)


// check location, shape, dtype // check location, shape, dtype
NamedAttrs attrs; NamedAttrs attrs;
AttrUtils::GetNamedAttrs(*op_desc_src, "file_constant_path", attrs);
AttrUtils::GetNamedAttrs(*op_desc_src, "_file_constant_path", attrs);
std::string file_path; std::string file_path;
AttrUtils::GetStr(attrs, "location", file_path); AttrUtils::GetStr(attrs, "location", file_path);
EXPECT_EQ(file_path, "/usr/local"); EXPECT_EQ(file_path, "/usr/local");


Loading…
Cancel
Save