|
|
|
@ -334,7 +334,7 @@ class OpTest(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
def check_output(self, atol=1e-5):
|
|
|
|
|
places = [core.CPUPlace()]
|
|
|
|
|
if core.is_compile_gpu() and core.op_support_gpu(self.op_type):
|
|
|
|
|
if core.is_compiled_with_cuda() and core.op_support_gpu(self.op_type):
|
|
|
|
|
places.append(core.CUDAPlace(0))
|
|
|
|
|
for place in places:
|
|
|
|
|
self.check_output_with_place(place, atol)
|
|
|
|
@ -367,7 +367,7 @@ class OpTest(unittest.TestCase):
|
|
|
|
|
max_relative_error=0.005,
|
|
|
|
|
user_defined_grads=None):
|
|
|
|
|
places = [core.CPUPlace()]
|
|
|
|
|
if core.is_compile_gpu() and core.op_support_gpu(self.op_type):
|
|
|
|
|
if core.is_compiled_with_cuda() and core.op_support_gpu(self.op_type):
|
|
|
|
|
places.append(core.CUDAPlace(0))
|
|
|
|
|
for place in places:
|
|
|
|
|
self.check_grad_with_place(place, inputs_to_check, output_names,
|
|
|
|
|