dpnp.copysign
- dpnp.copysign(x1, x2, dtype=None, out=None, where=True, **kwargs)[source]
Change the sign of x1 to that of x2, element-wise.
For full documentation refer to
numpy.copysign
.Limitations
Parameters
x1
andx2
are supported as eitherdpnp.ndarray
or scalar. Parametersdtype
,out
andwhere
are supported with their default values. Keyword argumentskwargs
are currently unsupported. Otherwise the functions will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.Examples
>>> import dpnp as np >>> result = np.copysign(np.array([1, -2, 6, -9]), np.array([-1, -1, 1, 1])) >>> [x for x in result] [-1.0, -2.0, 6.0, 9.0]