minor rename

This commit is contained in:
Hieu Hoang 2017-02-20 16:44:50 +00:00
parent c873fafa5c
commit dae0a96c1d
4 changed files with 9 additions and 9 deletions

View File

@ -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); }
);
}
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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); }
)
);
}