提交 bbfcee20 编写于 作者: L liaogang

Add const for Trainer::getLayerOutput

上级 fbf86436
...@@ -953,7 +953,7 @@ public: ...@@ -953,7 +953,7 @@ public:
Arguments* getForwardOutput(); Arguments* getForwardOutput();
Arguments* getLayerOutput(const std::string& layerName); Arguments* getLayerOutput(const std::string& layerName) const;
}; };
/// the N-Best results generated from one input sequence. /// the N-Best results generated from one input sequence.
......
...@@ -131,7 +131,7 @@ void Trainer::testOneDataBatch(size_t batchSize, const Arguments& args) { ...@@ -131,7 +131,7 @@ void Trainer::testOneDataBatch(size_t batchSize, const Arguments& args) {
void TrainerPrivate::finishTestPeriod() { tester_->finishTestPeriod(); } void TrainerPrivate::finishTestPeriod() { tester_->finishTestPeriod(); }
void Trainer::finishTestPeriod() { m->finishTestPeriod(); } void Trainer::finishTestPeriod() { m->finishTestPeriod(); }
Arguments* Trainer::getLayerOutput(const std::string& layerName) { Arguments* Trainer::getLayerOutput(const std::string& layerName) const {
auto nn = this->m->getGradientMachine(); auto nn = this->m->getGradientMachine();
CHECK(nn) << "trainerInternal_.getGradientMachine() is not NeuralNetwork"; CHECK(nn) << "trainerInternal_.getGradientMachine() is not NeuralNetwork";
return Arguments::createByPaddleArgument(&nn->getLayerOutput(layerName)); return Arguments::createByPaddleArgument(&nn->getLayerOutput(layerName));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册