Skip to content

Commit d001497

Browse files
committed
update
1 parent bdeb17b commit d001497

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

paddle/phi/kernels/gpu/concat_kernel.cu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ void ConcatKernel(const Context& dev_ctx,
4545
out->Resize(out_dims);
4646
dev_ctx.template Alloc<T>(out);
4747

48+
if (out->numel() == 0) {
49+
return;
50+
}
51+
4852
// If axis is 0, the lod of the output is not the same as inputs.
4953
if (axis == 0 && x[0]->lod().size() > 0) {
5054
size_t lod_size_0 = x[0]->lod().size();

python/paddle/tensor/manipulation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,8 +1409,6 @@ def concat(
14091409
if in_dynamic_mode():
14101410
if isinstance(axis, Variable):
14111411
axis = axis.item(0)
1412-
if not isinstance(input, (Variable, paddle.pir.Value)):
1413-
input = [t for t in input if t.shape.count(0) == 0]
14141412
return _C_ops.concat(input, axis)
14151413
elif in_pir_mode():
14161414

0 commit comments

Comments
 (0)