forked from mindspore-Ecosystem/mindspore
fix mindspore lite codex
This commit is contained in:
parent
25ce6a104e
commit
2fcc95096a
|
@ -59,8 +59,9 @@ STATUS SwitchPass::Run(mindspore::schema::MetaGraphT *graph) {
|
||||||
if (type != schema::PrimitiveType_PartialFusion) {
|
if (type != schema::PrimitiveType_PartialFusion) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
MS_ASSERT(node != nullptr);
|
||||||
MS_ASSERT(node->primitive != nullptr);
|
MS_ASSERT(node->primitive != nullptr);
|
||||||
MS_ASSERT(node->primitive->value..AsPartialFusion() != nullptr);
|
MS_ASSERT(node->primitive->value.AsPartialFusion() != nullptr);
|
||||||
auto partial_prim = node->primitive->value.AsPartialFusion();
|
auto partial_prim = node->primitive->value.AsPartialFusion();
|
||||||
if (partial_prim->sub_graph_index == -1) {
|
if (partial_prim->sub_graph_index == -1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -467,7 +468,9 @@ STATUS SingleSwitchPass::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// get cond_graph_nodes_
|
// get cond_graph_nodes_
|
||||||
MS_ASSERT(first_partial_node_->primitive->value..AsPartialFusion() != nullptr);
|
MS_ASSERT(first_partial_node_ != nullptr);
|
||||||
|
MS_ASSERT(first_partial_node_->primitive != nullptr);
|
||||||
|
MS_ASSERT(first_partial_node_->primitive->value.AsPartialFusion() != nullptr);
|
||||||
first_subgraph_index_ = first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index;
|
first_subgraph_index_ = first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index;
|
||||||
auto cond_node_indices = graph_->subGraph.at(first_subgraph_index_)->nodeIndices;
|
auto cond_node_indices = graph_->subGraph.at(first_subgraph_index_)->nodeIndices;
|
||||||
for (auto &index : cond_node_indices) {
|
for (auto &index : cond_node_indices) {
|
||||||
|
@ -623,8 +626,9 @@ STATUS SingleSwitchPass::UpdateSubgraphOutput(const size_t &subgraph_index, sche
|
||||||
|
|
||||||
STATUS SingleSwitchPass::ConcatCondSubgraphInputAndOutput() {
|
STATUS SingleSwitchPass::ConcatCondSubgraphInputAndOutput() {
|
||||||
if (first_subgraph_index_ == -1) {
|
if (first_subgraph_index_ == -1) {
|
||||||
|
MS_ASSERT(first_partial_node_ != nullptr);
|
||||||
MS_ASSERT(first_partial_node_->primitive != nullptr);
|
MS_ASSERT(first_partial_node_->primitive != nullptr);
|
||||||
MS_ASSERT(first_partial_node_->primitive->value..AsPartialFusion() != nullptr);
|
MS_ASSERT(first_partial_node_->primitive->value.AsPartialFusion() != nullptr);
|
||||||
first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index = -1;
|
first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index = -1;
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
@ -644,8 +648,9 @@ STATUS SingleSwitchPass::ConcatCondSubgraphInputAndOutput() {
|
||||||
|
|
||||||
STATUS SingleSwitchPass::ConcatBodySubgraphInputAndOutput() {
|
STATUS SingleSwitchPass::ConcatBodySubgraphInputAndOutput() {
|
||||||
if (second_subgraph_index_ == -1) {
|
if (second_subgraph_index_ == -1) {
|
||||||
|
MS_ASSERT(first_partial_node_ != nullptr);
|
||||||
MS_ASSERT(first_partial_node_->primitive != nullptr);
|
MS_ASSERT(first_partial_node_->primitive != nullptr);
|
||||||
MS_ASSERT(first_partial_node_->primitive->value..AsPartialFusion() != nullptr);
|
MS_ASSERT(first_partial_node_->primitive->value.AsPartialFusion() != nullptr);
|
||||||
first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index = -1;
|
first_partial_node_->primitive->value.AsPartialFusion()->sub_graph_index = -1;
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class FunctionalizeCond {
|
||||||
public:
|
public:
|
||||||
FunctionalizeCond(FuncGraphPtr fg, CNodePtr merge_node) : fg_(fg), merge_node_(merge_node) {}
|
FunctionalizeCond(FuncGraphPtr fg, CNodePtr merge_node) : fg_(fg), merge_node_(merge_node) {}
|
||||||
|
|
||||||
~FunctionalizeCond() = default;
|
virtual ~FunctionalizeCond() = default;
|
||||||
|
|
||||||
STATUS Process();
|
STATUS Process();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class FunctionalizeWhile {
|
||||||
FunctionalizeWhile(std::vector<AnfNodePtr> node_cluster, const CNodePtr &loop_cond_node, FuncGraphPtr fg)
|
FunctionalizeWhile(std::vector<AnfNodePtr> node_cluster, const CNodePtr &loop_cond_node, FuncGraphPtr fg)
|
||||||
: node_cluster_(node_cluster), loop_cond_node_(loop_cond_node), fg_(fg) {}
|
: node_cluster_(node_cluster), loop_cond_node_(loop_cond_node), fg_(fg) {}
|
||||||
|
|
||||||
~FunctionalizeWhile() = default;
|
virtual ~FunctionalizeWhile() = default;
|
||||||
|
|
||||||
// while
|
// while
|
||||||
STATUS BuildWhileNode();
|
STATUS BuildWhileNode();
|
||||||
|
|
|
@ -57,6 +57,7 @@ class RegistryPrimitiveAdjust {
|
||||||
RegistryPrimitiveAdjust(const std::string &key, PrimitiveAdjustCreator creator) {
|
RegistryPrimitiveAdjust(const std::string &key, PrimitiveAdjustCreator creator) {
|
||||||
PrimitiveAdjustRegistry::GetInstance()->InsertPrimitiveAdjustMap(key, creator);
|
PrimitiveAdjustRegistry::GetInstance()->InsertPrimitiveAdjustMap(key, creator);
|
||||||
}
|
}
|
||||||
|
virtual ~RegistryPrimitiveAdjust() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REGIST_PRIMITIVE_ADJUST(type, primitive_adjust_func) \
|
#define REGIST_PRIMITIVE_ADJUST(type, primitive_adjust_func) \
|
||||||
|
|
Loading…
Reference in New Issue