Skip to content

Commit

Permalink
Merge b35d75c into 76a164b
Browse files Browse the repository at this point in the history
  • Loading branch information
niboshi committed Apr 15, 2019
2 parents 76a164b + b35d75c commit cc3bfea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chainer/testing/unary_math_function_test.py
Expand Up @@ -210,15 +210,19 @@ def setUp(self):
else:
self.x, self.gy = make_data(self.shape, self.dtype)

self.forward_options = {'atol': 1e-4, 'rtol': 1e-4}
if self.dtype == numpy.float16:
self.forward_options = {
'atol': numpy.finfo('float16').eps, # = 0.000977
'rtol': numpy.finfo('float16').eps, # = 0.000977
}
self.backward_options = {
'eps': 2 ** -4, 'atol': 2 ** -4, 'rtol': 2 ** -4,
'dtype': numpy.float64}
self.double_backward_options = {
'eps': 2 ** -4, 'atol': 2 ** -4, 'rtol': 2 ** -4,
'dtype': numpy.float64}
else:
self.forward_options = {'atol': 1e-4, 'rtol': 1e-4}
self.backward_options = {
'dtype': numpy.float64, 'atol': 1e-4, 'rtol': 1e-4}
self.double_backward_options = {
Expand Down

0 comments on commit cc3bfea

Please sign in to comment.