[Models][Qwen] Replace pad with cat for better performance (#26486)
Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
This commit is contained in:
@@ -592,7 +592,7 @@ class Siglip2Encoder(nn.Module):
|
||||
# for more information
|
||||
dtype=grid_thws.dtype if torch.jit.is_tracing() else torch.int32,
|
||||
)
|
||||
cu_seqlens = F.pad(cu_seqlens, (1, 0), value=0)
|
||||
cu_seqlens = torch.cat([cu_seqlens.new_zeros(1), cu_seqlens])
|
||||
|
||||
reverse_indices = torch.argsort(window_index)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user