Skip to content

Commit

Permalink
Fix tensor device mismatch issue (facebookresearch#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonChoi034 authored Aug 29, 2023
1 parent e09c3a8 commit 77a1c95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonar/models/sonar_text/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def sentence_embedding_pooling(
"""

if padding_mask is None:
padding_mask = torch.zeros(seqs.shape[:2])
padding_mask = torch.zeros(seqs.shape[:2], device=seqs.device)

if pooling == Pooling.LAST:
seq_length = compute_seq_length(padding_mask, _neg_inf)
Expand Down

0 comments on commit 77a1c95

Please sign in to comment.