"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "c4ac7a76db7aa40bd636a59dc71ef1dd27b2c2c4"
Unverified Commit e4e2a666 authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #2276 from ShnitzelKiller/scatterfix

fix error due to wrong argument name to Tensor.scatter()
parents ce50305e 398bb03f
......@@ -958,7 +958,9 @@ def top_k_top_p_filtering(logits, top_k=0, top_p=1.0, filter_value=-float("Inf")
sorted_indices_to_remove[..., 0] = 0
# scatter sorted tensors to original indexing
indices_to_remove = sorted_indices_to_remove.scatter(dim=1, index=sorted_indices, src=sorted_indices_to_remove)
indices_to_remove = sorted_indices_to_remove.scatter(
dim=1, index=sorted_indices, source=sorted_indices_to_remove
)
logits[indices_to_remove] = filter_value
return logits
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment