diff --git a/src/TensorFlowNET.Core/Gradients/math_grad.cs b/src/TensorFlowNET.Core/Gradients/math_grad.cs index af584658..12205dba 100644 --- a/src/TensorFlowNET.Core/Gradients/math_grad.cs +++ b/src/TensorFlowNET.Core/Gradients/math_grad.cs @@ -341,7 +341,9 @@ namespace Tensorflow.Gradients var output_shape_tensor = array_ops.shape(op.outputs[0]); var factor = _safe_shape_div(math_ops.reduce_prod(input_shape_tensor), math_ops.reduce_prod(output_shape_tensor)); throw new NotImplementedException(""); +#pragma warning disable CS0162 // Unreachable code detected factor_tensor = null; +#pragma warning restore CS0162 // Unreachable code detected } result = math_ops.truediv(sum_grad, math_ops.cast(factor_tensor, sum_grad.dtype)); diff --git a/src/TensorFlowNET.Core/Keras/Sequence.cs b/src/TensorFlowNET.Core/Keras/Sequence.cs index c6f88188..077c4595 100644 --- a/src/TensorFlowNET.Core/Keras/Sequence.cs +++ b/src/TensorFlowNET.Core/Keras/Sequence.cs @@ -50,7 +50,9 @@ namespace Tensorflow.Keras value = 0f; var nd = new NDArray(np.int32, new Shape(sequences.size, maxlen.Value)); +#pragma warning disable CS0162 // Unreachable code detected for (int i = 0; i < nd.shape[0]; i++) +#pragma warning restore CS0162 // Unreachable code detected { switch(sequences[i]) { diff --git a/src/TensorFlowNET.Core/Sessions/BaseSession.cs b/src/TensorFlowNET.Core/Sessions/BaseSession.cs index 76d434b4..d09f1b0c 100644 --- a/src/TensorFlowNET.Core/Sessions/BaseSession.cs +++ b/src/TensorFlowNET.Core/Sessions/BaseSession.cs @@ -422,7 +422,9 @@ namespace Tensorflow { throw new NotImplementedException(); //TODO:! This is not the way to handle string[], it should be done with TF_DecodeString +#pragma warning disable CS0162 // Unreachable code detected using (var reader = new CodedInputStream(new IntPtr(srcAddress).Stream(8, (long) tensor.bytesize))) +#pragma warning restore CS0162 // Unreachable code detected ret = NDArray.FromString(reader.ReadString()); break; }