From a4bde78481c83e54d51f37b22e183478851f915d Mon Sep 17 00:00:00 2001 From: gabrieldemarmiesse Date: Thu, 5 Mar 2020 15:22:06 +0100 Subject: [PATCH 1/2] Enbale passing tests in quantiles_test.py --- tensorflow_addons/losses/quantiles_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tensorflow_addons/losses/quantiles_test.py b/tensorflow_addons/losses/quantiles_test.py index 667e11ed27..b33dead23b 100644 --- a/tensorflow_addons/losses/quantiles_test.py +++ b/tensorflow_addons/losses/quantiles_test.py @@ -13,6 +13,7 @@ # limitations under the License. # ============================================================================== """Tests for pinball loss.""" +import unittest import tensorflow as tf @@ -85,6 +86,7 @@ def test_sample_weighted(self): loss = pin_obj(y_true, y_pred, sample_weight=sample_weight) self.assertAlmostEqual(self.evaluate(loss), 40.7 / 6, 3) + @unittest.skip("Failing. See https://github.com/tensorflow/addons/issues/1202") def test_timestep_weighted(self): pin_obj = quantiles.PinballLoss() y_true = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3, 1)) @@ -102,6 +104,7 @@ def test_zero_weighted(self): loss = pin_obj(y_true, y_pred, sample_weight=0) self.assertAlmostEqual(self.evaluate(loss), 0.0, 3) + @unittest.skip("Failing test. See https://github.com/tensorflow/addons/issues/1202") def test_invalid_sample_weight(self): pin_obj = quantiles.PinballLoss() y_true = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3, 1)) @@ -126,3 +129,7 @@ def test_sum_reduction(self): y_pred = tf.constant([4, 8, 12, 8, 1, 3], shape=(2, 3), dtype=tf.dtypes.float32) loss = pin_obj(y_true, y_pred, sample_weight=2.3) self.assertAlmostEqual(self.evaluate(loss), 12.65, 3) + + +if __name__ == "__main__": + tf.test.main() From 0144dfd7887b0ee5a4e4db3608cda09f6e6dd2f2 Mon Sep 17 00:00:00 2001 From: gabrieldemarmiesse Date: Sat, 7 Mar 2020 12:46:59 +0000 Subject: [PATCH 2/2] Used self.skipTest. --- tensorflow_addons/losses/quantiles_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tensorflow_addons/losses/quantiles_test.py b/tensorflow_addons/losses/quantiles_test.py index b33dead23b..058da58268 100644 --- a/tensorflow_addons/losses/quantiles_test.py +++ b/tensorflow_addons/losses/quantiles_test.py @@ -13,7 +13,6 @@ # limitations under the License. # ============================================================================== """Tests for pinball loss.""" -import unittest import tensorflow as tf @@ -86,8 +85,8 @@ def test_sample_weighted(self): loss = pin_obj(y_true, y_pred, sample_weight=sample_weight) self.assertAlmostEqual(self.evaluate(loss), 40.7 / 6, 3) - @unittest.skip("Failing. See https://github.com/tensorflow/addons/issues/1202") def test_timestep_weighted(self): + self.skipTest("Failing. See https://github.com/tensorflow/addons/issues/1202") pin_obj = quantiles.PinballLoss() y_true = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3, 1)) y_pred = tf.constant( @@ -104,8 +103,8 @@ def test_zero_weighted(self): loss = pin_obj(y_true, y_pred, sample_weight=0) self.assertAlmostEqual(self.evaluate(loss), 0.0, 3) - @unittest.skip("Failing test. See https://github.com/tensorflow/addons/issues/1202") def test_invalid_sample_weight(self): + self.skipTest("Failing. See https://github.com/tensorflow/addons/issues/1202") pin_obj = quantiles.PinballLoss() y_true = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3, 1)) y_pred = tf.constant([4, 8, 12, 8, 1, 3], shape=(2, 3, 1))