FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/Data/MapDataset.cs at master · tarekgh/TensorFlow.NET · GitHub
tarekgh
/
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
/
MapDataset.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (34 loc) · 1.29 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
Data
/
MapDataset.cs
Copy path
File metadata and controls
37 lines (34 loc) · 1.29 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
using
System
;
using
Tensorflow
.
Functions
;
using
static
Tensorflow
.
Binding
;
namespace
Tensorflow
{
/// <summary>
/// A `Dataset` that maps a function over elements in its input.
/// </summary>
public
class
MapDataset
:
UnaryDataset
{
public
MapDataset
(
IDatasetV2
input_dataset
,
Func
<
Tensors
,
Tensors
>
map_func
,
bool
use_inter_op_parallelism
=
true
,
bool
preserve_cardinality
=
false
,
bool
use_legacy_function
=
false
)
:
base
(
input_dataset
)
{
var
func
=
new
ConcreteFunction
(
$
"
{
map_func
.
Method
.
Name
}
_
{
Tensorflow
.
ops
.
uid_function
(
)
}
"
)
;
func
.
Enter
(
)
;
var
inputs
=
new
Tensors
(
)
;
foreach
(
var
input
in
input_dataset
.
element_spec
)
inputs
.
Add
(
tf
.
placeholder
(
input
.
dtype
,
shape
:
input
.
shape
,
name
:
"arg"
)
)
;
var
outputs
=
map_func
(
inputs
)
;
func
.
ToGraph
(
inputs
,
outputs
)
;
func
.
Exit
(
)
;
structure
=
func
.
OutputStructure
;
variant_tensor
=
ops
.
map_dataset
(
input_dataset
.
variant_tensor
,
func
,
output_types
,
output_shapes
,
use_inter_op_parallelism
:
use_inter_op_parallelism
,
preserve_cardinality
:
preserve_cardinality
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL