mirror of
https://github.com/marian-nmt/marian.git
synced 2025-01-06 00:13:33 +03:00
parent
266f56f312
commit
20363f1a00
@ -50,11 +50,6 @@
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/gpu</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>python</name>
|
||||
<type>2</type>
|
||||
@ -75,31 +70,6 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/cnpy/cnpy.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin/nbest.cu</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nbest.cu</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin/nbest.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nbest.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin/neural_phrase.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/neural_phrase.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin/nmt.cu</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nmt.cu</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>plugin/nmt.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nmt.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>python/amunmt.cpp</name>
|
||||
<type>1</type>
|
||||
|
@ -177,12 +177,12 @@ OutputCollector& God::GetOutputCollector() {
|
||||
return outputCollector_;
|
||||
}
|
||||
|
||||
std::vector<ScorerPtr> God::GetScorers(DeviceType deviceType, size_t threadId) {
|
||||
std::vector<ScorerPtr> God::GetScorers(size_t threadId) {
|
||||
std::vector<ScorerPtr> scorers;
|
||||
|
||||
size_t cpuThreads = God::Get<size_t>("cpu-threads");
|
||||
|
||||
if (deviceType == CPUDevice) {
|
||||
if (threadId < cpuThreads) {
|
||||
for (auto&& loader : cpuLoaders_ | boost::adaptors::map_values)
|
||||
scorers.emplace_back(loader->NewScorer(*this, threadId));
|
||||
} else {
|
||||
|
@ -57,7 +57,7 @@ class God {
|
||||
|
||||
BestHypsBase &GetBestHyps(size_t threadId);
|
||||
|
||||
std::vector<ScorerPtr> GetScorers(DeviceType deviceType, size_t);
|
||||
std::vector<ScorerPtr> GetScorers(size_t);
|
||||
std::vector<std::string> GetScorerNames();
|
||||
std::map<std::string, float>& GetScorerWeights();
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
using namespace std;
|
||||
|
||||
Search::Search(God &god, DeviceType deviceType, size_t threadId)
|
||||
: scorers_(god.GetScorers(deviceType, threadId)),
|
||||
: scorers_(god.GetScorers(threadId)),
|
||||
bestHyps_(god.GetBestHyps(threadId)) {
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ void MosesPlugin::initGod(const std::string& configPath) {
|
||||
god_ = new God();
|
||||
god_->Init(configs);
|
||||
|
||||
scorers_ = god_->GetScorers(CPUDevice, 1);
|
||||
scorers_ = god_->GetScorers(1);
|
||||
bestHyps_ = &god_->GetBestHyps(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user