Skip to content

Commit f49dec9

Browse files
fix shape64 (#14376)
1 parent 78e7184 commit f49dec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ppocr/modeling/heads/rec_sar_head.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,14 @@ def _2d_attention(self, decoder_input, feat, holistic_feat, valid_ratios=None):
242242
# bsz * (seq_len + 1) * h * w * attn_size
243243
attn_weight = self.conv1x1_2(attn_weight)
244244
# bsz * (seq_len + 1) * h * w * 1
245-
bsz, T, h, w, c = paddle.shape(attn_weight).astype("int32")
245+
bsz, T, h, w, c = paddle.shape(attn_weight)
246246
assert c == 1
247247

248248
if valid_ratios is not None:
249249
# cal mask of attention weight
250250
for i in range(valid_ratios.shape[0]):
251251
valid_width = paddle.minimum(
252-
w, paddle.ceil(valid_ratios[i] * w).astype("int32")
252+
w, paddle.ceil(valid_ratios[i] * w).astype("int64")
253253
)
254254
if valid_width < w:
255255
attn_weight[i, :, :, valid_width:, :] = float("-inf")

0 commit comments

Comments
 (0)