mirror of
https://github.com/wassname/keras-contrib.git
synced 2026-06-27 16:10:11 +08:00
added absolute tolerance to handle comparing zeros
This commit is contained in:
@@ -157,8 +157,9 @@ class TestBackend(object):
|
||||
th_var_val = KTH.eval(th_var)
|
||||
tf_var_val = KTF.eval(tf_var)
|
||||
|
||||
assert_allclose(th_mean_val, tf_mean_val, rtol=1e-4)
|
||||
assert_allclose(th_var_val, tf_var_val, rtol=1e-4)
|
||||
# absolute tolerance needed when working with zeros
|
||||
assert_allclose(th_mean_val, tf_mean_val, rtol=1e-4, atol=1e-10)
|
||||
assert_allclose(th_var_val, tf_var_val, rtol=1e-4, atol=1e-10)
|
||||
|
||||
def test_clip(self):
|
||||
check_single_tensor_operation('clip', (4, 2), min_value=0.4, max_value=0.6)
|
||||
|
||||
Reference in New Issue
Block a user