diff --git a/src/TensorFlowNET.Core/Keras/Engine/Model.cs b/src/TensorFlowNET.Core/Keras/Engine/Model.cs index fa168eb0..b52c5335 100644 --- a/src/TensorFlowNET.Core/Keras/Engine/Model.cs +++ b/src/TensorFlowNET.Core/Keras/Engine/Model.cs @@ -8,7 +8,9 @@ namespace Tensorflow.Keras.Engine bool _cloning; #pragma warning restore CS0169 // The field 'Model._cloning' is never used #pragma warning disable CS0108 // Member hides inherited member; missing new keyword +#pragma warning disable CS0414 // The field 'Model._is_compiled' is assigned but its value is never used bool _is_compiled; +#pragma warning restore CS0414 // The field 'Model._is_compiled' is assigned but its value is never used #pragma warning restore CS0108 // Member hides inherited member; missing new keyword string loss; IOptimizer optimizer; diff --git a/src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs b/src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs index 1a81bac8..2d132694 100644 --- a/src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs +++ b/src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs @@ -23,14 +23,18 @@ namespace Tensorflow.Keras.Layers { public class BatchNormalization : Tensorflow.Layers.Layer { +#pragma warning disable CS0414 // The field 'BatchNormalization._USE_V2_BEHAVIOR' is assigned but its value is never used private bool _USE_V2_BEHAVIOR = true; +#pragma warning restore CS0414 // The field 'BatchNormalization._USE_V2_BEHAVIOR' is assigned but its value is never used private float momentum; private float epsilon; private bool center; private bool scale; private bool renorm; private bool fused; +#pragma warning disable CS0414 // The field 'BatchNormalization._bessels_correction_test_only' is assigned but its value is never used private bool _bessels_correction_test_only; +#pragma warning restore CS0414 // The field 'BatchNormalization._bessels_correction_test_only' is assigned but its value is never used private int[] axis; private string _data_format; private IInitializer beta_initializer; diff --git a/src/TensorFlowNET.Core/Summaries/EventFileWriter.cs b/src/TensorFlowNET.Core/Summaries/EventFileWriter.cs index 4ec6fa24..3e553078 100644 --- a/src/TensorFlowNET.Core/Summaries/EventFileWriter.cs +++ b/src/TensorFlowNET.Core/Summaries/EventFileWriter.cs @@ -31,7 +31,9 @@ namespace Tensorflow.Summaries EventsWriter _ev_writer; int _flush_secs; Event _sentinel_event; +#pragma warning disable CS0414 // The field 'EventFileWriter._closed' is assigned but its value is never used bool _closed; +#pragma warning restore CS0414 // The field 'EventFileWriter._closed' is assigned but its value is never used EventLoggerThread _worker; public EventFileWriter(string logdir, int max_queue = 10, int flush_secs= 120, diff --git a/src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs b/src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs index f65019a6..0a63ca9c 100644 --- a/src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs +++ b/src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs @@ -27,7 +27,9 @@ namespace Tensorflow.Summaries public class EventLoggerThread { Queue _queue; +#pragma warning disable CS0414 // The field 'EventLoggerThread.daemon' is assigned but its value is never used bool daemon; +#pragma warning restore CS0414 // The field 'EventLoggerThread.daemon' is assigned but its value is never used EventsWriter _ev_writer; int _flush_secs; Event _sentinel_event; diff --git a/src/TensorFlowNET.Core/Training/Saving/Saver.cs b/src/TensorFlowNET.Core/Training/Saving/Saver.cs index 18aaf480..d8de44fb 100644 --- a/src/TensorFlowNET.Core/Training/Saving/Saver.cs +++ b/src/TensorFlowNET.Core/Training/Saving/Saver.cs @@ -46,7 +46,9 @@ namespace Tensorflow private bool _is_empty; private float _next_checkpoint_time; private bool _save_relative_paths; +#pragma warning disable CS0414 // The field 'Saver._object_restore_saver' is assigned but its value is never used private bool? _object_restore_saver; +#pragma warning restore CS0414 // The field 'Saver._object_restore_saver' is assigned but its value is never used private Dictionary _last_checkpoints; private Dictionary _checkpoints_to_be_deleted; diff --git a/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs b/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs index fe13405f..a18ba58f 100644 --- a/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs +++ b/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs @@ -11,7 +11,9 @@ namespace Tensorflow.Training int _every_secs = 60; int _every_steps = 0; int _last_triggered_step = 0; +#pragma warning disable CS0414 // The field 'SecondOrStepTimer._last_triggered_time' is assigned but its value is never used int _last_triggered_time = 0; +#pragma warning restore CS0414 // The field 'SecondOrStepTimer._last_triggered_time' is assigned but its value is never used public SecondOrStepTimer(int every_secs, int every_steps) { diff --git a/src/TensorFlowNET.Core/Variables/VariableScope.cs b/src/TensorFlowNET.Core/Variables/VariableScope.cs index 68c75ca3..a95a101c 100644 --- a/src/TensorFlowNET.Core/Variables/VariableScope.cs +++ b/src/TensorFlowNET.Core/Variables/VariableScope.cs @@ -25,7 +25,9 @@ namespace Tensorflow public class VariableScope { public bool use_resource { get; set; } +#pragma warning disable CS0414 // The field 'VariableScope._reuse' is assigned but its value is never used private _ReuseMode _reuse; +#pragma warning restore CS0414 // The field 'VariableScope._reuse' is assigned but its value is never used public bool resue; private TF_DataType _dtype; diff --git a/src/TensorFlowNET.Core/Variables/_VariableStore.cs b/src/TensorFlowNET.Core/Variables/_VariableStore.cs index bb81a707..5b6b6b54 100644 --- a/src/TensorFlowNET.Core/Variables/_VariableStore.cs +++ b/src/TensorFlowNET.Core/Variables/_VariableStore.cs @@ -27,7 +27,9 @@ namespace Tensorflow { private Dictionary _vars; private Dictionary _partitioned_vars; +#pragma warning disable CS0414 // The field '_VariableStore._store_eager_variables' is assigned but its value is never used private bool _store_eager_variables; +#pragma warning restore CS0414 // The field '_VariableStore._store_eager_variables' is assigned but its value is never used public _VariableStore() { diff --git a/src/TensorFlowNET.Core/ops._DefaultStack.cs b/src/TensorFlowNET.Core/ops._DefaultStack.cs index a9250d2b..a41d4964 100644 --- a/src/TensorFlowNET.Core/ops._DefaultStack.cs +++ b/src/TensorFlowNET.Core/ops._DefaultStack.cs @@ -26,7 +26,9 @@ namespace Tensorflow public class _DefaultStack : ITensorFlowObject { Stack stack; +#pragma warning disable CS0414 // The field 'ops._DefaultStack._enforce_nesting' is assigned but its value is never used bool _enforce_nesting = true; +#pragma warning restore CS0414 // The field 'ops._DefaultStack._enforce_nesting' is assigned but its value is never used public _DefaultStack() { diff --git a/test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs b/test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs index acb8c41e..4e87af3c 100644 --- a/test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs +++ b/test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs @@ -20,7 +20,9 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting // bind everything private const BindingFlags BindToEveryThing = BindingFlags.Default | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public; +#pragma warning disable CS0414 // The field 'PrivateObject.constructorFlags' is assigned but its value is never used private static BindingFlags constructorFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance | BindingFlags.NonPublic; +#pragma warning restore CS0414 // The field 'PrivateObject.constructorFlags' is assigned but its value is never used private object target; // automatically initialized to null private Type originalType; // automatically initialized to null