Skip to content

Commit

Permalink
[AMP OP&Test] Update unittest of fp16 for slice op (PaddlePaddle#51036)
Browse files Browse the repository at this point in the history
* update unittest of fp16 for slice op

* set atol to default value

* update max_relative_eror
  • Loading branch information
zyfncg committed Mar 17, 2023
1 parent ea22fdb commit 42f2874
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/paddle/fluid/tests/unittests/test_slice_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def config(self):
def test_check_output(self):
place = core.CUDAPlace(0)
if core.is_float16_supported(place):
self.check_output_with_place(place, atol=1e-5, check_prim=True)
self.check_output_with_place(place, check_prim=True)

def test_check_grad_normal(self):
place = core.CUDAPlace(0)
Expand All @@ -498,7 +498,6 @@ def test_check_grad_normal(self):
place,
['Input'],
'Out',
max_relative_error=0.006,
check_prim=True,
)

Expand Down Expand Up @@ -533,7 +532,7 @@ def config(self):
def test_check_output(self):
place = core.CUDAPlace(0)
if core.is_float16_supported(place):
self.check_output_with_place(place, atol=1e-5, check_prim=True)
self.check_output_with_place(place, check_prim=True)

def test_check_grad_normal(self):
place = core.CUDAPlace(0)
Expand All @@ -542,7 +541,6 @@ def test_check_grad_normal(self):
place,
['Input'],
'Out',
max_relative_error=0.006,
numeric_grad_delta=0.5,
check_prim=True,
)
Expand Down

0 comments on commit 42f2874

Please sign in to comment.