[Misc] Various simplifications and typing fixes (#5368)
This commit is contained in:
@@ -306,8 +306,10 @@ class RejectionSampler(nn.Module):
|
||||
|
||||
# Fill in the first k columns of the output tensor using masks and data
|
||||
# tensors.
|
||||
output[:, :k] = torch.where(accepted_mask, draft_token_ids,
|
||||
-torch.ones_like(draft_token_ids))
|
||||
torch.where(accepted_mask,
|
||||
draft_token_ids,
|
||||
-torch.ones_like(draft_token_ids),
|
||||
out=output)
|
||||
|
||||
# Fill the last column.
|
||||
# We check output directly as accepted may have True values inconsistent
|
||||
|
||||
Reference in New Issue
Block a user