提交 0b87620b 编写于 作者: H heleiwang

fix input check

上级 831ceba6
......@@ -152,6 +152,7 @@ Status Graph::GetNodeFeature(const std::shared_ptr<Tensor> &nodes, const std::ve
if (!nodes || nodes->Size() == 0) {
RETURN_STATUS_UNEXPECTED("Input nodes is empty");
}
CHECK_FAIL_RETURN_UNEXPECTED(!feature_types.empty(), "Inpude feature_types is empty");
TensorRow tensors;
for (auto f_type : feature_types) {
std::shared_ptr<Feature> default_feature;
......
......@@ -1153,6 +1153,9 @@ def check_aligned_list(param, param_name, membor_type):
if not isinstance(param, list):
raise TypeError("Parameter {0} is not a list".format(param_name))
if not param:
raise TypeError(
"Parameter {0} or its members are empty".format(param_name))
membor_have_list = None
list_len = None
for membor in param:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册