提交 0de15935 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!826 Check whether the value tuple is empty when converting it to tuple tensor

Merge pull request !826 from YuJianfeng/r0.2
......@@ -299,6 +299,10 @@ tensor::TensorPtr CreateTensorWithValueTuple(const ValueTuplePtr &value_tuple_pt
tensor::TensorPtr CreateTupleTensor(const ValueTuplePtr &value_tuple) {
MS_EXCEPTION_IF_NULL(value_tuple);
tensor::TensorPtr tensor = nullptr;
if (value_tuple->value().empty()) {
MS_LOG(WARNING) << "The value tuple is empty.";
return nullptr;
}
ValuePtr v = *(value_tuple->value().begin());
MS_EXCEPTION_IF_NULL(v);
// Currently we only deal with the scalar tuple
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册