mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-30 21:39:52 +03:00
minor rename
This commit is contained in:
parent
c873fafa5c
commit
dae0a96c1d
@ -42,7 +42,7 @@ int main(int argc, char* argv[]) {
|
||||
while (maxiBatch->size()) {
|
||||
SentencesPtr miniBatch = maxiBatch->NextMiniBatch(miniSize);
|
||||
god.GetThreadPool().enqueue(
|
||||
[&god,miniBatch]{ return TranslationTask(god, miniBatch); }
|
||||
[&god,miniBatch]{ return TranslationTaskAndOutput(god, miniBatch); }
|
||||
);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
|
||||
while (maxiBatch->size()) {
|
||||
SentencesPtr miniBatch = maxiBatch->NextMiniBatch(miniSize);
|
||||
god.GetThreadPool().enqueue(
|
||||
[&god,miniBatch]{ return TranslationTask(god, miniBatch); }
|
||||
[&god,miniBatch]{ return TranslationTaskAndOutput(god, miniBatch); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ using namespace std;
|
||||
|
||||
namespace amunmt {
|
||||
|
||||
void TranslationTask(const God &god, std::shared_ptr<Sentences> sentences) {
|
||||
void TranslationTaskAndOutput(const God &god, std::shared_ptr<Sentences> sentences) {
|
||||
OutputCollector &outputCollector = god.GetOutputCollector();
|
||||
|
||||
std::shared_ptr<Histories> histories = TranslationTaskSync(god, sentences);
|
||||
std::shared_ptr<Histories> histories = TranslationTask(god, sentences);
|
||||
|
||||
for (size_t i = 0; i < histories->size(); ++i) {
|
||||
const History &history = *histories->at(i);
|
||||
@ -23,7 +23,7 @@ void TranslationTask(const God &god, std::shared_ptr<Sentences> sentences) {
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Histories> TranslationTaskSync(const God &god, std::shared_ptr<Sentences> sentences) {
|
||||
std::shared_ptr<Histories> TranslationTask(const God &god, std::shared_ptr<Sentences> sentences) {
|
||||
try {
|
||||
Search &search = god.GetSearch();
|
||||
std::shared_ptr<Histories> histories = search.Process(god, *sentences);
|
||||
|
@ -6,8 +6,8 @@ namespace amunmt {
|
||||
|
||||
class God;
|
||||
|
||||
void TranslationTask(const God &god, std::shared_ptr<Sentences> sentences);
|
||||
std::shared_ptr<Histories> TranslationTaskSync(const God &god, std::shared_ptr<Sentences> sentences);
|
||||
void TranslationTaskAndOutput(const God &god, std::shared_ptr<Sentences> sentences);
|
||||
std::shared_ptr<Histories> TranslationTask(const God &god, std::shared_ptr<Sentences> sentences);
|
||||
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ boost::python::list translate(boost::python::list& in)
|
||||
|
||||
results.emplace_back(
|
||||
god_.GetThreadPool().enqueue(
|
||||
[&god_,miniBatch]{ return TranslationTaskSync(god_, miniBatch); }
|
||||
[&god_,miniBatch]{ return TranslationTask(god_, miniBatch); }
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -66,7 +66,7 @@ boost::python::list translate(boost::python::list& in)
|
||||
SentencesPtr miniBatch = maxiBatch->NextMiniBatch(miniSize);
|
||||
results.emplace_back(
|
||||
god_.GetThreadPool().enqueue(
|
||||
[&god_,miniBatch]{ return TranslationTaskSync(god_, miniBatch); }
|
||||
[&god_,miniBatch]{ return TranslationTask(god_, miniBatch); }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user