forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapDataset.cs
More file actions
28 lines (26 loc) · 801 Bytes
/
MapDataset.cs
File metadata and controls
28 lines (26 loc) · 801 Bytes
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 System;
using System.Collections.Generic;
using System.Text;
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<Tensor, Tensor> map_func,
bool use_inter_op_parallelism = true,
bool preserve_cardinality = false,
bool use_legacy_function = false) : base(input_dataset)
{
foreach(var input in input_dataset)
{
var data = map_func(input.Item1);
}
variant_tensor = ops.map_dataset(input_dataset.variant_tensor,
output_types,
output_shapes);
}
}
}