Skip to content

Commit

Permalink
fp32 topk on cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
danjust committed Oct 27, 2023
1 parent 0fdb741 commit 35937e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion besskge/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def forward(self) -> Dict[str, Any]:
if self.return_scores:
scores.append(batch_scores_filt)
if self.return_topk:
topk_ids.append(torch.topk(batch_scores_filt, k=self.k, dim=-1).indices)
topk_ids.append(torch.topk(batch_scores_filt.to(torch.float32), k=self.k, dim=-1).indices)

out = dict()
if scores:
Expand Down

0 comments on commit 35937e2

Please sign in to comment.