forked from huawei/mindspore2022
!18249 Fix gnn API log error
Merge pull request !18249 from lizhenglong1992/gnn_bug_fix
This commit is contained in:
commit
07a3ebeef6
|
|
@ -587,13 +587,13 @@ def check_gnn_list_of_pair_or_ndarray(param, param_name):
|
|||
"""
|
||||
type_check(param, (list, np.ndarray), param_name)
|
||||
if isinstance(param, list):
|
||||
param_names = ["pair_{0}".format(i) for i in range(len(param))]
|
||||
param_names = ["node_list[{0}]".format(i) for i in range(len(param))]
|
||||
type_check_list(param, (tuple,), param_names)
|
||||
for idx, pair in enumerate(param):
|
||||
if not len(pair) == 2:
|
||||
raise ValueError("Each member in {0} must be a pair which means length == 2. Got length {1}".format(
|
||||
param_names[idx], len(pair)))
|
||||
column_names = ["element_{0}".format(i) for i in range(len(pair))]
|
||||
column_names = ["node_list[{0}], number #{1} element".format(idx, i+1) for i in range(len(pair))]
|
||||
type_check_list(pair, (int,), column_names)
|
||||
elif isinstance(param, np.ndarray):
|
||||
if param.ndim != 2:
|
||||
|
|
|
|||
Loading…
Reference in New Issue