Skip to content

Commit

Permalink
[onert/python] Separate prepare from session constructor (#14525)
Browse files Browse the repository at this point in the history
This commit separates prepare function from initializing session instance.

ONE-DCO-1.0-Signed-off-by: ragmani <[email protected]>
  • Loading branch information
ragmani authored Jan 7, 2025
1 parent 80e94f4 commit d978911
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions runtime/onert/api/python/include/nnfw_api_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class NNFW_SESSION

void close_session();
void set_input_tensorinfo(uint32_t index, const tensorinfo *tensor_info);
void prepare();
void run();
void run_async();
void wait();
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/api/python/src/nnfw_api_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ NNFW_SESSION::NNFW_SESSION(const char *package_file_path, const char *backends)
ensure_status(nnfw_create_session(&(this->session)));
ensure_status(nnfw_load_model_from_file(this->session, package_file_path));
ensure_status(nnfw_set_available_backends(this->session, backends));
ensure_status(nnfw_prepare(this->session));
}
NNFW_SESSION::~NNFW_SESSION()
{
Expand All @@ -199,6 +198,7 @@ void NNFW_SESSION::set_input_tensorinfo(uint32_t index, const tensorinfo *tensor
}
ensure_status(nnfw_set_input_tensorinfo(session, index, &ti));
}
void NNFW_SESSION::prepare() { ensure_status(nnfw_prepare(session)); }
void NNFW_SESSION::run() { ensure_status(nnfw_run(session)); }
void NNFW_SESSION::run_async() { ensure_status(nnfw_run_async(session)); }
void NNFW_SESSION::wait() { ensure_status(nnfw_await(session)); }
Expand Down

0 comments on commit d978911

Please sign in to comment.