MCPcopy Index your code
hub / github.com/YunwenTechnology/QueryGeneration / _top_k_sample

Function _top_k_sample

train/modeling.py:366–398  ·  view source on GitHub ↗

Does top-k sampling. if ignore_ids is on, then we will zero out those logits. :param logits: [batch_size, vocab_size] tensor :param ignore_ids: [vocab_size] one-hot representation of the indices we'd like to ignore and never predict, like padding maybe :param

(logits, ignore_ids=None, num_samples=1, k=10)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

sample_stepFunction · 0.85

Calls 1

get_shape_listFunction · 0.90

Tested by

no test coverage detected