未验证 提交 c2103c48 编写于 作者: X xujiaqi01 提交者: GitHub

fix error check (#24483)

* fix error check of stack and space_to_depth
* test=develop
上级 f5c6dd6d
......@@ -9752,6 +9752,11 @@ def stack(x, axis=0):
assert len(x) == 1, "If the elements of 'x' in stack are Variable(LoDTensorArray), " \
"number of the elements must be 1, but received %s." % len(x)
out_index = helper.create_variable_for_type_inference(dtype="int32")
for i in x:
check_variable_and_dtype(i, 'x', \
['float16', 'float32', 'float64', 'int32', 'int64'], 'stack')
helper.append_op(
type='tensor_array_to_tensor',
inputs={'X': x[0]},
......@@ -12237,6 +12242,9 @@ def space_to_depth(x, blocksize, name=None):
if not (isinstance(blocksize, int)):
raise ValueError("blocksize must be a python Int")
check_variable_and_dtype(x, 'x', \
['float16', 'float32', 'float64', 'int32', 'int64'], 'space_to_depth')
out = helper.create_variable_for_type_inference(dtype=x.dtype)
helper.append_op(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册