You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/01 05:46:10 UTC

[GitHub] [incubator-mxnet] ckt624 commented on a change in pull request #15381: [Numpy] Add Documentations

ckt624 commented on a change in pull request #15381: [Numpy] Add Documentations
URL: https://github.com/apache/incubator-mxnet/pull/15381#discussion_r298887188
 
 

 ##########
 File path: python/mxnet/_numpy_op_doc.py
 ##########
 @@ -58,31 +55,53 @@ def _np_reshape(a, newshape, order='C'):
 
 
 def _np_ones_like(a):
-    """Return an array of ones with the same shape and type as a given array.
+    """
+    ones_like(a)
 
+    Return an array of ones with the same shape and type as a given array.
+    
     Parameters
     ----------
-    a : ndarray
+    a : array_like
         The shape and data-type of `a` define these same attributes of
         the returned array.
-
+    
     Returns
     -------
     out : ndarray
         Array of ones with the same shape and type as `a`.
+    
+    See Also
+    --------
+    zeros_like : Return an array of zeros with shape and type of input.
+    ones : Return a new array setting values to one.
+    
+    Examples
+    --------
+    >>> x = np.arange(6)
+    >>> x = x.reshape((2, 3))
+    >>> x
+    array([[0, 1, 2],
+           [3, 4, 5]])
+    >>> np.ones_like(x)
 
 Review comment:
   Thx. It's float by default.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services