Skip to content

Commit

Permalink
restore a removed .tolist from #67194, #67130
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Aug 10, 2024
1 parent e1f19c6 commit d198b5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/legacy_test/test_flash_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,10 @@ def gen_unpadded_data(self, dtype):
low=1, high=self.seq_len, size=[self.batch_size]
)
cu_seqlen_q = paddle.to_tensor(
[0, *np.cumsum(seq_len_q)], dtype=paddle.int32
[0, *np.cumsum(seq_len_q).tolist()], dtype=paddle.int32
)
cu_seqlen_k = paddle.to_tensor(
[0, *np.cumsum(seq_len_k)], dtype=paddle.int32
[0, *np.cumsum(seq_len_k).tolist()], dtype=paddle.int32
)

qs, ks, vs = [], [], []
Expand Down Expand Up @@ -966,7 +966,7 @@ def gen_unpadded_data(self, dtype):
)
seq_len_k = seq_len_q
cu_seqlen_q = paddle.to_tensor(
[0, *np.cumsum(seq_len_q)], dtype=paddle.int32
[0, *np.cumsum(seq_len_q).tolist()], dtype=paddle.int32
)
cu_seqlen_k = cu_seqlen_q

Expand Down
4 changes: 3 additions & 1 deletion test/sequence/test_sequence_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ def init_test_case(self):
self.input_size = [self.input_row, 25]
idx = list(range(self.input_size[0]))
del idx[0]
offset_lod = [[0, *np.sort(random.sample(idx, 8)), self.input_size[0]]]
offset_lod = [
[0, *np.sort(random.sample(idx, 8)).tolist(), self.input_size[0]]
]
self.lod = [[]]
# convert from offset-based lod to length-based lod
for i in range(len(offset_lod[0]) - 1):
Expand Down

0 comments on commit d198b5a

Please sign in to comment.