Windows build fix for on device training training. (#13354)

### Description
This is a fix for on device training wheel build.

### Motivation and Context
when building linux wheel it treats PathString same as std::string, but
when trying to build the wheel on windows it fails because we needed to
cast the std::string to a PathString.

This error was found manually because there is no pipeline that uses the
--enable_training_on_device for windows.

Co-authored-by: Adam Louly <adamlouly@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
This commit is contained in:
Adam Louly 2022-10-20 09:58:02 -07:00 committed by GitHub
parent ac5948cb48
commit bed169192d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -870,7 +870,7 @@ void addObjectMethodsForTraining(py::module& m, ExecutionProviderRegistrationFn
checkpoint_state.def(py::init([](
const std::string& ckpt_uri) {
onnxruntime::training::api::CheckpointState state;
ORT_THROW_IF_ERROR(onnxruntime::training::api::LoadCheckpoint(ckpt_uri, state));
ORT_THROW_IF_ERROR(onnxruntime::training::api::LoadCheckpoint(ToPathString(ckpt_uri), state));
return state;
}));