Skip to content

Commit 0f1fd70

Browse files
authored
adapt to paddle about 0D-Tensor (#3508)
1 parent bf93244 commit 0f1fd70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Matting/ppmatting/models/human_matting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ def forward(self, src, pha, err, hid, tri):
423423
x = paddle.concat([hid, pha, tri], axis=1)
424424
x = F.interpolate(
425425
x,
426-
paddle.concat((h_half, w_half)),
426+
paddle.stack((h_half, w_half)).squeeze(),
427427
mode='bilinear',
428428
align_corners=False)
429429
y = F.interpolate(
430430
src,
431-
paddle.concat((h_half, w_half)),
431+
paddle.stack((h_half, w_half)).squeeze(),
432432
mode='bilinear',
433433
align_corners=False)
434434

@@ -440,11 +440,11 @@ def forward(self, src, pha, err, hid, tri):
440440
x = self.conv2(x)
441441

442442
if self.kernel_size == 3:
443-
x = F.interpolate(x, paddle.concat((h_full + 4, w_full + 4)))
443+
x = F.interpolate(x, paddle.stack((h_full + 4, w_full + 4)).squeeze())
444444
y = F.pad(src, [2, 2, 2, 2])
445445
else:
446446
x = F.interpolate(
447-
x, paddle.concat((h_full, w_full)), mode='nearest')
447+
x, paddle.stack((h_full, w_full)).squeeze(), mode='nearest')
448448
y = src
449449

450450
x = self.conv3(paddle.concat([x, y], axis=1))

0 commit comments

Comments
 (0)