Skip to content

Simplify ort session management #343

@javiermtorres

Description

@javiermtorres

Currently, there are three places where a session builder (and a session from there) are created:

ort::session::Session::builder()?.commit_from_memory(buf.as_slice())?

ort::session::Session::builder()

Ok(Session::builder()?.commit_from_file(file)?)

It would be good to rearrange these actions in the build and runtime sections:

  • Set up tracing before state loading
    • Currently some ort actions are not visible due to late tracing setup (it will also help our own tracing)
  • Create a common builder for all necessary sessions
    • We will likely want to use the same options for all sessions we create, and it'll be good to have those options in a single place
  • Create/access a session where needed from the existing builder

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions