FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/test/TensorFlowNET.UnitTest/NameScopeTest.cs at master · XiaoHe68/TensorFlow.NET · GitHub
XiaoHe68
/
TensorFlow.NET
Public
forked from
kerryjiang/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.UnitTest
/
NameScopeTest.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (62 loc) · 2.37 KB
Breadcrumbs
TensorFlow.NET
/
test
/
TensorFlowNET.UnitTest
/
NameScopeTest.cs
Copy path
File metadata and controls
79 lines (62 loc) · 2.37 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
using
System
;
using
Microsoft
.
VisualStudio
.
TestTools
.
UnitTesting
;
using
Tensorflow
;
using
static
Tensorflow
.
Binding
;
namespace
TensorFlowNET
.
UnitTest
{
[
TestClass
]
public
class
NameScopeTest
{
string
name
=
""
;
[
TestMethod
]
public
void
NestedNameScope
(
)
{
Graph
g
=
tf
.
Graph
(
)
.
as_default
(
)
;
tf_with
(
new
ops
.
NameScope
(
"scope1"
)
,
scope1
=>
{
name
=
scope1
;
Assert
.
AreEqual
(
"scope1"
,
g
.
_name_stack
)
;
Assert
.
AreEqual
(
"scope1/"
,
name
)
;
var
const1
=
tf
.
constant
(
1.0
)
;
Assert
.
AreEqual
(
"scope1/Const:0"
,
const1
.
name
)
;
tf_with
(
new
ops
.
NameScope
(
"scope2"
)
,
scope2
=>
{
name
=
scope2
;
Assert
.
AreEqual
(
"scope1/scope2"
,
g
.
_name_stack
)
;
Assert
.
AreEqual
(
"scope1/scope2/"
,
name
)
;
var
const2
=
tf
.
constant
(
2.0
)
;
Assert
.
AreEqual
(
"scope1/scope2/Const:0"
,
const2
.
name
)
;
}
)
;
Assert
.
AreEqual
(
"scope1"
,
g
.
_name_stack
)
;
var
const3
=
tf
.
constant
(
2.0
)
;
Assert
.
AreEqual
(
"scope1/Const_1:0"
,
const3
.
name
)
;
}
)
;
g
.
Dispose
(
)
;
Assert
.
AreEqual
(
""
,
g
.
_name_stack
)
;
}
[
TestMethod
,
Ignore
(
"Unimplemented Usage"
)
]
public
void
NestedNameScope_Using
(
)
{
Graph
g
=
tf
.
Graph
(
)
.
as_default
(
)
;
using
(
var
name
=
new
ops
.
NameScope
(
"scope1"
)
)
{
Assert
.
AreEqual
(
"scope1"
,
g
.
_name_stack
)
;
Assert
.
AreEqual
(
"scope1/"
,
name
)
;
var
const1
=
tf
.
constant
(
1.0
)
;
Assert
.
AreEqual
(
"scope1/Const:0"
,
const1
.
name
)
;
using
(
var
name2
=
new
ops
.
NameScope
(
"scope2"
)
)
{
Assert
.
AreEqual
(
"scope1/scope2"
,
g
.
_name_stack
)
;
Assert
.
AreEqual
(
"scope1/scope2/"
,
name
)
;
var
const2
=
tf
.
constant
(
2.0
)
;
Assert
.
AreEqual
(
"scope1/scope2/Const:0"
,
const2
.
name
)
;
}
Assert
.
AreEqual
(
"scope1"
,
g
.
_name_stack
)
;
var
const3
=
tf
.
constant
(
2.0
)
;
Assert
.
AreEqual
(
"scope1/Const_1:0"
,
const3
.
name
)
;
}
;
g
.
Dispose
(
)
;
Assert
.
AreEqual
(
""
,
g
.
_name_stack
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL