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:32:13 UTC

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15377: [numpy][doc-fix] zeros_like, linspace, reciprocal, square, and arcsin

haojin2 commented on a change in pull request #15377: [numpy][doc-fix] zeros_like, linspace, reciprocal, square, and arcsin
URL: https://github.com/apache/incubator-mxnet/pull/15377#discussion_r298885287
 
 

 ##########
 File path: python/mxnet/_numpy_op_doc.py
 ##########
 @@ -87,6 +90,41 @@ def _np_zeros_like(a):
     -------
     out : ndarray
         Array of zeros with the same shape and type as `a`.
+
+
+    See Also
+    --------
+    empty_like : Return an empty array with shape and type of input.
+    ones_like : Return an array of ones with shape and type of input.
+    full_like : Return a new array with shape of input filled with value.
+    zeros : Return a new array setting values to zero.
+
+    Examples
+    --------
+    >>> x = np.arange(6)
+    >>> x = x.reshape((2, 3))
+    >>> x
+    array([[0., 1., 2.],
+           [3., 4., 5.]])
+    >>> np.zeros_like(x)
+    array([[0., 0., 0.],
+           [0., 0., 0.]])
+    >>> y = np.arange(3)
+    >>> y
+    array([0., 1., 2.])
+    >>> np.zeros_like(y)
+    array([0., 0., 0.])
+
+    Notes
+    -----
+    The output `ndarray` has the same `ctx` as the input `ndarray`.
+
+    This function differs from the original `numpy.zeros_like
+    <https://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros_like.html>`_ in
+    the following aspects:
+
+    - The parameter `dtype` and `subok` are not supported now.
+    - Only row-major is supported.
 
 Review comment:
   "Only 'C' order is supported."

----------------------------------------------------------------
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