From a72543bdf1b4915971e2035bb9660941e81e6af4 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 8 Feb 2017 02:01:21 +0000 Subject: [PATCH] move nextStates into Decode() --- src/common/search.cpp | 5 ++--- src/common/search.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/search.cpp b/src/common/search.cpp index 825264a9..f792819c 100755 --- a/src/common/search.cpp +++ b/src/common/search.cpp @@ -61,12 +61,12 @@ void Search::Decode( const God &god, const Sentences& sentences, States &states, - States &nextStates, std::shared_ptr &histories, Beam &prevHyps) { - size_t batchSize = sentences.size(); + States nextStates = NewStates(); + size_t batchSize = sentences.size(); std::vector beamSizes(batchSize, 1); for (size_t decoderStep = 0; decoderStep < 3 * sentences.GetMaxLength(); ++decoderStep) { @@ -128,7 +128,6 @@ std::shared_ptr Search::Process(const God &god, const Sentences& sent Beam prevHyps(batchSize, HypothesisPtr(new Hypothesis())); States states = NewStates(); - States nextStates = NewStates(); // calc PreProcess(god, sentences, histories, prevHyps); diff --git a/src/common/search.h b/src/common/search.h index 69043822..4bd944c4 100755 --- a/src/common/search.h +++ b/src/common/search.h @@ -30,7 +30,6 @@ class Search { const God &god, const Sentences& sentences, States &states, - States &nextStates, std::shared_ptr &histories, Beam &prevHyps);