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

Function build_hypothesis

src/decoding.cc:132–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 }
131
132 static std::vector<size_t> build_hypothesis(const StorageView& history,
133 const dim_t batch,
134 const dim_t beam,
135 const dim_t start,
136 const dim_t end) {
137 const auto* ids = history.index<int32_t>({batch, beam, 0});
138 return std::vector<size_t>(ids + start, ids + end);
139 }
140
141 static std::vector<std::vector<float>> build_attention(const StorageView& history,
142 const dim_t batch,

Callers 1

searchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected