提交 41024a77 编写于 作者: W willzhang4a58

Add code owners

上级 5291a598
* @willzhang4a58
/oneflow/core/kernel/ @Wind5 @chengtbf
/oneflow/core/kernel/ @Wind5 @chengtbf @LeGend-AI
/oneflow/core/actor/ @Wind5 @LeGend-AI
......@@ -26,23 +26,15 @@ void PrintProtoToString(const PbMessage& proto, std::string* str) {
// txt file
void ParseProtoFromTextFile(const std::string& file_path, PbMessage* proto) {
std::ifstream in_stream(file_path.c_str(), std::ifstream::in);
// make sure in_stream lives longer than input
{
IstreamInputStream input(&in_stream);
CHECK(google::protobuf::TextFormat::Parse(&input, proto));
}
in_stream.close();
IstreamInputStream input(&in_stream);
CHECK(google::protobuf::TextFormat::Parse(&input, proto));
}
void PrintProtoToTextFile(const PbMessage& proto,
const std::string& file_path) {
std::ofstream out_stream(file_path.c_str(),
std::ofstream::out | std::ofstream::trunc);
// make sure out_stream lives longer than output
{
OstreamOutputStream output(&out_stream);
CHECK(google::protobuf::TextFormat::Print(proto, &output));
}
out_stream.close();
OstreamOutputStream output(&out_stream);
CHECK(google::protobuf::TextFormat::Print(proto, &output));
}
#define DEFINE_GET_VAL_FROM_PBMESSAGE(ret_type, func_name) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册