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

Method get_sample_begin

include/ctranslate2/decoding_utils.h:97–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 dim_t get_sample_begin(const dim_t batch_size,
98 const dim_t batch_id,
99 const std::vector<dim_t>& batch_offset,
100 const std::vector<std::vector<size_t>>* prefix) const {
101 return prefix ? prefix->at(get_batch_index(batch_size, batch_id, batch_offset)).size() : 0;
102 }
103 };
104
105 // Apply a penalty to the score of previously generated tokens.

Callers

nothing calls this directly

Calls 2

atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected