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

Function repeat_batch

include/ctranslate2/decoding_utils.h:25–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 inline void repeat_batch(StorageView& input, dim_t repeats) {
26 input.expand_dims(1);
27 ops::Tile(/*axis=*/1, repeats)(input);
28 merge_batch_beam(input);
29 }
30
31 inline bool is_eos(const size_t id, const std::vector<size_t>& end_ids) {
32 return std::find(end_ids.begin(), end_ids.end(), id) != end_ids.end();

Callers 3

searchMethod · 0.85
decode_alternativesFunction · 0.85
replicate_stateMethod · 0.85

Calls 2

TileClass · 0.85
merge_batch_beamFunction · 0.85

Tested by

no test coverage detected