fix func graph is null

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2022-03-09 17:55:16 +08:00
parent e8e35966a5
commit 468fcaef0d
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,13 @@ void CommOpAttrs(const FuncGraphPtr &graph) {
std::vector<AnfNodePtr> all_nodes = TopoSort(return_node);
for (auto &node : all_nodes) {
MS_EXCEPTION_IF_NULL(node);
if (!node->isa<CNode>()) {
continue;
}
auto primitive = GetCNodePrimitive(node);
if (primitive == nullptr) {
continue;
}
if (!common::AnfAlgo::IsCommunicationOp(node)) {
continue;
}