Skip to content

Commit

Permalink
[onert/api] Make a clone circle in nnfw_train_export_circle (Samsung#…
Browse files Browse the repository at this point in the history
…13001)

It is a missing code segment.
It makes a copy of original circle before exporting circle.

ONE-DCO-1.0-Signed-off-by: Sanggyu Lee <[email protected]>
  • Loading branch information
glistening authored May 16, 2024
1 parent a8f90f3 commit f99e491
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/onert/api/nnfw/src/nnfw_api_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,10 @@ NNFW_STATUS nnfw_session::train_export_circle(const char *path)
size_t _buf_sz = 0;
};

std::ifstream src(_model_path, std::ios::binary);
std::ofstream dst(path, std::ios::binary);
dst << src.rdbuf();

MMappedFile mmapfile(path);
if (!mmapfile.ensure_mmap())
return NNFW_STATUS_ERROR;
Expand Down

0 comments on commit f99e491

Please sign in to comment.