xlogy#
- ivy.xlogy(x, y, /, *, out=None)[source]#
Compute x*log(y) element-wise so that the result is 0 if x = 0.
- Parameters:
- Return type:
bool
- Returns:
ret – The next representable values of x1 in the direction of x2.
Examples
>>> x = ivy.zeros(3) >>> y = ivy.array([-1.0, 0.0, 1.0]) >>> ivy.xlogy(x, y) ivy.array([0.0, 0.0, 0.0])
>>> x = ivy.array([1.0, 2.0, 3.0]) >>> y = ivy.array([3.0, 2.0, 1.0]) >>> ivy.xlogy(x, y) ivy.array([1.0986, 1.3863, 0.0000])
- Array.xlogy(self, y, /, *, out=None)#
ivy.Array instance method variant of ivy.xlogy. This method simply wraps the function, and so the docstring for ivy.xlogy also applies to this method with minimal changes.
- Parameters:
self (
Array
) – First input array.y (
Array
) – Second input array.out (
Optional
[Array
]) – Alternate output array in which to place the result. (default:None
) The default is None.
- Return type:
Array
- Returns:
ret – The next representable values of x1 in the direction of x2.
Examples
>>> x = ivy.zeros(3) >>> y = ivy.array([-1.0, 0.0, 1.0]) >>> x.xlogy(y) ivy.array([0.0, 0.0, 0.0])
>>> x = ivy.array([1.0, 2.0, 3.0]) >>> y = ivy.array([3.0, 2.0, 1.0]) >>> x.xlogy(y) ivy.array([1.0986, 1.3863, 0.0000])
- Container.xlogy(self, y, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)#
ivy.Container instance method variant of ivy.xlogy. This method simply wraps the function, and so the docstring for ivy.xlogy also applies to this method with minimal changes.
- Parameters:
self (
Container
) – Input container containing first input array.y (
Container
) – Input container containing second input array.key_chains (
Optional
[Union
[List
[str
],Dict
[str
,str
]]]) – The key-chains to apply or not apply the method to. Default isNone
. (default:None
)to_apply (
bool
) – If True, the method will be applied to key_chains, otherwise key_chains (default:True
) will be skipped. Default isTrue
.prune_unapplied (
bool
) – Whether to prune key_chains for which the function was not applied. (default:False
) Default isFalse
.map_sequences (
bool
) – Whether to also map method to sequences (lists, tuples). (default:False
) Default isFalse
.out (
Optional
[Container
]) – Alternate output array in which to place the result. (default:None
) The default is None.
- Return type:
Container
- Returns:
ret – container including the next representable values of input container’s arrays, element-wise
Examples
>>> x = ivy.Container(a=ivy.zeros(3)), ... b=ivy.array([1.0, 2.0, 3.0])) >>> y = ivy.Container(a=ivy.array([-1.0, 0.0, 1.0]), ... b=ivy.array([3.0, 2.0, 1.0])) >>> x.xlogy(y) { a: ivy.array([0.0, 0.0, 0.0]), b: ivy.array([1.0986, 1.3863, 0.0000]) }