Skip to content

Commit

Permalink
add cpuplace in ut for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyouzhi committed Dec 22, 2023
1 parent fa1d0bd commit c936f55
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/legacy_test/test_activation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -4367,11 +4367,9 @@ def setUp(self):
np.random.seed(1024)
self.x_np = np.random.uniform(-20, 20, [10, 12]).astype(np.float64)
self.x_np[np.abs(self.x_np) < 0.005] = 0.02
self.place = (
paddle.CUDAPlace(0)
if paddle.is_compiled_with_cuda()
else paddle.CPUPlace()
)
self.place = [paddle.CPUPlace()]
if core.is_compiled_with_cuda():
self.place.append(paddle.CUDAPlace(0))

def set_attrs(self):
self.threshold = 15
Expand Down

0 comments on commit c936f55

Please sign in to comment.