Skip to content

Commit

Permalink
fix unbound variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
erip committed Jan 30, 2023
1 parent c29e380 commit 735b617
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xformers/components/attention/scaled_dot_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def forward(
)

# Handle a possibly deferred causal mask handling
mask = self.mask
if self.causal:
if self.mask is None:
mask = AttentionMask.make_causal(
Expand All @@ -105,8 +106,6 @@ def forward(
device=q.device,
dtype=q.dtype,
)
else:
mask = self.mask

# Merge the optional causal mask and the user-provided mask
if mask is not None:
Expand Down

0 comments on commit 735b617

Please sign in to comment.