!13570 fix GPU Print seg fault when printing grad result

From: @TFbunny
Reviewed-by: @robingrosman,@liangchenghui
Signed-off-by: @liangchenghui
pull/13570/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit dd9f227fd6

@ -67,6 +67,10 @@ bool GetOptList(const std::vector<AnfNodePtr> &node_list, std::vector<AnfNodePtr
continue;
}
auto value_node = current_node->cast<ValueNodePtr>()->value();
// not a string
if (value_node->type() == nullptr) {
continue;
}
if (value_node->type()->generic_type_id() == kObjectTypeString) {
auto current_string_value = GetValue<std::string>(value_node);
string_pos.push_back(i);

Loading…
Cancel
Save