[GitHub] [incubator-mxnet] ckt624 commented on a change in pull request #15390: [Numpy fix-doc]modify numpy doc

2019-07-01 Thread GitBox
ckt624 commented on a change in pull request #15390: [Numpy  fix-doc]modify 
numpy doc
URL: https://github.com/apache/incubator-mxnet/pull/15390#discussion_r299305422
 
 

 ##
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##
 @@ -1549,10 +1613,161 @@ def sqrt(x, out=None, **kwargs):
 square-root of each element in `x`. This is a scalar if `x` is a 
scalar.
 
 Notes
-
+-
 This function only supports input type of float.
 """
 return _unary_func_helper(x, _npi.sqrt, _np.sqrt, out=out, **kwargs)
 
 
+@set_module('mxnet.symbol.numpy')
+def ceil(x, out=None, **kwargs):
+r"""
+Return the ceiling of the input, element-wise.
+
+The ceil of the ndarray `x` is the smallest integer `i`, such that
+`i >= x`.  It is often denoted as :math:`\lceil x \rceil`.
+
+Parameters
+--
+x : _Symbol or scalar
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
+must have a shape that the inputs fill into. If not provided
+or None, a freshly-allocated array is returned. The dtype of the
+output and input must be the same.
+
+Returns
+---
+y :
+_Symbol or scalar
+The ceiling of each element in `x`, with `float` dtype.
+This is a scalar if `x` is a scalar.
+
+Examples
+
+>>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
+>>> np.ceil(a)
+array([-1., -1., -0.,  1.,  2.,  2.,  2.])
+
+>>> #if you use parameter out, x and out must be ndarray. if not, you will 
get an error!
+>>> a = np.array(1)
+>>> np.ceil(np.array(3.5), a)
+array(4.)
+>>> a
+array(4.)
+
+"""
+return _unary_func_helper(x, _npi.ceil, _np.ceil, out=out, **kwargs)
+
+
+@set_module('mxnet.symbol.numpy')
+def log1p(x, out=None, **kwargs):
+"""
+Return the natural logarithm of one plus the input array, element-wise.
+
+Calculates ``log(1 + x)``.
+
+Parameters
+--
+x : _Symbol or scalar
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
+must have a shape that the inputs fill into. If not provided
 
 Review comment:
   Based on templates:
   out : _Symbol or None
   Dummy parameter to keep the consistency with the ndarray counterpart.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] ckt624 commented on a change in pull request #15390: [Numpy fix-doc]modify numpy doc

2019-07-01 Thread GitBox
ckt624 commented on a change in pull request #15390: [Numpy  fix-doc]modify 
numpy doc
URL: https://github.com/apache/incubator-mxnet/pull/15390#discussion_r299305445
 
 

 ##
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##
 @@ -1549,10 +1613,161 @@ def sqrt(x, out=None, **kwargs):
 square-root of each element in `x`. This is a scalar if `x` is a 
scalar.
 
 Notes
-
+-
 This function only supports input type of float.
 """
 return _unary_func_helper(x, _npi.sqrt, _np.sqrt, out=out, **kwargs)
 
 
+@set_module('mxnet.symbol.numpy')
+def ceil(x, out=None, **kwargs):
+r"""
+Return the ceiling of the input, element-wise.
+
+The ceil of the ndarray `x` is the smallest integer `i`, such that
+`i >= x`.  It is often denoted as :math:`\lceil x \rceil`.
+
+Parameters
+--
+x : _Symbol or scalar
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
+must have a shape that the inputs fill into. If not provided
+or None, a freshly-allocated array is returned. The dtype of the
+output and input must be the same.
+
+Returns
+---
+y :
+_Symbol or scalar
+The ceiling of each element in `x`, with `float` dtype.
+This is a scalar if `x` is a scalar.
+
+Examples
+
+>>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
+>>> np.ceil(a)
+array([-1., -1., -0.,  1.,  2.,  2.,  2.])
+
+>>> #if you use parameter out, x and out must be ndarray. if not, you will 
get an error!
+>>> a = np.array(1)
+>>> np.ceil(np.array(3.5), a)
+array(4.)
+>>> a
+array(4.)
+
+"""
+return _unary_func_helper(x, _npi.ceil, _np.ceil, out=out, **kwargs)
+
+
+@set_module('mxnet.symbol.numpy')
+def log1p(x, out=None, **kwargs):
+"""
+Return the natural logarithm of one plus the input array, element-wise.
+
+Calculates ``log(1 + x)``.
+
+Parameters
+--
+x : _Symbol or scalar
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
+must have a shape that the inputs fill into. If not provided
+or None, a freshly-allocated array is returned. The dtype of the
+output and input must be the same.
+
+Returns
+---
+y : _Symbol or scalar
+Natural logarithm of 1 + x, element-wise. This is a scalar
+if x is a scalar.
+
+Notes
+-
+
+For real-valued input, `log1p` is accurate also for `x` so small
+that `1 + x == 1` in floating-point accuracy.
+
+Logarithm is a multivalued function: for each `x` there is an infinite
+number of `z` such that `exp(z) = 1 + x`. The convention is to return
+the `z` whose imaginary part lies in `[-pi, pi]`.
+
+For real-valued input data types, `log1p` always returns real output.
+For each value that cannot be expressed as a real number or infinity,
+it yields ``nan`` and sets the `invalid` floating point error flag.
+
+cannot support complex-valued input.
+
+Examples
+
+>>> np.log1p(1e-99)
+1e-99
+>>> a = np.array([3, 4, 5])
+>>> np.log1p(a)
+array([1.3862944, 1.609438 , 1.7917595])
+
+"""
+return _unary_func_helper(x, _npi.log1p, _np.log1p, out=out, **kwargs)
+
+
+@set_module('mxnet.symbol.numpy')
+def tanh(x, out=None, **kwargs):
+"""
+Compute hyperbolic tangent element-wise.
+
+Equivalent to ``np.sinh(x)/np.cosh(x)``.
+
+Parameters
+--
+x : _Symbol
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
+must have a shape that the inputs fill into. If not provided
+or None, a freshly-allocated array is returned. The dtype of the
+output and input must be the same.
 
 Review comment:
   Based on templates:
   out : _Symbol or None
   Dummy parameter to keep the consistency with the ndarray counterpart.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] ckt624 commented on a change in pull request #15390: [Numpy fix-doc]modify numpy doc

2019-07-01 Thread GitBox
ckt624 commented on a change in pull request #15390: [Numpy  fix-doc]modify 
numpy doc
URL: https://github.com/apache/incubator-mxnet/pull/15390#discussion_r299305345
 
 

 ##
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##
 @@ -1549,10 +1613,161 @@ def sqrt(x, out=None, **kwargs):
 square-root of each element in `x`. This is a scalar if `x` is a 
scalar.
 
 Notes
-
+-
 This function only supports input type of float.
 """
 return _unary_func_helper(x, _npi.sqrt, _np.sqrt, out=out, **kwargs)
 
 
+@set_module('mxnet.symbol.numpy')
+def ceil(x, out=None, **kwargs):
+r"""
+Return the ceiling of the input, element-wise.
+
+The ceil of the ndarray `x` is the smallest integer `i`, such that
+`i >= x`.  It is often denoted as :math:`\lceil x \rceil`.
+
+Parameters
+--
+x : _Symbol or scalar
+Input array.
+out : _Symbol or None
+A location into which the result is stored. If provided, it
 
 Review comment:
   Based on templates:
   out : _Symbol or None
   Dummy parameter to keep the consistency with the ndarray counterpart.


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:
us...@infra.apache.org


With regards,
Apache Git Services