FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/APIs/c_api.cs at master · lifemd/TensorFlow.NET · GitHub
lifemd
/
TensorFlow.NET
Public
forked from
SciSharp/TensorFlow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
APIs
/
c_api.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (40 loc) · 1.43 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
APIs
/
c_api.cs
Copy path
File metadata and controls
44 lines (40 loc) · 1.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Runtime
.
InteropServices
;
using
System
.
Text
;
namespace
Tensorflow
{
/// <summary>
/// C API for TensorFlow.
/// Port from tensorflow\c\c_api.h
///
/// The API leans towards simplicity and uniformity instead of convenience
/// since most usage will be by language specific wrappers.
///
/// The params type mapping between c_api and .NET
/// TF_XX** => ref IntPtr (TF_Operation** op) => (ref IntPtr op)
/// TF_XX* => IntPtr (TF_Graph* graph) => (IntPtr graph)
/// struct => struct (TF_Output output) => (TF_Output output)
/// struct* => struct[] (TF_Output* output) => (TF_Output[] output)
/// struct* => struct* for ref
/// const char* => string
/// int32_t => int
/// int64_t* => long[]
/// size_t* => unlong[]
/// size_t* => ref uint
/// void* => IntPtr
/// string => IntPtr c_api.StringPiece(IntPtr)
/// unsigned char => byte
/// </summary>
public
partial
class
c_api
{
public
const
string
TensorFlowLibName
=
"tensorflow"
;
public
static
string
StringPiece
(
IntPtr
handle
)
{
return
handle
==
IntPtr
.
Zero
?
String
.
Empty
:
Marshal
.
PtrToStringAnsi
(
handle
)
;
}
public
delegate
void
Deallocator
(
IntPtr
data
,
IntPtr
size
,
ref
bool
deallocator
)
;
[
DllImport
(
TensorFlowLibName
)
]
public
static
unsafe
extern
IntPtr
TF_Version
(
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL