Skip to content

Commit

Permalink
remove bitwise inplace op
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jul 2, 2024
1 parent f7912d6 commit 304d991
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optimum/exporters/onnx/model_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,10 @@ def _update_causal_mask_patched(
if self.config.sliding_window is not None:
if not using_sliding_window_cache or sequence_length > self.config.sliding_window:
# ---------------- NOTE: This part is patched -----------------------------
exclude_mask.bitwise_or_(
exclude_mask = torch.bitwise_or(
exclude_mask,
torch.arange(target_length, device=device)
<= (cache_position.reshape(-1, 1) - self.config.sliding_window)
<= (cache_position.reshape(-1, 1) - self.config.sliding_window),
)
# ---------------- NOTE: patch end ----------------------------------------

Expand Down

0 comments on commit 304d991

Please sign in to comment.