Merge pull request #2912 from reyoung/feature/better_network_debug_str

Override Net::DebugString to invoke inner ops_
cblas_new
Yu Yang 8 years ago committed by GitHub
commit ad728419d6

@ -55,5 +55,14 @@ void PlainNet::CompleteAddOp() {
add_op_done_ = true;
}
std::string PlainNet::DebugString() const {
std::ostringstream os;
os << this->type_ << ":" << std::endl;
for (auto& op : ops_) {
os << "\t" << op->DebugString() << std::endl;
}
return os.str();
}
} // namespace framework
} // namespace paddle

@ -88,6 +88,8 @@ class PlainNet : public Net {
void CompleteAddOp() override;
std::string DebugString() const override;
std::vector<OperatorPtr> ops_;
private:

@ -72,7 +72,7 @@ class OperatorBase {
return boost::get<T>(attrs_.at(name));
}
std::string DebugString() const;
virtual std::string DebugString() const;
/// Init will be called after CreateOperator, you can put some initialization
/// logic here.

Loading…
Cancel
Save