mirror of
https://github.com/marian-nmt/marian.git
synced 2024-12-03 03:54:56 +03:00
CalcBeam()
This commit is contained in:
parent
154831d07a
commit
98917c2554
@ -84,9 +84,7 @@ void Search::Decode(
|
||||
}
|
||||
}
|
||||
Beams beams(batchSize);
|
||||
bool returnAlignment = god.Get<bool>("return-alignment");
|
||||
|
||||
bestHyps_->CalcBeam(god, prevHyps, scorers_, filterIndices_, returnAlignment, beams, beamSizes);
|
||||
CalcBeam(god, prevHyps, beams, beamSizes);
|
||||
|
||||
for (size_t i = 0; i < batchSize; ++i) {
|
||||
if (!beams[i].empty()) {
|
||||
@ -117,6 +115,19 @@ void Search::Decode(
|
||||
}
|
||||
}
|
||||
|
||||
void Search::CalcBeam(
|
||||
const God &god,
|
||||
Beam &prevHyps,
|
||||
Beams &beams,
|
||||
std::vector<size_t> &beamSizes
|
||||
)
|
||||
{
|
||||
bool returnAlignment = god.Get<bool>("return-alignment");
|
||||
|
||||
bestHyps_->CalcBeam(god, prevHyps, scorers_, filterIndices_, returnAlignment, beams, beamSizes);
|
||||
|
||||
}
|
||||
|
||||
std::shared_ptr<Histories> Search::Process(const God &god, const Sentences& sentences) {
|
||||
boost::timer::cpu_timer timer;
|
||||
|
||||
|
@ -49,6 +49,14 @@ class Search {
|
||||
BestHypsBasePtr bestHyps_;
|
||||
|
||||
DeviceInfo deviceInfo_;
|
||||
|
||||
void CalcBeam(
|
||||
const God &god,
|
||||
Beam &prevHyps,
|
||||
Beams &beams,
|
||||
std::vector<size_t> &beamSizes
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user