Skip to content

Commit

Permalink
Merge pull request #4872 from toslunar/mark-multi-gpu
Browse files Browse the repository at this point in the history
Mark multi_gpu tests as gpu tests
  • Loading branch information
okuta committed Jun 10, 2018
2 parents 299b62f + 9fc8bde commit f5aa455
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions chainer/testing/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ def multi_gpu(gpu_num):
"""

check_available()
return unittest.skipIf(
0 <= _gpu_limit < gpu_num,
reason='{} GPUs required'.format(gpu_num))

def deco(f):
return unittest.skipIf(
0 <= _gpu_limit < gpu_num,
reason='{} GPUs required'.format(gpu_num)
)(pytest.mark.gpu(f))

return deco


def gpu(f):
Expand All @@ -65,5 +70,4 @@ def gpu(f):
declare that one GPU is required to run.
"""

check_available()
return multi_gpu(1)(pytest.mark.gpu(f))
return multi_gpu(1)(f)

0 comments on commit f5aa455

Please sign in to comment.