Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[DOC] Fix numpy op doc #16504

Merged
merged 5 commits into from
Oct 18, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions python/mxnet/_numpy_op_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,3 +748,72 @@ def _np_moveaxis(a, source, destination):
(5, 4, 3)
"""
pass

def _np__random_shuffle(x):
"""
Modify a sequence in-place by shuffling its contents.

This function only shuffles the array along the first axis of a
multi-dimensional array. The order of sub-arrays is changed but
their contents remains the same.
juxtaly marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
x: ndarray
The array or list to be shuffled.

Returns
-------
None

Examples
--------
>>> arr = np.arange(10)
>>> np.random.shuffle(arr)
>>> arr
array([5., 1., 0., 6., 7., 3., 9., 8., 4., 2.]) # random

Multi-dimensional arrays are only shuffled along the first axis:

>>> arr = np.arange(9).reshape((3, 3))
>>> np.random.shuffle(arr)
>>> arr
array([[6., 7., 8.], # random
[3., 4., 5.],
[0., 1., 2.]])
"""
pass

def _np_broadcast_to(array, shape, out=None):
"""
Broadcast an array to a new shape.

Parameters
----------
array : ndarray
The array to broadcast.
shape : tuple, optional, default=[]
The shape of the desired array.
out : ndarray, optional
The output ndarray to hold the result.

Returns
-------
out : ndarray or list of ndarrays

Raises
------
MXNetError
- If the array is not compatible with the new shape according to NumPy's
broadcasting rules.
- If the shape of the output array is not consistent with the desired shape.

Examples
--------
>>> x = np.array([1, 2, 3])
>>> np.broadcast_to(x, (3, 3))
array([[1., 2., 3.],
[1., 2., 3.],
[1., 2., 3.]])
"""
pass