FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/Python.cs at master · wadereye/TensorFlow.NET · GitHub
wadereye
/
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
/
Python.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (66 loc) · 1.6 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
Python.cs
Copy path
File metadata and controls
73 lines (66 loc) · 1.6 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
using
NumSharp
.
Core
;
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Text
;
namespace
Tensorflow
{
/// <summary>
/// Mapping C# functions to Python
/// </summary>
public
class
Python
{
protected
void
print
(
object
obj
)
{
Console
.
WriteLine
(
obj
.
ToString
(
)
)
;
}
public
static
void
with
(
IPython
py
,
Action
<
IPython
>
action
)
{
try
{
py
.
__enter__
(
)
;
action
(
py
)
;
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
ToString
(
)
)
;
throw
ex
;
}
finally
{
py
.
__exit__
(
)
;
py
.
Dispose
(
)
;
}
}
public
static
void
with
<
T
>
(
IPython
py
,
Action
<
T
>
action
)
where
T
:
IPython
{
try
{
py
.
__enter__
(
)
;
action
(
(
T
)
py
)
;
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
ToString
(
)
)
;
throw
ex
;
}
finally
{
py
.
__exit__
(
)
;
py
.
Dispose
(
)
;
}
}
public
static
(
T
,
T
)
zip
<
T
>
(
T
t1
,
T
t2
,
int
index
=
0
)
where
T
:
IList
<
T
>
{
return
(
t1
[
index
]
,
t2
[
index
]
)
;
}
public
static
(
T
,
T
)
zip
<
T
>
(
NDArray
t1
,
NDArray
t2
,
int
index
=
0
)
{
return
(
t1
.
Data
<
T
>
(
index
)
,
t2
.
Data
<
T
>
(
index
)
)
;
}
}
public
interface
IPython
:
IDisposable
{
void
__enter__
(
)
;
void
__exit__
(
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL