FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/IO/gfile.cs at master · lokinfey/TensorFlow.NET · GitHub
lokinfey
/
TensorFlow.NET
Public
forked from
SciSharp/TensorFlow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
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
/
IO
/
gfile.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (31 loc) · 1.04 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
IO
/
gfile.cs
Copy path
File metadata and controls
35 lines (31 loc) · 1.04 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
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
IO
;
using
System
.
Text
;
namespace
Tensorflow
.
IO
{
public
class
GFile
{
/// <summary>
/// Recursive directory tree generator for directories.
/// </summary>
/// <param name="top">a Directory name</param>
/// <param name="in_order">Traverse in order if True, post order if False.</param>
public
IEnumerable
<
(
string
,
string
[
]
,
string
[
]
)
>
Walk
(
string
top
,
bool
in_order
=
true
)
{
return
walk_v2
(
top
,
in_order
)
;
}
private
IEnumerable
<
(
string
,
string
[
]
,
string
[
]
)
>
walk_v2
(
string
top
,
bool
topdown
)
{
var
subdirs
=
Directory
.
GetDirectories
(
top
)
;
var
files
=
Directory
.
GetFiles
(
top
)
;
var
here
=
(
top
,
subdirs
,
files
)
;
if
(
subdirs
.
Length
==
0
)
yield
return
here
;
else
foreach
(
var
dir
in
subdirs
)
foreach
(
var
f
in
walk_v2
(
dir
,
topdown
)
)
yield
return
f
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL