!1448 Fix input check in graphdata

Merge pull request !1448 from heleiwang/fix_input_check
This commit is contained in:
mindspore-ci-bot 2020-05-26 14:16:16 +08:00 committed by Gitee
commit e652736304
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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: