Browse Source

Suppress CS0162 (Unreachable code detected)

tags/v0.20
Sam Harwell Haiping 5 years ago
parent
commit
fe625866ad
3 changed files with 6 additions and 0 deletions
  1. +2
    -0
      src/TensorFlowNET.Core/Gradients/math_grad.cs
  2. +2
    -0
      src/TensorFlowNET.Core/Keras/Sequence.cs
  3. +2
    -0
      src/TensorFlowNET.Core/Sessions/BaseSession.cs

+ 2
- 0
src/TensorFlowNET.Core/Gradients/math_grad.cs View File

@@ -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));


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

@@ -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])
{


+ 2
- 0
src/TensorFlowNET.Core/Sessions/BaseSession.cs View File

@@ -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;
}


Loading…
Cancel
Save