From 32ea04347e5f40d0aba243ab86c0fd74d1bd5959 Mon Sep 17 00:00:00 2001 From: Tingquan Gao <35441050@qq.com> Date: Wed, 12 Jul 2023 17:46:57 +0800 Subject: [PATCH] concat -> stack (#8423) adapt to paddle upgrade that concat dont support 0D tensor --- ppdet/modeling/transformers/dino_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/modeling/transformers/dino_transformer.py b/ppdet/modeling/transformers/dino_transformer.py index 89073e821..d08a0ad1b 100644 --- a/ppdet/modeling/transformers/dino_transformer.py +++ b/ppdet/modeling/transformers/dino_transformer.py @@ -361,7 +361,7 @@ class DINOTransformer(nn.Layer): valid_ratios = [] for i, feat in enumerate(proj_feats): bs, _, h, w = paddle.shape(feat) - spatial_shapes.append(paddle.concat([h, w])) + spatial_shapes.append(paddle.stack([h, w])) # [b,c,h,w] -> [b,h*w,c] feat_flatten.append(feat.flatten(2).transpose([0, 2, 1])) if pad_mask is not None: -- GitLab