Exemplo n.º 1
0
 private OnnxRuntime()  //Problem: it is not possible to pass any option for a Singleton
     : base(IntPtr.Zero, true)
 {
     handle = IntPtr.Zero;
     try
     {
         NativeApiStatus.VerifySuccess(NativeMethods.ONNXRuntimeInitialize(LogLevel.Warning, @"CSharpOnnxRuntime", out handle));
     }
     catch (OnnxRuntimeException e)
     {
         if (handle != IntPtr.Zero)
         {
             Delete(handle);
             handle = IntPtr.Zero;
         }
         throw e;
     }
 }