3535 'linspace' , 'expand_dims' , 'tile' , 'arange' , 'split' , 'concatenate' , 'stack' , 'vstack' , 'mean' ,
3636 'maximum' , 'minimum' , 'swapaxes' , 'clip' , 'argmax' , 'std' , 'var' , 'indices' , 'copysign' ,
3737 'ravel' , 'hanning' , 'hamming' , 'blackman' , 'flip' , 'around' , 'hypot' , 'rad2deg' , 'deg2rad' ,
38- 'unique' , 'lcm' , 'tril' , 'identity' , 'take' , 'ldexp' , 'vdot' , 'inner' , 'outer' ,
38+ 'unique' , 'lcm' , 'tril' , 'identity' , 'take' , 'ldexp' ,
3939 'equal' , 'not_equal' , 'greater' , 'less' , 'greater_equal' , 'less_equal' ]
4040
4141
@@ -1904,7 +1904,7 @@ def tan(x, out=None, where=True, **kwargs):
19041904
19051905 Parameters:
19061906 ----------
1907- x : ndarray
1907+ x : array_like
19081908 Input array.
19091909 out : ndarray, None, or tuple of ndarray and None, optional
19101910 A location into which the result is stored. If provided,
@@ -2324,7 +2324,7 @@ def concatenate(seq, axis=0, out=None):
23242324 """Join a sequence of arrays along an existing axis.
23252325 Parameters
23262326 ----------
2327- a1, a2, ... : sequence of ndarray
2327+ a1, a2, ... : sequence of array_like
23282328 The arrays must have the same shape, except in the dimension
23292329 corresponding to `axis` (the first, by default).
23302330 axis : int, optional
@@ -2349,7 +2349,7 @@ def stack(arrays, axis=0, out=None):
23492349 For example, if `axis=0` it will be the first dimension and if `axis=-1` it will be the last dimension.
23502350 Parameters
23512351 ----------
2352- arrays : sequence of ndarray
2352+ arrays : sequence of array_like
23532353 Each array must have the same shape.
23542354 axis : int, optional
23552355 The axis in the result array along which the input arrays are stacked.
@@ -2511,7 +2511,7 @@ def clip(a, a_min, a_max, out=None):
25112511
25122512 Notes
25132513 -----
2514- ndarray `a_min` and `a_max` are not supported.
2514+ array_like `a_min` and `a_max` are not supported.
25152515
25162516 Examples
25172517 --------
@@ -2670,7 +2670,7 @@ def std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): # pylint:
26702670
26712671 Parameters
26722672 ----------
2673- a : ndarray
2673+ a : array_like
26742674 Calculate the standard deviation of these values.
26752675 axis : None or int or tuple of ints, optional
26762676 Axis or axes along which the standard deviation is computed. The
@@ -2737,7 +2737,7 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): # pylint:
27372737
27382738 Parameters
27392739 ----------
2740- a : ndarray
2740+ a : array_like
27412741 Array containing numbers whose variance is desired. If `a` is not an
27422742 array, a conversion is attempted.
27432743 axis : None or int or tuple of ints, optional
@@ -3431,7 +3431,7 @@ def hypot(x1, x2, out=None):
34313431
34323432 Parameters
34333433 ----------
3434- x1, x2 : ndarray
3434+ x1, x2 : array_like
34353435 Leg of the triangle(s).
34363436 out : ndarray, None, or tuple of ndarray and None, optional
34373437 A location into which the result is stored. If provided, it must have
@@ -3505,153 +3505,6 @@ def ldexp(x1, x2, out=None):
35053505 return _ufunc_helper (x1 , x2 , _npi .ldexp , _np .ldexp , _npi .ldexp_scalar , _npi .rldexp_scalar , out )
35063506
35073507
3508- @set_module ('mxnet.ndarray.numpy' )
3509- def inner (a , b ):
3510- r"""
3511- Inner product of two arrays.
3512- Ordinary inner product of vectors for 1-D arrays (without complex
3513- conjugation), in higher dimensions a sum product over the last axes.
3514-
3515- Parameters
3516- ----------
3517- a, b : ndarray
3518- If `a` and `b` are nonscalar, their last dimensions must match.
3519-
3520- Returns
3521- -------
3522- out : ndarray
3523- `out.shape = a.shape[:-1] + b.shape[:-1]`
3524-
3525- Raises
3526- ------
3527- ValueError
3528- If the last dimension of `a` and `b` has different size.
3529-
3530- See Also
3531- --------
3532- tensordot : Sum products over arbitrary axes.
3533- dot : Generalised matrix product, using second last dimension of `b`.
3534- einsum : Einstein summation convention.
3535-
3536- Notes
3537- -----
3538- For vectors (1-D arrays) it computes the ordinary inner-product::
3539- np.inner(a, b) = sum(a[:]*b[:])
3540- More generally, if `ndim(a) = r > 0` and `ndim(b) = s > 0`::
3541- np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
3542- or explicitly::
3543- np.inner(a, b)[i0,...,ir-1,j0,...,js-1]
3544- = sum(a[i0,...,ir-1,:]*b[j0,...,js-1,:])
3545- In addition `a` or `b` may be scalars, in which case::
3546- np.inner(a,b) = a*b
3547-
3548- Examples
3549- --------
3550- Ordinary inner product for vectors:
3551- >>> a = np.array([1,2,3])
3552- >>> b = np.array([0,1,0])
3553- >>> np.inner(a, b)
3554- 2
3555- A multidimensional example:
3556- >>> a = np.arange(24).reshape((2,3,4))
3557- >>> b = np.arange(4)
3558- >>> np.inner(a, b)
3559- array([[ 14, 38, 62],
3560- [ 86, 110, 134]])
3561- """
3562- return tensordot (a , b , [- 1 , - 1 ])
3563-
3564-
3565- @set_module ('mxnet.ndarray.numpy' )
3566- def outer (a , b ):
3567- r"""
3568- Compute the outer product of two vectors.
3569- Given two vectors, ``a = [a0, a1, ..., aM]`` and
3570- ``b = [b0, b1, ..., bN]``,
3571- the outer product [1]_ is::
3572- [[a0*b0 a0*b1 ... a0*bN ]
3573- [a1*b0 .
3574- [ ... .
3575- [aM*b0 aM*bN ]]
3576-
3577- Parameters
3578- ----------
3579- a : (M,) ndarray
3580- First input vector. Input is flattened if
3581- not already 1-dimensional.
3582- b : (N,) ndarray
3583- Second input vector. Input is flattened if
3584- not already 1-dimensional.
3585-
3586- Returns
3587- -------
3588- out : (M, N) ndarray
3589- ``out[i, j] = a[i] * b[j]``
3590- See also
3591- --------
3592- inner
3593- einsum : ``einsum('i,j->ij', a.ravel(), b.ravel())`` is the equivalent.
3594- ufunc.outer : A generalization to N dimensions and other operations.
3595- ``np.multiply.outer(a.ravel(), b.ravel())`` is the equivalent.
3596- References
3597- ----------
3598- .. [1] : G. H. Golub and C. F. Van Loan, *Matrix Computations*, 3rd
3599- ed., Baltimore, MD, Johns Hopkins University Press, 1996,
3600- pg. 8.
3601- Examples
3602- --------
3603- Make a (*very* coarse) grid for computing a Mandelbrot set:
3604- >>> rl = np.outer(np.ones((5,)), np.linspace(-2, 2, 5))
3605- >>> rl
3606- array([[-2., -1., 0., 1., 2.],
3607- [-2., -1., 0., 1., 2.],
3608- [-2., -1., 0., 1., 2.],
3609- [-2., -1., 0., 1., 2.],
3610- [-2., -1., 0., 1., 2.]])
3611- """
3612- return tensordot (a .flatten (), b .flatten (), 0 )
3613-
3614-
3615- @set_module ('mxnet.ndarray.numpy' )
3616- def vdot (a , b ):
3617- r"""
3618- Return the dot product of two vectors.
3619- Note that `vdot` handles multidimensional arrays differently than `dot`:
3620- it does *not* perform a matrix product, but flattens input arguments
3621- to 1-D vectors first. Consequently, it should only be used for vectors.
3622-
3623- Parameters
3624- ----------
3625- a : ndarray
3626- First argument to the dot product.
3627- b : ndarray
3628- Second argument to the dot product.
3629-
3630- Returns
3631- -------
3632- output : ndarray
3633- Dot product of `a` and `b`.
3634-
3635- See Also
3636- --------
3637- dot : Return the dot product without using the complex conjugate of the
3638- first argument.
3639-
3640- Examples
3641- --------
3642- Note that higher-dimensional arrays are flattened!
3643- >>> a = np.array([[1, 4], [5, 6]])
3644- >>> b = np.array([[4, 1], [2, 2]])
3645- >>> np.vdot(a, b)
3646- 30
3647- >>> np.vdot(b, a)
3648- 30
3649- >>> 1*4 + 4*1 + 5*2 + 6*2
3650- 30
3651- """
3652- return tensordot (a .flatten (), b .flatten (), 1 )
3653-
3654-
36553508@set_module ('mxnet.ndarray.numpy' )
36563509def equal (x1 , x2 , out = None ):
36573510 """
0 commit comments