From 8ee2e9a2826e30f8ed1b10f0036b086108f0690d Mon Sep 17 00:00:00 2001 From: Yaohui Liu Date: Thu, 20 Apr 2023 03:57:03 +0800 Subject: [PATCH 1/2] Fix the example errors caused by (#1022). --- src/TensorFlowNET.Core/Util/ProtoUtils.cs | 2 +- src/TensorFlowNET.Core/Variables/ResourceVariable.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TensorFlowNET.Core/Util/ProtoUtils.cs b/src/TensorFlowNET.Core/Util/ProtoUtils.cs index e7de8e309..c1557da42 100644 --- a/src/TensorFlowNET.Core/Util/ProtoUtils.cs +++ b/src/TensorFlowNET.Core/Util/ProtoUtils.cs @@ -10,7 +10,7 @@ public static object GetSingleAttrValue(AttrValue value, AttrValue.ValueOneofCas { return valueCase switch { - AttrValue.ValueOneofCase.S => value.S, + AttrValue.ValueOneofCase.S => value.S.ToStringUtf8(), AttrValue.ValueOneofCase.I => value.I, AttrValue.ValueOneofCase.F => value.F, AttrValue.ValueOneofCase.B => value.B, diff --git a/src/TensorFlowNET.Core/Variables/ResourceVariable.cs b/src/TensorFlowNET.Core/Variables/ResourceVariable.cs index dbd934af9..bc23df3ed 100644 --- a/src/TensorFlowNET.Core/Variables/ResourceVariable.cs +++ b/src/TensorFlowNET.Core/Variables/ResourceVariable.cs @@ -174,7 +174,7 @@ private void _init_from_args(object initial_value = null, base.__init__(trainable: trainable, shape: shape, - dtype: dtype, + dtype: _dtype, handle: handle, name: name, unique_id: unique_id, From bd7d56a0b92c2ca80c110138e07c3598e43b81cb Mon Sep 17 00:00:00 2001 From: Yaohui Liu Date: Thu, 20 Apr 2023 04:02:09 +0800 Subject: [PATCH 2/2] Move the content of Tensorflow.Common to Tensorflow.Binding. --- TensorFlow.NET.sln | 14 -------------- Tensorflow.Common/Tensorflow.Common.csproj | 11 ----------- .../Extensions/DictionaryExtension.cs | 0 .../TensorFlowNET.Core/Extensions}/NamedTuple.cs | 0 .../Extensions/OneofExtension.cs | 0 src/TensorFlowNET.Core/Tensorflow.Binding.csproj | 4 ---- 6 files changed, 29 deletions(-) delete mode 100644 Tensorflow.Common/Tensorflow.Common.csproj rename {Tensorflow.Common => src/TensorFlowNET.Core}/Extensions/DictionaryExtension.cs (100%) rename {Tensorflow.Common/Types => src/TensorFlowNET.Core/Extensions}/NamedTuple.cs (100%) rename {Tensorflow.Common => src/TensorFlowNET.Core}/Extensions/OneofExtension.cs (100%) diff --git a/TensorFlow.NET.sln b/TensorFlow.NET.sln index 433cace08..6357ec25e 100644 --- a/TensorFlow.NET.sln +++ b/TensorFlow.NET.sln @@ -23,8 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Keras.UnitTest", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Graph.UnitTest", "test\TensorFlowNET.Graph.UnitTest\TensorFlowNET.Graph.UnitTest.csproj", "{3F5388FF-FBB4-462B-8F6F-829FFBAEB8A3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tensorflow.Common", "Tensorflow.Common\Tensorflow.Common.csproj", "{0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -155,18 +153,6 @@ Global {3F5388FF-FBB4-462B-8F6F-829FFBAEB8A3}.Release|x64.Build.0 = Release|x64 {3F5388FF-FBB4-462B-8F6F-829FFBAEB8A3}.Release|x86.ActiveCfg = Release|Any CPU {3F5388FF-FBB4-462B-8F6F-829FFBAEB8A3}.Release|x86.Build.0 = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|x64.ActiveCfg = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|x64.Build.0 = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|x86.ActiveCfg = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Debug|x86.Build.0 = Debug|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|Any CPU.Build.0 = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|x64.ActiveCfg = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|x64.Build.0 = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|x86.ActiveCfg = Release|Any CPU - {0C5DD8A8-AB1E-40AB-8CE3-F6EA0C1ED680}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tensorflow.Common/Tensorflow.Common.csproj b/Tensorflow.Common/Tensorflow.Common.csproj deleted file mode 100644 index 0501cded4..000000000 --- a/Tensorflow.Common/Tensorflow.Common.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/Tensorflow.Common/Extensions/DictionaryExtension.cs b/src/TensorFlowNET.Core/Extensions/DictionaryExtension.cs similarity index 100% rename from Tensorflow.Common/Extensions/DictionaryExtension.cs rename to src/TensorFlowNET.Core/Extensions/DictionaryExtension.cs diff --git a/Tensorflow.Common/Types/NamedTuple.cs b/src/TensorFlowNET.Core/Extensions/NamedTuple.cs similarity index 100% rename from Tensorflow.Common/Types/NamedTuple.cs rename to src/TensorFlowNET.Core/Extensions/NamedTuple.cs diff --git a/Tensorflow.Common/Extensions/OneofExtension.cs b/src/TensorFlowNET.Core/Extensions/OneofExtension.cs similarity index 100% rename from Tensorflow.Common/Extensions/OneofExtension.cs rename to src/TensorFlowNET.Core/Extensions/OneofExtension.cs diff --git a/src/TensorFlowNET.Core/Tensorflow.Binding.csproj b/src/TensorFlowNET.Core/Tensorflow.Binding.csproj index 3a6bcfa13..53184c738 100644 --- a/src/TensorFlowNET.Core/Tensorflow.Binding.csproj +++ b/src/TensorFlowNET.Core/Tensorflow.Binding.csproj @@ -113,8 +113,4 @@ https://tensorflownet.readthedocs.io - - - -