From 98caf797fcceb5feee26527ea604a11219dc8323 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Sun, 5 Jul 2020 13:26:17 -0700 Subject: [PATCH] Suppress CS0168 (Variable is declared but never used) --- .../Operations/Distributions/distribution.py.cs | 4 ++++ src/TensorFlowNET.Keras/Model.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/TensorFlowNET.Core/Operations/Distributions/distribution.py.cs b/src/TensorFlowNET.Core/Operations/Distributions/distribution.py.cs index 16be7bfb..0ba62f88 100644 --- a/src/TensorFlowNET.Core/Operations/Distributions/distribution.py.cs +++ b/src/TensorFlowNET.Core/Operations/Distributions/distribution.py.cs @@ -64,12 +64,16 @@ namespace Tensorflow { return _log_prob(value); } +#pragma warning disable CS0168 // Variable is declared but never used catch (Exception e1) +#pragma warning restore CS0168 // Variable is declared but never used { try { return math_ops.log(_prob(value)); +#pragma warning disable CS0168 // Variable is declared but never used } catch (Exception e2) +#pragma warning restore CS0168 // Variable is declared but never used { throw new NotImplementedException(); } diff --git a/src/TensorFlowNET.Keras/Model.cs b/src/TensorFlowNET.Keras/Model.cs index 0eb7fbce..738c0488 100644 --- a/src/TensorFlowNET.Keras/Model.cs +++ b/src/TensorFlowNET.Keras/Model.cs @@ -50,7 +50,9 @@ namespace Tensorflow.Keras { return Flow; } +#pragma warning disable CS0168 // Variable is declared but never used catch (Exception ex) +#pragma warning restore CS0168 // Variable is declared but never used { return null; }