Browse Source

TensorSliceDataset

tags/v0.20
Oceania2018 5 years ago
parent
commit
71ea081ea8
6 changed files with 34 additions and 11 deletions
  1. +2
    -2
      src/TensorFlowNET.Core/APIs/c_api.cs
  2. +1
    -1
      src/TensorFlowNET.Core/APIs/tf.data.cs
  3. +13
    -0
      src/TensorFlowNET.Core/Data/DatasetManager.cs
  4. +11
    -0
      src/TensorFlowNET.Core/Data/IDatasetV2.cs
  5. +6
    -7
      src/TensorFlowNET.Core/Data/TensorSliceDataset.cs
  6. +1
    -1
      src/TensorFlowNET.Core/TensorFlow.Binding.csproj

+ 2
- 2
src/TensorFlowNET.Core/APIs/c_api.cs View File

@@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
Copyright 2020 Haiping Chen. All Rights Reserved.


Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ namespace Tensorflow
/// </summary> /// </summary>
public partial class c_api public partial class c_api
{ {
public const string TensorFlowLibName = "tensorflow";
public const string TensorFlowLibName = @"D:\SciSharp\tensorflow-google\bazel-bin\tensorflow\tensorflow.dll";


public static string StringPiece(IntPtr handle) public static string StringPiece(IntPtr handle)
{ {


+ 1
- 1
src/TensorFlowNET.Core/APIs/tf.data.cs View File

@@ -24,7 +24,7 @@ namespace Tensorflow


public class DataOps public class DataOps
{ {
public TensorSliceDataset Dataset { get; } = new TensorSliceDataset();
public DatasetManager Dataset { get; } = new DatasetManager();
} }
} }
} }

+ 13
- 0
src/TensorFlowNET.Core/Data/DatasetManager.cs View File

@@ -0,0 +1,13 @@
using NumSharp;
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow
{
public class DatasetManager
{
public IDatasetV2 from_tensor_slices(NDArray features, NDArray labels)
=> new TensorSliceDataset(features, labels);
}
}

+ 11
- 0
src/TensorFlowNET.Core/Data/IDatasetV2.cs View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow
{
public interface IDatasetV2
{

}
}

+ 6
- 7
src/TensorFlowNET.Core/Data/TensorSliceDataset.cs View File

@@ -5,16 +5,15 @@ using System.Text;


namespace Tensorflow namespace Tensorflow
{ {
public class TensorSliceDataset
public class TensorSliceDataset : IDatasetV2
{ {
public TensorSliceDataset(params NDArray[] elements)
{

}
NDArray features;
NDArray labels;


public TensorSliceDataset from_tensor_slices(params NDArray[] elements)
public TensorSliceDataset(NDArray features, NDArray labels)
{ {
throw new NotImplementedException("");
this.features = features;
this.labels = labels;
} }
} }
} }

+ 1
- 1
src/TensorFlowNET.Core/TensorFlow.Binding.csproj View File

@@ -5,7 +5,7 @@
<AssemblyName>TensorFlow.NET</AssemblyName> <AssemblyName>TensorFlow.NET</AssemblyName>
<RootNamespace>Tensorflow</RootNamespace> <RootNamespace>Tensorflow</RootNamespace>
<TargetTensorFlow>2.2.0</TargetTensorFlow> <TargetTensorFlow>2.2.0</TargetTensorFlow>
<Version>0.20.0-preview1</Version>
<Version>0.20.0-preview2</Version>
<LangVersion>8.0</LangVersion> <LangVersion>8.0</LangVersion>
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> <Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors>
<Company>SciSharp STACK</Company> <Company>SciSharp STACK</Company>


Loading…
Cancel
Save