[debug] Debug Heisenbug, the old school way.

This commit is contained in:
Julien Chaumond 2019-12-28 00:00:45 -05:00
parent 0df4e62da0
commit 594ca6dead

View File

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