未验证 提交 e9563204 编写于 作者: R Ryan 提交者: GitHub

paddle.Tensor has no attribute 'repeat' (#7376)

change `repeat` to `tile`
上级 ddd8740a
...@@ -96,8 +96,8 @@ class PositionEmbedding(nn.Layer): ...@@ -96,8 +96,8 @@ class PositionEmbedding(nn.Layer):
y_emb = self.row_embed(j) y_emb = self.row_embed(j)
pos = paddle.concat( pos = paddle.concat(
[ [
x_emb.unsqueeze(0).repeat(h, 1, 1), x_emb.unsqueeze(0).tile([h, 1, 1]),
y_emb.unsqueeze(1).repeat(1, w, 1), y_emb.unsqueeze(1).tile([1, w, 1]),
], ],
axis=-1).transpose([2, 0, 1]).unsqueeze(0) axis=-1).transpose([2, 0, 1]).unsqueeze(0)
return pos return pos
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册