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

Method get_batch_index

include/ctranslate2/decoding_utils.h:90–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89 protected:
90 dim_t get_batch_index(const dim_t batch_size,
91 const dim_t batch_id,
92 const std::vector<dim_t>& batch_offset) const {
93 const auto beam_size = batch_size / batch_offset.size();
94 return batch_offset[batch_id / beam_size];
95 }
96
97 dim_t get_sample_begin(const dim_t batch_size,
98 const dim_t batch_id,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected