From e95632044f1213201d2579e207f13c66f7ad5564 Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Wed, 23 Nov 2022 20:40:09 +0800 Subject: [PATCH] paddle.Tensor has no attribute 'repeat' (#7376) change `repeat` to `tile` --- ppdet/modeling/transformers/position_encoding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppdet/modeling/transformers/position_encoding.py b/ppdet/modeling/transformers/position_encoding.py index 0a289e1e6..dffd9ce9b 100644 --- a/ppdet/modeling/transformers/position_encoding.py +++ b/ppdet/modeling/transformers/position_encoding.py @@ -96,8 +96,8 @@ class PositionEmbedding(nn.Layer): y_emb = self.row_embed(j) pos = paddle.concat( [ - x_emb.unsqueeze(0).repeat(h, 1, 1), - y_emb.unsqueeze(1).repeat(1, w, 1), + x_emb.unsqueeze(0).tile([h, 1, 1]), + y_emb.unsqueeze(1).tile([1, w, 1]), ], axis=-1).transpose([2, 0, 1]).unsqueeze(0) return pos -- GitLab