FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/Data/ShardDataset.cs at master · dmnhwjin/TensorFlow.NET · GitHub
dmnhwjin
/
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
/
Data
/
ShardDataset.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (25 loc) · 877 Bytes
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
Data
/
ShardDataset.cs
Copy path
File metadata and controls
28 lines (25 loc) · 877 Bytes
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
using
static
Tensorflow
.
Binding
;
namespace
Tensorflow
{
/// <summary>
/// A `Dataset` for sharding its input.
/// </summary>
public
class
ShardDataset
:
UnaryUnchangedStructureDataset
{
Tensor
_num_shards
;
Tensor
_index
;
public
ShardDataset
(
IDatasetV2
input_dataset
,
int
num_shards
,
int
index
)
:
base
(
input_dataset
)
{
_num_shards
=
tf
.
convert_to_tensor
(
num_shards
,
dtype
:
TF_DataType
.
TF_INT64
,
name
:
"num_shards"
)
;
_index
=
tf
.
convert_to_tensor
(
index
,
dtype
:
TF_DataType
.
TF_INT64
,
name
:
"index"
)
;
variant_tensor
=
ops
.
shard_dataset
(
input_dataset
.
variant_tensor
,
num_shards
:
_num_shards
,
index
:
_index
,
input_dataset
.
output_types
,
input_dataset
.
output_shapes
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL