未验证 提交 c3b314c3 编写于 作者: W wangchaochaohu 提交者: GitHub

refine the error of message test=develop (#27067)

上级 2f97ecdd
...@@ -1446,6 +1446,8 @@ def linspace(start, stop, num, dtype=None, name=None): ...@@ -1446,6 +1446,8 @@ def linspace(start, stop, num, dtype=None, name=None):
tensor_num = num tensor_num = num
tensor_start = start tensor_start = start
tensor_stop = stop tensor_stop = stop
if not isinstance(num, Variable):
check_type(num, 'num', (int), 'linspace')
if not isinstance(dtype, core.VarDesc.VarType): if not isinstance(dtype, core.VarDesc.VarType):
dtype = convert_np_dtype_to_dtype_(dtype) dtype = convert_np_dtype_to_dtype_(dtype)
if not isinstance(start, Variable): if not isinstance(start, Variable):
...@@ -1471,8 +1473,6 @@ def linspace(start, stop, num, dtype=None, name=None): ...@@ -1471,8 +1473,6 @@ def linspace(start, stop, num, dtype=None, name=None):
check_type(stop, 'stop', (int, float), 'linspace') check_type(stop, 'stop', (int, float), 'linspace')
if isinstance(num, Variable): if isinstance(num, Variable):
check_dtype(num.dtype, 'num', ['int32'], 'linspace') check_dtype(num.dtype, 'num', ['int32'], 'linspace')
else:
check_type(num, 'num', (int), 'linspace')
check_dtype(dtype, 'dtype', ['int32', 'int64', 'float32', 'float64'], check_dtype(dtype, 'dtype', ['int32', 'int64', 'float32', 'float64'],
'linspace') 'linspace')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册