提交 f9e7cfb0 编写于 作者: W wanghaoshuang

save binary file

上级 804dd7da
......@@ -51,11 +51,18 @@ function(copy TARGET)
COMMAND ${CMAKE_COMMAND} -E copy "${src_file}" "${dst}"
COMMENT "copying ${src_file} -> ${dst}")
endforeach()
else() # not windows
else(WIN32) # not windows
add_custom_command(TARGET ${TARGET} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}"
COMMAND ${CMAKE_COMMAND} -E copy "${src_files}" "${dst}"
COMMAND mkdir -p "${dst}"
COMMAND cp -r "${src}" "${dst}"
COMMENT "copying ${src} -> ${dst}")
#add_custom_command(TARGET ${TARGET} PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}")
#message("mkdir " ${TARGET})
#add_custom_command(TARGET ${TARGET} PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}"
# COMMAND ${CMAKE_COMMAND} -E copy_directory "${src_files}" "${dst}"
# COMMENT "copying ${src} -> ${dst}")
endif(WIN32)
endforeach()
endfunction()
......
......@@ -49,7 +49,7 @@ class SaveCombineOp : public framework::OperatorBase {
}
MkDirRecursively(DirName(filename).c_str());
std::ofstream fout(filename);
std::ofstream fout(filename, std::ios_base::out | std::ios_base::binary);
PADDLE_ENFORCE(static_cast<bool>(fout), "Cannot open %s to write",
filename);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册