Skip to content

Commit

Permalink
Merge pull request #4217 from kmaehashi/fix-multi-gpu-doctest
Browse files Browse the repository at this point in the history
raise friendly error for multi-gpu doctest failures
  • Loading branch information
niboshi committed Jan 24, 2018
2 parents 0080f6a + 16cacf9 commit bc36bf2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/tutorial/gpu.rst
Expand Up @@ -17,6 +17,14 @@ After reading this section, you will be able to:
* Write model-parallel computing in Chainer
* Write data-parallel computing in Chainer

.. testcode::
:hide:

try:
with cupy.cuda.Device(1):
pass
except cupy.cuda.runtime.CUDARuntimeError:
raise RuntimeError('doctest in this document requires 2 GPUs') from None

Relationship between Chainer and CuPy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit bc36bf2

Please sign in to comment.