forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatasetManager.cs
More file actions
44 lines (34 loc) · 1.59 KB
/
DatasetManager.cs
File metadata and controls
44 lines (34 loc) · 1.59 KB
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
using Tensorflow.NumPy;
using System.Collections.Generic;
using Tensorflow.Data;
namespace Tensorflow
{
public class DatasetManager
{
public IDatasetV2 from_generator<T>(IEnumerable<T> generator, TF_DataType[] output_types, Shape[] output_shapes)
=> new GeneratorDataset();
/// <summary>
/// Creates a `Dataset` with a single element, comprising the given tensors.
/// </summary>
/// <param name="tensors"></param>
/// <returns></returns>
public IDatasetV2 from_tensors(NDArray tensors)
=> new TensorDataset(tensors);
public IDatasetV2 from_tensors(Tensors tensors)
=> new TensorDataset(tensors);
public IDatasetV2 from_tensor_slices(Tensor features, Tensor labels)
=> new TensorSliceDataset(features, labels);
public IDatasetV2 from_tensor_slices(Tensor tensor)
=> new TensorSliceDataset(tensor);
public IDatasetV2 from_tensor_slices(string[] array)
=> new TensorSliceDataset(array);
public IDatasetV2 from_tensor_slices(NDArray array)
=> new TensorSliceDataset(array);
public IDatasetV2 range(int count, TF_DataType output_type = TF_DataType.TF_INT64)
=> new RangeDataset(count, output_type: output_type);
public IDatasetV2 range(int start, int stop, int step = 1, TF_DataType output_type = TF_DataType.TF_INT64)
=> new RangeDataset(stop, start: start, step: step, output_type: output_type);
public IDatasetV2 zip(params IDatasetV2[] ds)
=> new ZipDataset(ds);
}
}