mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Fix CPU memory leak due to external weights not getting memory unmapped when using non-CPU EP. (#15040)
This commit is contained in:
parent
1e7849c2c8
commit
6600fd792a
1 changed files with 2 additions and 0 deletions
|
|
@ -161,9 +161,11 @@ static common::Status DeserializeTensorProto(const Env& env, const std::basic_st
|
|||
}
|
||||
|
||||
OrtCallback ext_data_deleter;
|
||||
std::optional<ScopedOrtCallbackInvoker> scoped_ort_callback_invoker;
|
||||
if (utils::HasExternalData(tensor_proto)) {
|
||||
ORT_RETURN_IF_ERROR(ExtDataTensorProtoToTensor(env, proto_path, tensor_proto, *p_deserialize_tensor,
|
||||
ext_data_deleter));
|
||||
scoped_ort_callback_invoker = ScopedOrtCallbackInvoker(ext_data_deleter);
|
||||
} else {
|
||||
ORT_RETURN_IF_ERROR(utils::TensorProtoToTensor(env, proto_path.c_str(), tensor_proto, *p_deserialize_tensor));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue