Browse Source

Suppress CS0414 (The field 'name' is assigned but its value is never used)

tags/v0.20
Sam Harwell Haiping 5 years ago
parent
commit
0da5c3552e
10 changed files with 22 additions and 0 deletions
  1. +2
    -0
      src/TensorFlowNET.Core/Keras/Engine/Model.cs
  2. +4
    -0
      src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs
  3. +2
    -0
      src/TensorFlowNET.Core/Summaries/EventFileWriter.cs
  4. +2
    -0
      src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs
  5. +2
    -0
      src/TensorFlowNET.Core/Training/Saving/Saver.cs
  6. +2
    -0
      src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs
  7. +2
    -0
      src/TensorFlowNET.Core/Variables/VariableScope.cs
  8. +2
    -0
      src/TensorFlowNET.Core/Variables/_VariableStore.cs
  9. +2
    -0
      src/TensorFlowNET.Core/ops._DefaultStack.cs
  10. +2
    -0
      test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs

+ 2
- 0
src/TensorFlowNET.Core/Keras/Engine/Model.cs View File

@@ -8,7 +8,9 @@ namespace Tensorflow.Keras.Engine
bool _cloning; bool _cloning;
#pragma warning restore CS0169 // The field 'Model._cloning' is never used #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 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; 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 #pragma warning restore CS0108 // Member hides inherited member; missing new keyword
string loss; string loss;
IOptimizer optimizer; IOptimizer optimizer;


+ 4
- 0
src/TensorFlowNET.Core/Keras/Layers/BatchNormalization.cs View File

@@ -23,14 +23,18 @@ namespace Tensorflow.Keras.Layers
{ {
public class BatchNormalization : Tensorflow.Layers.Layer 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; 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 momentum;
private float epsilon; private float epsilon;
private bool center; private bool center;
private bool scale; private bool scale;
private bool renorm; private bool renorm;
private bool fused; 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; 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 int[] axis;
private string _data_format; private string _data_format;
private IInitializer beta_initializer; private IInitializer beta_initializer;


+ 2
- 0
src/TensorFlowNET.Core/Summaries/EventFileWriter.cs View File

@@ -31,7 +31,9 @@ namespace Tensorflow.Summaries
EventsWriter _ev_writer; EventsWriter _ev_writer;
int _flush_secs; int _flush_secs;
Event _sentinel_event; Event _sentinel_event;
#pragma warning disable CS0414 // The field 'EventFileWriter._closed' is assigned but its value is never used
bool _closed; bool _closed;
#pragma warning restore CS0414 // The field 'EventFileWriter._closed' is assigned but its value is never used
EventLoggerThread _worker; EventLoggerThread _worker;


public EventFileWriter(string logdir, int max_queue = 10, int flush_secs= 120, public EventFileWriter(string logdir, int max_queue = 10, int flush_secs= 120,


+ 2
- 0
src/TensorFlowNET.Core/Summaries/EventLoggerThread.cs View File

@@ -27,7 +27,9 @@ namespace Tensorflow.Summaries
public class EventLoggerThread public class EventLoggerThread
{ {
Queue<Event> _queue; Queue<Event> _queue;
#pragma warning disable CS0414 // The field 'EventLoggerThread.daemon' is assigned but its value is never used
bool daemon; bool daemon;
#pragma warning restore CS0414 // The field 'EventLoggerThread.daemon' is assigned but its value is never used
EventsWriter _ev_writer; EventsWriter _ev_writer;
int _flush_secs; int _flush_secs;
Event _sentinel_event; Event _sentinel_event;


+ 2
- 0
src/TensorFlowNET.Core/Training/Saving/Saver.cs View File

@@ -46,7 +46,9 @@ namespace Tensorflow
private bool _is_empty; private bool _is_empty;
private float _next_checkpoint_time; private float _next_checkpoint_time;
private bool _save_relative_paths; 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; 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<string, float> _last_checkpoints; private Dictionary<string, float> _last_checkpoints;
private Dictionary<string, float> _checkpoints_to_be_deleted; private Dictionary<string, float> _checkpoints_to_be_deleted;




+ 2
- 0
src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs View File

@@ -11,7 +11,9 @@ namespace Tensorflow.Training
int _every_secs = 60; int _every_secs = 60;
int _every_steps = 0; int _every_steps = 0;
int _last_triggered_step = 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; 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) public SecondOrStepTimer(int every_secs, int every_steps)
{ {


+ 2
- 0
src/TensorFlowNET.Core/Variables/VariableScope.cs View File

@@ -25,7 +25,9 @@ namespace Tensorflow
public class VariableScope public class VariableScope
{ {
public bool use_resource { get; set; } 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; private _ReuseMode _reuse;
#pragma warning restore CS0414 // The field 'VariableScope._reuse' is assigned but its value is never used
public bool resue; public bool resue;


private TF_DataType _dtype; private TF_DataType _dtype;


+ 2
- 0
src/TensorFlowNET.Core/Variables/_VariableStore.cs View File

@@ -27,7 +27,9 @@ namespace Tensorflow
{ {
private Dictionary<string, object> _vars; private Dictionary<string, object> _vars;
private Dictionary<string, object> _partitioned_vars; private Dictionary<string, object> _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; 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() public _VariableStore()
{ {


+ 2
- 0
src/TensorFlowNET.Core/ops._DefaultStack.cs View File

@@ -26,7 +26,9 @@ namespace Tensorflow
public class _DefaultStack : ITensorFlowObject public class _DefaultStack : ITensorFlowObject
{ {
Stack<object> stack; Stack<object> stack;
#pragma warning disable CS0414 // The field 'ops._DefaultStack._enforce_nesting' is assigned but its value is never used
bool _enforce_nesting = true; bool _enforce_nesting = true;
#pragma warning restore CS0414 // The field 'ops._DefaultStack._enforce_nesting' is assigned but its value is never used


public _DefaultStack() public _DefaultStack()
{ {


+ 2
- 0
test/TensorFlowNET.UnitTest/Utilities/PrivateObject.cs View File

@@ -20,7 +20,9 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
// bind everything // bind everything
private const BindingFlags BindToEveryThing = BindingFlags.Default | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public; 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; 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 object target; // automatically initialized to null
private Type originalType; // automatically initialized to null private Type originalType; // automatically initialized to null


Loading…
Cancel
Save