fix input check

This commit is contained in:
heleiwang 2020-05-25 20:07:39 +08:00
parent 831ceba6eb
commit 0b87620b73
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: