FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/test/TensorFlowNET.Native.UnitTest/CApiTest.cs at master · mishun/TensorFlow.NET · GitHub
mishun
/
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
/
test
/
TensorFlowNET.Native.UnitTest
/
CApiTest.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
155 lines (107 loc) · 7.41 KB
Breadcrumbs
TensorFlow.NET
/
test
/
TensorFlowNET.Native.UnitTest
/
CApiTest.cs
Copy path
File metadata and controls
155 lines (107 loc) · 7.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
using
Microsoft
.
VisualStudio
.
TestTools
.
UnitTesting
;
using
System
;
using
Tensorflow
.
Device
;
using
Tensorflow
.
Eager
;
namespace
Tensorflow
.
Native
.
UnitTest
{
public
class
CApiTest
{
protected
static
readonly
TF_Code
TF_OK
=
TF_Code
.
TF_OK
;
protected
static
readonly
TF_DataType
TF_FLOAT
=
TF_DataType
.
TF_FLOAT
;
protected
static
readonly
TF_DataType
TF_BOOL
=
TF_DataType
.
TF_BOOL
;
protected
void
EXPECT_TRUE
(
bool
expected
,
string
msg
=
""
)
=>
Assert
.
IsTrue
(
expected
,
msg
)
;
protected
static
void
EXPECT_EQ
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreEqual
(
expected
,
actual
,
msg
)
;
protected
void
CHECK_EQ
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreEqual
(
expected
,
actual
,
msg
)
;
protected
void
EXPECT_NE
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreNotEqual
(
expected
,
actual
,
msg
)
;
protected
void
CHECK_NE
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreNotEqual
(
expected
,
actual
,
msg
)
;
protected
void
EXPECT_GE
(
int
expected
,
int
actual
,
string
msg
=
""
)
=>
Assert
.
IsTrue
(
expected
>=
actual
,
msg
)
;
protected
void
ASSERT_EQ
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreEqual
(
expected
,
actual
,
msg
)
;
protected
void
ASSERT_NE
(
object
expected
,
object
actual
,
string
msg
=
""
)
=>
Assert
.
AreNotEqual
(
expected
,
actual
,
msg
)
;
protected
void
ASSERT_TRUE
(
bool
condition
,
string
msg
=
""
)
=>
Assert
.
IsTrue
(
condition
,
msg
)
;
protected
OperationDescription
TF_NewOperation
(
Graph
graph
,
string
opType
,
string
opName
)
=>
c_api
.
TF_NewOperation
(
graph
,
opType
,
opName
)
;
protected
void
TF_AddInput
(
OperationDescription
desc
,
TF_Output
input
)
=>
c_api
.
TF_AddInput
(
desc
,
input
)
;
protected
Operation
TF_FinishOperation
(
OperationDescription
desc
,
Status
s
)
=>
c_api
.
TF_FinishOperation
(
desc
,
s
.
Handle
)
;
protected
void
TF_SetAttrTensor
(
OperationDescription
desc
,
string
attrName
,
Tensor
value
,
Status
s
)
=>
c_api
.
TF_SetAttrTensor
(
desc
,
attrName
,
value
,
s
.
Handle
)
;
protected
void
TF_SetAttrType
(
OperationDescription
desc
,
string
attrName
,
TF_DataType
dtype
)
=>
c_api
.
TF_SetAttrType
(
desc
,
attrName
,
dtype
)
;
protected
void
TF_SetAttrBool
(
OperationDescription
desc
,
string
attrName
,
bool
value
)
=>
c_api
.
TF_SetAttrBool
(
desc
,
attrName
,
value
)
;
protected
TF_DataType
TFE_TensorHandleDataType
(
SafeEagerTensorHandle
h
)
=>
c_api
.
TFE_TensorHandleDataType
(
h
)
;
protected
int
TFE_TensorHandleNumDims
(
SafeEagerTensorHandle
h
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_TensorHandleNumDims
(
h
,
status
)
;
protected
TF_Code
TF_GetCode
(
Status
s
)
=>
s
.
Code
;
protected
static
TF_Code
TF_GetCode
(
SafeStatusHandle
s
)
=>
c_api
.
TF_GetCode
(
s
)
;
protected
static
string
TF_Message
(
SafeStatusHandle
s
)
=>
c_api
.
StringPiece
(
c_api
.
TF_Message
(
s
)
)
;
protected
SafeStatusHandle
TF_NewStatus
(
)
=>
c_api
.
TF_NewStatus
(
)
;
protected
IntPtr
TF_TensorData
(
SafeTensorHandle
t
)
=>
c_api
.
TF_TensorData
(
t
)
;
protected
ulong
TF_TensorByteSize
(
SafeTensorHandle
t
)
=>
c_api
.
TF_TensorByteSize
(
t
)
;
protected
void
TFE_OpAddInput
(
SafeEagerOpHandle
op
,
SafeEagerTensorHandle
h
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_OpAddInput
(
op
,
h
,
status
)
;
protected
void
TFE_OpSetAttrType
(
SafeEagerOpHandle
op
,
string
attr_name
,
TF_DataType
value
)
=>
c_api
.
TFE_OpSetAttrType
(
op
,
attr_name
,
value
)
;
protected
void
TFE_OpSetAttrShape
(
SafeEagerOpHandle
op
,
string
attr_name
,
long
[
]
dims
,
int
num_dims
,
SafeStatusHandle
out_status
)
=>
c_api
.
TFE_OpSetAttrShape
(
op
,
attr_name
,
dims
,
num_dims
,
out_status
)
;
protected
void
TFE_OpSetAttrString
(
SafeEagerOpHandle
op
,
string
attr_name
,
string
value
,
uint
length
)
=>
c_api
.
TFE_OpSetAttrString
(
op
,
attr_name
,
value
,
length
)
;
protected
SafeEagerOpHandle
TFE_NewOp
(
SafeContextHandle
ctx
,
string
op_or_function_name
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_NewOp
(
ctx
,
op_or_function_name
,
status
)
;
protected
SafeEagerTensorHandle
TFE_NewTensorHandle
(
SafeTensorHandle
t
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_NewTensorHandle
(
t
,
status
)
;
protected
void
TFE_Execute
(
SafeEagerOpHandle
op
,
SafeEagerTensorHandle
[
]
retvals
,
out
int
num_retvals
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_Execute
(
op
,
retvals
,
out
num_retvals
,
status
)
;
protected
SafeContextOptionsHandle
TFE_NewContextOptions
(
)
=>
c_api
.
TFE_NewContextOptions
(
)
;
protected
SafeContextHandle
TFE_NewContext
(
SafeContextOptionsHandle
opts
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_NewContext
(
opts
,
status
)
;
protected
int
TFE_OpGetInputLength
(
SafeEagerOpHandle
op
,
string
input_name
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_OpGetInputLength
(
op
,
input_name
,
status
)
;
protected
int
TFE_OpAddInputList
(
SafeEagerOpHandle
op
,
SafeEagerTensorHandle
[
]
inputs
,
int
num_inputs
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_OpAddInputList
(
op
,
inputs
,
num_inputs
,
status
)
;
protected
int
TFE_OpGetOutputLength
(
SafeEagerOpHandle
op
,
string
input_name
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_OpGetOutputLength
(
op
,
input_name
,
status
)
;
protected
void
TFE_DeleteTensorHandle
(
IntPtr
h
)
=>
c_api
.
TFE_DeleteTensorHandle
(
h
)
;
protected
SafeExecutorHandle
TFE_ContextGetExecutorForThread
(
SafeContextHandle
ctx
)
=>
c_api
.
TFE_ContextGetExecutorForThread
(
ctx
)
;
protected
void
TFE_ExecutorWaitForAllPendingNodes
(
SafeExecutorHandle
executor
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_ExecutorWaitForAllPendingNodes
(
executor
,
status
)
;
protected
SafeTensorHandle
TFE_TensorHandleResolve
(
SafeEagerTensorHandle
h
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_TensorHandleResolve
(
h
,
status
)
;
protected
string
TFE_TensorHandleDeviceName
(
SafeEagerTensorHandle
h
,
SafeStatusHandle
status
)
=>
c_api
.
StringPiece
(
c_api
.
TFE_TensorHandleDeviceName
(
h
,
status
)
)
;
protected
string
TFE_TensorHandleBackingDeviceName
(
SafeEagerTensorHandle
h
,
SafeStatusHandle
status
)
=>
c_api
.
StringPiece
(
c_api
.
TFE_TensorHandleBackingDeviceName
(
h
,
status
)
)
;
protected
SafeDeviceListHandle
TFE_ContextListDevices
(
SafeContextHandle
ctx
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_ContextListDevices
(
ctx
,
status
)
;
protected
int
TF_DeviceListCount
(
SafeDeviceListHandle
list
)
=>
c_api
.
TF_DeviceListCount
(
list
)
;
protected
string
TF_DeviceListType
(
SafeDeviceListHandle
list
,
int
index
,
SafeStatusHandle
status
)
=>
c_api
.
StringPiece
(
c_api
.
TF_DeviceListType
(
list
,
index
,
status
)
)
;
protected
string
TF_DeviceListName
(
SafeDeviceListHandle
list
,
int
index
,
SafeStatusHandle
status
)
=>
c_api
.
TF_DeviceListName
(
list
,
index
,
status
)
;
protected
SafeEagerTensorHandle
TFE_TensorHandleCopyToDevice
(
SafeEagerTensorHandle
h
,
SafeContextHandle
ctx
,
string
device_name
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_TensorHandleCopyToDevice
(
h
,
ctx
,
device_name
,
status
)
;
protected
void
TFE_OpSetDevice
(
SafeEagerOpHandle
op
,
string
device_name
,
SafeStatusHandle
status
)
=>
c_api
.
TFE_OpSetDevice
(
op
,
device_name
,
status
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL