diff --git a/src/TensorFlowNET.Core/Status/Status.cs b/src/TensorFlowNET.Core/Status/Status.cs
index 7d029e79..ce561f75 100644
--- a/src/TensorFlowNET.Core/Status/Status.cs
+++ b/src/TensorFlowNET.Core/Status/Status.cs
@@ -16,6 +16,7 @@
using System;
using System.Runtime.CompilerServices;
+using static Tensorflow.c_api;
namespace Tensorflow
{
@@ -28,27 +29,28 @@ namespace Tensorflow
///
/// Error message
///
- public string Message => c_api.StringPiece(c_api.TF_Message(_handle));
+ public string Message => c_api.StringPiece(TF_Message(_handle));
///
/// Error code
///
- public TF_Code Code => c_api.TF_GetCode(_handle);
+ public TF_Code Code => TF_GetCode(_handle);
public Status()
{
- _handle = c_api.TF_NewStatus();
+ _handle = TF_NewStatus();
}
public void SetStatus(TF_Code code, string msg)
{
- c_api.TF_SetStatus(_handle, code, msg);
+ TF_SetStatus(_handle, code, msg);
}
///
/// Check status
/// Throw exception with error message if code != TF_OK
///
+ /// When the returned check is not TF_Code.TF_OK
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Check(bool throwException = false)
{
@@ -56,9 +58,7 @@ namespace Tensorflow
{
Console.WriteLine(Message);
if (throwException)
- {
- throw new Exception(Message);
- }
+ throw new TensorflowException(Message);
}
}
@@ -68,6 +68,6 @@ namespace Tensorflow
}
protected override void DisposeUnmanagedResources(IntPtr handle)
- => c_api.TF_DeleteStatus(handle);
+ => TF_DeleteStatus(handle);
}
}
\ No newline at end of file