diff --git a/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs b/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs index 0385e588..230dcf97 100644 --- a/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs +++ b/src/TensorFlowNET.Core/Eager/EagerRunner.TFE_FastPathExecute.cs @@ -269,16 +269,22 @@ namespace Tensorflow.Eager if(attr_value == null) { if (is_list != 0) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement //SetOpAttrListDefault else +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement //SetOpAttrScalarDefault } else { if (is_list != 0) +#pragma warning disable CS0642 // Possible mistaken empty statement ;// SetOpAttrList +#pragma warning restore CS0642 // Possible mistaken empty statement else SetOpAttrScalar(ctx, op, attr_name, attr_value, type, attr_list_sizes, status); } diff --git a/src/TensorFlowNET.Core/Operations/OpDefLibrary.cs b/src/TensorFlowNET.Core/Operations/OpDefLibrary.cs index 5700ccdd..e3ee5ef8 100644 --- a/src/TensorFlowNET.Core/Operations/OpDefLibrary.cs +++ b/src/TensorFlowNET.Core/Operations/OpDefLibrary.cs @@ -350,7 +350,9 @@ namespace Tensorflow if (attr_def.Type.StartsWith("list(")) { if (attr_def.HasMinimum) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement attr_value.List = new AttrValue.Types.ListValue(); } diff --git a/src/TensorFlowNET.Core/Tensors/tensor_util.cs b/src/TensorFlowNET.Core/Tensors/tensor_util.cs index 38b559f9..430d358b 100644 --- a/src/TensorFlowNET.Core/Tensors/tensor_util.cs +++ b/src/TensorFlowNET.Core/Tensors/tensor_util.cs @@ -71,9 +71,13 @@ namespace Tensorflow return np.frombuffer(tensor.TensorContent.ToByteArray(), tensor_dtype).reshape(shape); } else if (tensor.Dtype == DataType.DtHalf || tensor.Dtype == DataType.DtBfloat16) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement else if (tensor.Dtype == DataType.DtFloat) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement else if (new DataType[] { DataType.DtInt32, DataType.DtUint8 }.Contains(tensor.Dtype)) { if (tensor.IntVal.Count == 1) diff --git a/src/TensorFlowNET.Core/Training/Saving/Saver.cs b/src/TensorFlowNET.Core/Training/Saving/Saver.cs index f6a808b9..18aaf480 100644 --- a/src/TensorFlowNET.Core/Training/Saving/Saver.cs +++ b/src/TensorFlowNET.Core/Training/Saving/Saver.cs @@ -241,7 +241,9 @@ namespace Tensorflow Console.WriteLine($"Restoring parameters from {save_path}"); if (tf.context.executing_eagerly()) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement else sess.run(_saver_def.RestoreOpName, new FeedItem(_saver_def.FilenameTensorName, save_path)); diff --git a/src/TensorFlowNET.Core/Training/Trackable.cs b/src/TensorFlowNET.Core/Training/Trackable.cs index 49eb4ada..518c530b 100644 --- a/src/TensorFlowNET.Core/Training/Trackable.cs +++ b/src/TensorFlowNET.Core/Training/Trackable.cs @@ -43,7 +43,9 @@ namespace Tensorflow.Train IInitializer checkpoint_initializer = null; #pragma warning restore CS0219 // Variable is assigned but its value is never used if (tf.context.executing_eagerly()) +#pragma warning disable CS0642 // Possible mistaken empty statement ; +#pragma warning restore CS0642 // Possible mistaken empty statement else checkpoint_initializer = null; diff --git a/src/TensorFlowNET.Core/Variables/RefVariable.cs b/src/TensorFlowNET.Core/Variables/RefVariable.cs index dddd3748..35d617fd 100644 --- a/src/TensorFlowNET.Core/Variables/RefVariable.cs +++ b/src/TensorFlowNET.Core/Variables/RefVariable.cs @@ -116,7 +116,9 @@ namespace Tensorflow if (variable_def.SaveSliceInfoDef != null) throw new NotImplementedException("save_slice_info_def"); else +#pragma warning disable CS0642 // Possible mistaken empty statement ;// _save_slice_info = null; +#pragma warning restore CS0642 // Possible mistaken empty statement //_caching_device = null; //_constraint = null;