Browse Source

fix NotImplementedException for short data type #186

tags/v0.8.0
Oceania2018 6 years ago
parent
commit
6495cace99
3 changed files with 22 additions and 19 deletions
  1. +2
    -2
      src/TensorFlowNET.Core/Graphs/Graph.cs
  2. +17
    -14
      src/TensorFlowNET.Core/Sessions/BaseSession.cs
  3. +3
    -3
      src/TensorFlowNET.Core/TensorFlowNET.Core.csproj

+ 2
- 2
src/TensorFlowNET.Core/Graphs/Graph.cs View File

@@ -196,11 +196,11 @@ namespace Tensorflow

_create_op_helper(op, true);

Console.Write($"create_op: {op_type} '{node_def.Name}'");
/*Console.Write($"create_op: {op_type} '{node_def.Name}'");
Console.Write($", inputs: {(inputs.Length == 0 ? "empty" : String.Join(", ", inputs.Select(x => x.name)))}");
Console.Write($", control_inputs: {(control_inputs.Length == 0 ? "empty" : String.Join(", ", control_inputs.Select(x => x.name)))}");
Console.Write($", outputs: {(op.outputs.Length == 0 ? "empty" : String.Join(", ", op.outputs.Select(x => x.name)))}");
Console.WriteLine();
Console.WriteLine();*/

return op;
}


+ 17
- 14
src/TensorFlowNET.Core/Sessions/BaseSession.cs View File

@@ -62,26 +62,29 @@ namespace Tensorflow

switch (subfeed_val)
{
case IntPtr pointer:
feed_dict_tensor[subfeed_t] = pointer;
case IntPtr val:
feed_dict_tensor[subfeed_t] = val;
break;
case NDArray nd:
feed_dict_tensor[subfeed_t] = nd;
case NDArray val:
feed_dict_tensor[subfeed_t] = val;
break;
case float floatVal:
feed_dict_tensor[subfeed_t] = (NDArray)floatVal;
case float val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
case double doubleVal:
feed_dict_tensor[subfeed_t] = (NDArray)doubleVal;
case double val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
case int intVal:
feed_dict_tensor[subfeed_t] = (NDArray)intVal;
case short val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
case string str:
feed_dict_tensor[subfeed_t] = (NDArray)str;
case int val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
case byte[] bytes:
feed_dict_tensor[subfeed_t] = (NDArray)bytes;
case string val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
case byte[] val:
feed_dict_tensor[subfeed_t] = (NDArray)val;
break;
default:
Console.WriteLine($"can't handle data type of subfeed_val");


+ 3
- 3
src/TensorFlowNET.Core/TensorFlowNET.Core.csproj View File

@@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>TensorFlow.NET</AssemblyName>
<RootNamespace>Tensorflow</RootNamespace>
<Version>0.4.1</Version>
<Version>0.4.2</Version>
<Authors>Haiping Chen</Authors>
<Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -16,11 +16,11 @@
<PackageTags>TensorFlow, NumSharp, SciSharp, MachineLearning, TensorFlow.NET</PackageTags>
<Description>Google's TensorFlow binding in .NET Standard.
Docs: https://tensorflownet.readthedocs.io</Description>
<AssemblyVersion>0.4.1.0</AssemblyVersion>
<AssemblyVersion>0.4.2.0</AssemblyVersion>
<PackageReleaseNotes>Added ConfigProto to control CPU and GPU resource.
Fixed import name scope issue.</PackageReleaseNotes>
<LangVersion>7.2</LangVersion>
<FileVersion>0.4.1.0</FileVersion>
<FileVersion>0.4.2.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">


Loading…
Cancel
Save