Skip to content

Commit

Permalink
adapt to paddle about 0D-Tensor (#3508)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingquanGao committed Oct 11, 2023
1 parent bf93244 commit 0f1fd70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Matting/ppmatting/models/human_matting.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ def forward(self, src, pha, err, hid, tri):
x = paddle.concat([hid, pha, tri], axis=1)
x = F.interpolate(
x,
paddle.concat((h_half, w_half)),
paddle.stack((h_half, w_half)).squeeze(),
mode='bilinear',
align_corners=False)
y = F.interpolate(
src,
paddle.concat((h_half, w_half)),
paddle.stack((h_half, w_half)).squeeze(),
mode='bilinear',
align_corners=False)

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

if self.kernel_size == 3:
x = F.interpolate(x, paddle.concat((h_full + 4, w_full + 4)))
x = F.interpolate(x, paddle.stack((h_full + 4, w_full + 4)).squeeze())
y = F.pad(src, [2, 2, 2, 2])
else:
x = F.interpolate(
x, paddle.concat((h_full, w_full)), mode='nearest')
x, paddle.stack((h_full, w_full)).squeeze(), mode='nearest')
y = src

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

0 comments on commit 0f1fd70

Please sign in to comment.