diff --git a/python/mxnet/_numpy_op_doc.py b/python/mxnet/_numpy_op_doc.py index 667c3bddb71f..f08d19a66549 100644 --- a/python/mxnet/_numpy_op_doc.py +++ b/python/mxnet/_numpy_op_doc.py @@ -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 remain the same. + + 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