未验证 提交 bc13ab9e 编写于 作者: W wuhuachaocoding 提交者: GitHub

concat api support empty tensor. (#35845) (#36096)

上级 effb70f4
......@@ -322,6 +322,8 @@ def concat(input, axis=0, name=None):
if isinstance(axis, Variable):
axis = axis.numpy()
axis = axis.item(0)
if not isinstance(input, Variable):
input = [t for t in input if t.shape.count(0) == 0]
return _C_ops.concat(input, 'axis', axis)
check_type(input, 'input', (list, tuple, Variable), 'concat')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册