From e9d2e90280d82d6933634b1ec7bfb15399b8d361 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Fri, 18 Oct 2019 06:34:10 -0500 Subject: [PATCH] SERIALIZABLE_ --- src/TensorFlowNET.Core/Operations/Operation.Input.cs | 4 +++- src/TensorFlowNET.Core/Operations/Operation.Output.cs | 4 +++- src/TensorFlowNET.Core/Operations/Operation.cs | 6 +++--- src/TensorFlowNET.Core/TensorFlowNET.Core.csproj | 5 ++--- src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs | 4 +++- src/TensorFlowNET.Core/Tensors/Tensor.cs | 4 +++- src/TensorFlowNET.Core/Tensors/TensorShape.cs | 6 ++++-- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/TensorFlowNET.Core/Operations/Operation.Input.cs b/src/TensorFlowNET.Core/Operations/Operation.Input.cs index f518c726..7d905f3e 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.Input.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.Input.cs @@ -14,10 +14,12 @@ limitations under the License. ******************************************************************************/ -using Newtonsoft.Json; using System; using System.Linq; using System.Runtime.InteropServices; +#if SERIALIZABLE +using System.Text.Json.Serialization; +#endif namespace Tensorflow { diff --git a/src/TensorFlowNET.Core/Operations/Operation.Output.cs b/src/TensorFlowNET.Core/Operations/Operation.Output.cs index f4dcdfd6..e68513b5 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.Output.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.Output.cs @@ -14,10 +14,12 @@ limitations under the License. ******************************************************************************/ -using Newtonsoft.Json; using System; using System.Linq; using System.Runtime.InteropServices; +#if SERIALIZABLE +using System.Text.Json.Serialization; +#endif using static Tensorflow.Binding; namespace Tensorflow diff --git a/src/TensorFlowNET.Core/Operations/Operation.cs b/src/TensorFlowNET.Core/Operations/Operation.cs index 2e653e51..c270afc3 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.cs @@ -16,12 +16,12 @@ using Google.Protobuf.Collections; #if SERIALIZABLE -using Newtonsoft.Json; +using System.Text.Json.Serialization; #endif using System; using System.Collections.Generic; using System.IO; -using System.Linq; +using System.Linq; using Tensorflow.Util; namespace Tensorflow @@ -65,7 +65,7 @@ namespace Tensorflow #if SERIALIZABLE [JsonIgnore] #endif - public int _id_value; + public int _id_value { get; set; } #if SERIALIZABLE [JsonIgnore] #endif diff --git a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj index bb5d889c..f7b7d424 100644 --- a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj +++ b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj @@ -43,7 +43,7 @@ Docs: https://tensorflownet.readthedocs.io true - TRACE;DEBUG;SERIALIZABLE + TRACE;DEBUG;SERIALIZABLE_ @@ -65,8 +65,7 @@ Docs: https://tensorflownet.readthedocs.io - - + diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs index 7c5054d3..9b9e31da 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs @@ -25,7 +25,9 @@ using System.Text; using NumSharp.Backends; using NumSharp.Backends.Unmanaged; using static Tensorflow.c_api; -using Newtonsoft.Json; +#if SERIALIZABLE +using System.Text.Json.Serialization; +#endif namespace Tensorflow { diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.cs b/src/TensorFlowNET.Core/Tensors/Tensor.cs index ef053651..485ee4f1 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.cs @@ -28,7 +28,9 @@ using NumSharp.Backends; using NumSharp.Backends.Unmanaged; using NumSharp.Utilities; using Tensorflow.Framework; -using Newtonsoft.Json; +#if SERIALIZABLE +using System.Text.Json.Serialization; +#endif namespace Tensorflow { diff --git a/src/TensorFlowNET.Core/Tensors/TensorShape.cs b/src/TensorFlowNET.Core/Tensors/TensorShape.cs index 80bb31c1..02e57800 100644 --- a/src/TensorFlowNET.Core/Tensors/TensorShape.cs +++ b/src/TensorFlowNET.Core/Tensors/TensorShape.cs @@ -1,10 +1,12 @@ -using Newtonsoft.Json; -using NumSharp; +using NumSharp; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; +#if SERIALIZABLE +using System.Text.Json.Serialization; +#endif using static Tensorflow.Binding; namespace Tensorflow