mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
[C#] Address the concern of append EP throw (#15973)
This commit is contained in:
parent
6d46007028
commit
5a8b892bdc
1 changed files with 20 additions and 5 deletions
|
|
@ -66,8 +66,16 @@ namespace Microsoft.ML.OnnxRuntime
|
|||
{
|
||||
CheckCudaExecutionProviderDLLs();
|
||||
SessionOptions options = new SessionOptions();
|
||||
options.AppendExecutionProvider_CUDA(deviceId);
|
||||
return options;
|
||||
try
|
||||
{
|
||||
options.AppendExecutionProvider_CUDA(deviceId);
|
||||
return options;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
options.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -148,9 +156,16 @@ namespace Microsoft.ML.OnnxRuntime
|
|||
public static SessionOptions MakeSessionOptionWithTvmProvider(String settings = "")
|
||||
{
|
||||
SessionOptions options = new SessionOptions();
|
||||
options.AppendExecutionProvider_Tvm(settings);
|
||||
|
||||
return options;
|
||||
try
|
||||
{
|
||||
options.AppendExecutionProvider_Tvm(settings);
|
||||
return options;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
options.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue