Skip to content

Commit 76a3070

Browse files
author
Uros Petkovic
committed
Fixing dump model ops feature on Windows for MGX EP
1 parent b3ba580 commit 76a3070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ MIGraphXExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph_v
10821082
// dump onnx file if environment var is set
10831083
if (dump_model_ops_) {
10841084
std::string model_name = graph_viewer.Name() + ".onnx";
1085-
std::ofstream ofs(model_name);
1085+
std::ofstream ofs(model_name, std::ios::binary);
10861086
ofs.write(onnx_string_buffer.c_str(), onnx_string_buffer.size());
10871087
ofs.close();
10881088
}
@@ -1335,7 +1335,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
13351335

13361336
if (dump_model_ops_) {
13371337
std::string onnx_name = fused_node.Name() + ".onnx";
1338-
std::ofstream ofs(onnx_name);
1338+
std::ofstream ofs(onnx_name, std::ios::binary);
13391339
ofs.write(onnx_string_buffer.data(), onnx_string_buffer.size());
13401340
ofs.close();
13411341
}

0 commit comments

Comments
 (0)