提交 4d5a0b0a 编写于 作者: Y Yu Yang

Also add const to makeEvaluator

上级 22aacbfd
......@@ -181,7 +181,7 @@ public:
/**
* Create an evaluator which can be used for eval()
*/
virtual Evaluator* makeEvaluator() = 0;
virtual Evaluator* makeEvaluator() const = 0;
/**
* evaluate using the given evaluator
......
......@@ -327,7 +327,7 @@ void MultiGradientMachine::finish() {
}
}
Evaluator* MultiGradientMachine::makeEvaluator() {
Evaluator* MultiGradientMachine::makeEvaluator() const {
return threads_[0]->getGradientMachine()->makeEvaluator();
}
......
......@@ -193,7 +193,7 @@ public:
virtual void finish();
virtual Evaluator* makeEvaluator();
virtual Evaluator* makeEvaluator() const;
virtual void eval(Evaluator* evaluator) const;
......
......@@ -172,7 +172,7 @@ protected:
std::vector<std::unique_ptr<Evaluator>> evaluators_;
};
Evaluator* MultiNetwork::makeEvaluator() {
Evaluator* MultiNetwork::makeEvaluator() const {
MultiCombinedEvaluator* multiCombinedEvaluator = new MultiCombinedEvaluator();
for (size_t i = 0; i < subNetworks_.size(); i++) {
std::unique_ptr<Evaluator> evaluator(subNetworks_[i]->makeEvaluator());
......
......@@ -46,7 +46,7 @@ public:
virtual void onPassEnd();
virtual Evaluator* makeEvaluator();
virtual Evaluator* makeEvaluator() const;
virtual void eval(Evaluator* evaluator) const;
......
......@@ -348,7 +348,7 @@ protected:
std::vector<std::unique_ptr<Evaluator>> evaluators_;
};
Evaluator* NeuralNetwork::makeEvaluator() {
Evaluator* NeuralNetwork::makeEvaluator() const {
CombinedEvaluator* combinedEvaluator = new CombinedEvaluator();
auto subModelConfig = std::find_if(config_.sub_models().begin(),
config_.sub_models().end(),
......
......@@ -96,7 +96,7 @@ public:
virtual void onPassEnd();
virtual Evaluator* makeEvaluator();
virtual Evaluator* makeEvaluator() const;
virtual void eval(Evaluator* evaluator) const;
virtual void resetState();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册