Skip to content

Refactor InferenceSession Load member functions.#12430

Merged
edgchen1 merged 6 commits intomasterfrom
edgchen1/clean_up_load
Aug 3, 2022
Merged

Refactor InferenceSession Load member functions.#12430
edgchen1 merged 6 commits intomasterfrom
edgchen1/clean_up_load

Conversation

@edgchen1
Copy link
Contributor

@edgchen1 edgchen1 commented Aug 3, 2022

Description
Fix comparison of path characters when checking for ".ort" suffix.

Some clean up of InferenceSession Load functions.

  • Reduce duplication between std::string/std::wstring versions.
  • Renaming for clarity.

Motivation and Context
Fix minor issue, refactor.

inline PathString ToPathString(const PathString& s) {
return s;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's to allow ToPathString() to be called with std::string (and std::wstring on Windows). not ideal that it makes a copy. but it lets us write straightforward code that works on different platforms:

std::string s = "some/path";
PathString p = ToPathString(s);

Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@edgchen1 edgchen1 merged commit 3efd9a7 into master Aug 3, 2022
@edgchen1 edgchen1 deleted the edgchen1/clean_up_load branch August 3, 2022 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants