forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc_api.status.cs
More file actions
52 lines (47 loc) · 1.76 KB
/
c_api.status.cs
File metadata and controls
52 lines (47 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace Tensorflow
{
public static partial class c_api
{
/// <summary>
/// Delete a previously created status object.
/// </summary>
/// <param name="s"></param>
[DllImport(TensorFlowLibName)]
public static unsafe extern void TF_DeleteStatus(IntPtr s);
/// <summary>
/// Return the code record in *s.
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
[DllImport(TensorFlowLibName)]
public static extern unsafe TF_Code TF_GetCode(IntPtr s);
/// <summary>
/// Return a pointer to the (null-terminated) error message in *s.
/// The return value points to memory that is only usable until the next
/// mutation to *s. Always returns an empty string if TF_GetCode(s) is TF_OK.
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
[DllImport(TensorFlowLibName)]
public static extern unsafe string TF_Message(IntPtr s);
/// <summary>
/// Return a new status object.
/// </summary>
/// <returns></returns>
[DllImport(TensorFlowLibName)]
public static unsafe extern IntPtr TF_NewStatus();
/// <summary>
/// Record <code, msg> in *s. Any previous information is lost.
/// A common use is to clear a status: TF_SetStatus(s, TF_OK, "");
/// </summary>
/// <param name="s"></param>
/// <param name="code"></param>
/// <param name="msg"></param>
[DllImport(TensorFlowLibName)]
public static extern void TF_SetStatus(IntPtr s, TF_Code code, string msg);
}
}