From 594ca6deadb6bb79451c3093641e3c9e5dcfa446 Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Sat, 28 Dec 2019 00:00:45 -0500 Subject: [PATCH] [debug] Debug Heisenbug, the old school way. --- tests/test_modeling_tf_common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_modeling_tf_common.py b/tests/test_modeling_tf_common.py index e6fb1439c1..de879aa15b 100644 --- a/tests/test_modeling_tf_common.py +++ b/tests/test_modeling_tf_common.py @@ -115,6 +115,13 @@ class TFModelTesterMixin: tf_hidden_states[np.isnan(tf_hidden_states)] = 0 pt_hidden_states[np.isnan(pt_hidden_states)] = 0 max_diff = np.amax(np.abs(tf_hidden_states - pt_hidden_states)) + # Debug info (remove when fixed) + if max_diff >= 2e-2: + print("===") + print(model_class) + print(config) + print(inputs_dict) + print(pt_inputs_dict) self.assertLessEqual(max_diff, 2e-2) # Check we can load pt model in tf and vice-versa with checkpoint => model functions