[debug] Debug Heisenbug, the old school way.
This commit is contained in:
@@ -115,6 +115,13 @@ class TFModelTesterMixin:
|
|||||||
tf_hidden_states[np.isnan(tf_hidden_states)] = 0
|
tf_hidden_states[np.isnan(tf_hidden_states)] = 0
|
||||||
pt_hidden_states[np.isnan(pt_hidden_states)] = 0
|
pt_hidden_states[np.isnan(pt_hidden_states)] = 0
|
||||||
max_diff = np.amax(np.abs(tf_hidden_states - pt_hidden_states))
|
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)
|
self.assertLessEqual(max_diff, 2e-2)
|
||||||
|
|
||||||
# Check we can load pt model in tf and vice-versa with checkpoint => model functions
|
# Check we can load pt model in tf and vice-versa with checkpoint => model functions
|
||||||
|
|||||||
Reference in New Issue
Block a user