Browse Source

fix

pull/338/head
wjm 4 years ago
parent
commit
29a321b404
5 changed files with 11 additions and 4 deletions
  1. +1
    -1
      parser/func_to_graph/func2graph.py
  2. +1
    -1
      parser/onnx/onnx_data_parser.h
  3. +1
    -1
      parser/onnx/subgraph_adapter/subgraph_adapter_factory.h
  4. +1
    -1
      parser/tensorflow/tensorflow_frameworkop_parser.cc
  5. +7
    -0
      tests/ut/parser/testcase/onnx_parser_testcase/onnx_model/if.py

+ 1
- 1
parser/func_to_graph/func2graph.py View File

@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#------------------------------------------------------------------- #-------------------------------------------------------------------
# Purpose: # Purpose:


+ 1
- 1
parser/onnx/onnx_data_parser.h View File

@@ -42,7 +42,7 @@ class PARSER_FUNC_VISIBILITY OnnxDataParser : public OnnxOpParser {


std::vector<int64_t> user_input_dims_v_; std::vector<int64_t> user_input_dims_v_;


bool is_subgraph_data_op_;
bool is_subgraph_data_op_ = false;
}; };
} // namespace ge } // namespace ge




+ 1
- 1
parser/onnx/subgraph_adapter/subgraph_adapter_factory.h View File

@@ -55,7 +55,7 @@ public:
*/ */
std::shared_ptr<SubgraphAdapter> CreateSubgraphAdapter(const std::string &op_type); std::shared_ptr<SubgraphAdapter> CreateSubgraphAdapter(const std::string &op_type);


~SubgraphAdapterFactory() = default;
protected: protected:
/** /**
* @brief SubgraphAdapter creation function * @brief SubgraphAdapter creation function


+ 1
- 1
parser/tensorflow/tensorflow_frameworkop_parser.cc View File

@@ -75,9 +75,9 @@ Status ParseParams(const Message *op_src, FrameworkOpOperator *op) {
op->TfOpDef(attr_v.s()); op->TfOpDef(attr_v.s());
} else { } else {
GE_CHK_BOOL_EXEC(type == "_Retval", GE_CHK_BOOL_EXEC(type == "_Retval",
GE_DELETE_NEW_SINGLE(pkg_node);
REPORT_INNER_ERROR("E19999", "In NodeDef:%s Attr:opdef is not exist, check invalid", REPORT_INNER_ERROR("E19999", "In NodeDef:%s Attr:opdef is not exist, check invalid",
pkg_node->name().c_str()); pkg_node->name().c_str());
GE_DELETE_NEW_SINGLE(pkg_node);
return PARAM_INVALID, "In NodeDef %s Attr opdef is not exist.", pkg_node->name().c_str()); return PARAM_INVALID, "In NodeDef %s Attr opdef is not exist.", pkg_node->name().c_str());
} }




+ 7
- 0
tests/ut/parser/testcase/onnx_parser_testcase/onnx_model/if.py View File

@@ -1,3 +1,10 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------
# Purpose:
# Copyright 2021 Huawei Technologies Co., Ltd. All rights reserved.
#-------------------------------------------------------------------

# Given a bool scalar input cond. # Given a bool scalar input cond.
# return constant tensor x if cond is True, otherwise return constant tensor y. # return constant tensor x if cond is True, otherwise return constant tensor y.
import numpy as np import numpy as np


Loading…
Cancel
Save