Skip to content

Commit 71ea081

Browse files
committed
TensorSliceDataset
1 parent 9e68b94 commit 71ea081

6 files changed

Lines changed: 34 additions & 11 deletions

File tree

src/TensorFlowNET.Core/APIs/c_api.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*****************************************************************************
2-
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
2+
Copyright 2020 Haiping Chen. All Rights Reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ namespace Tensorflow
4343
/// </summary>
4444
public partial class c_api
4545
{
46-
public const string TensorFlowLibName = "tensorflow";
46+
public const string TensorFlowLibName = @"D:\SciSharp\tensorflow-google\bazel-bin\tensorflow\tensorflow.dll";
4747

4848
public static string StringPiece(IntPtr handle)
4949
{

src/TensorFlowNET.Core/APIs/tf.data.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class tensorflow
2424

2525
public class DataOps
2626
{
27-
public TensorSliceDataset Dataset { get; } = new TensorSliceDataset();
27+
public DatasetManager Dataset { get; } = new DatasetManager();
2828
}
2929
}
3030
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using NumSharp;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
6+
namespace Tensorflow
7+
{
8+
public class DatasetManager
9+
{
10+
public IDatasetV2 from_tensor_slices(NDArray features, NDArray labels)
11+
=> new TensorSliceDataset(features, labels);
12+
}
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow
6+
{
7+
public interface IDatasetV2
8+
{
9+
10+
}
11+
}

src/TensorFlowNET.Core/Data/TensorSliceDataset.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55

66
namespace Tensorflow
77
{
8-
public class TensorSliceDataset
8+
public class TensorSliceDataset : IDatasetV2
99
{
10-
public TensorSliceDataset(params NDArray[] elements)
11-
{
12-
13-
}
10+
NDArray features;
11+
NDArray labels;
1412

15-
public TensorSliceDataset from_tensor_slices(params NDArray[] elements)
13+
public TensorSliceDataset(NDArray features, NDArray labels)
1614
{
17-
throw new NotImplementedException("");
15+
this.features = features;
16+
this.labels = labels;
1817
}
1918
}
2019
}

src/TensorFlowNET.Core/TensorFlow.Binding.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyName>TensorFlow.NET</AssemblyName>
66
<RootNamespace>Tensorflow</RootNamespace>
77
<TargetTensorFlow>2.2.0</TargetTensorFlow>
8-
<Version>0.20.0-preview1</Version>
8+
<Version>0.20.0-preview2</Version>
99
<LangVersion>8.0</LangVersion>
1010
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors>
1111
<Company>SciSharp STACK</Company>

0 commit comments

Comments
 (0)