Skip to content

Commit

Permalink
Document chainerx.to_numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
niboshi committed Aug 20, 2019
1 parent 930cab4 commit 29f914c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chainerx/_docs/__init__.py
Expand Up @@ -7,6 +7,7 @@
from chainerx._docs import context
from chainerx._docs import device
from chainerx._docs import routines
from chainerx._docs import utils


def set_doc(obj, docstring):
Expand All @@ -20,5 +21,5 @@ def set_doc(obj, docstring):


def set_docs():
for m in (array, backend, backprop, context, device, routines):
for m in (array, backend, backprop, context, device, routines, utils):
m.set_docs()
18 changes: 18 additions & 0 deletions chainerx/_docs/utils.py
@@ -0,0 +1,18 @@
import chainerx
from chainerx import _docs


def set_docs():
_docs.set_doc(
chainerx.to_numpy,
"""to_numpy(array, copy=True)
Converts a ChainerX array to NumPy
Args:
array (~chainerx.ndarray): ChainerX array.
copy (bool): If ``True``, a copy is always made. Otherwise, the resulting
array may be aliased with the input array.
Returns:
numpy.ndarray: NumPy array.
""")
10 changes: 10 additions & 0 deletions docs/source/chainerx/reference/ndarray.rst
Expand Up @@ -8,3 +8,13 @@ Multi-Dimensional Array (ndarray)
:nosignatures:

chainerx.ndarray


Utility functions
-----------------

.. autosummary::
:toctree: generated/
:nosignatures:

chainerx.to_numpy

0 comments on commit 29f914c

Please sign in to comment.