MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / DisableTokens

Method DisableTokens

src/decoding_utils.cc:10–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace ctranslate2 {
9
10 DisableTokens::DisableTokens(StorageView& logits, const float disable_value)
11 : _logits(logits)
12 , _logits_data(logits.device() == Device::CPU ? logits.data<float>() : nullptr)
13 , _disable_value(disable_value)
14 , _batch_size(logits.dim(0))
15 , _vocabulary_size(logits.dim(1))
16 {
17 }
18
19 void DisableTokens::apply() {
20 const dim_t num_indices = _flat_indices.size();

Callers

nothing calls this directly

Calls 2

dimMethod · 0.80
deviceMethod · 0.45

Tested by

no test coverage detected