dpnp.square
- dpnp.square(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Return the element-wise square of the input.
For full documentation refer to
numpy.square.- Returns:
out – Element-wise x * x, of the same shape and dtype as x.
- Return type:
dpnp.ndarray
Limitations
Input array is supported as either
dpnp.ndarrayordpctl.tensor.usm_ndarray. Parameter out is supported as class:dpnp.ndarray, class:dpctl.tensor.usm_ndarray or with default valueNone. Parameters where, dtype and subok are supported with their default values. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp..linalg.matrix_powerRaise a square matrix to the (integer) power n.
dpnp.sqrtReturn the positive square-root of an array, element-wise.
dpnp.powerFirst array elements raised to powers from second array, element-wise.
Examples
>>> import dpnp as np >>> x = np.array([-1j, 1]) >>> np.square(x) array([-1.+0.j, 1.+0.j])