fix: replace numpy.where with paddle.where for tensor operations in ParseQHead (#17019)

Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
This commit is contained in:
Daniel Tu
2025-12-30 14:22:20 +08:00
committed by GitHub
co-authored by Lin Manhui
parent ea3fbcc599
commit 6f425758d1
+1 -1
View File
@@ -365,7 +365,7 @@ class ParseQHead(nn.Layer):
temp = paddle.triu(
x=paddle.ones(shape=[num_steps, num_steps], dtype="bool"), diagonal=2
)
posi = np.where(temp.cpu().numpy() == True)
posi = paddle.where(temp == True)
query_mask[posi] = 0
bos = paddle.full(shape=(bs, 1), fill_value=self.bos_id).astype("int64")
for i in range(self.refine_iters):