@@ -1,4 +1,4 @@ | |||||
#!/usr/bin/python3 | |||||
#!/usr/bin/env python3 | |||||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||
#------------------------------------------------------------------- | #------------------------------------------------------------------- | ||||
# Purpose: | # Purpose: | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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()); | ||||
} | } | ||||
@@ -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 | ||||