digamma#

ivy.digamma(x, /, *, out=None)[source]#

Compute the logarithmic derivative of the gamma function at x.

Note

The Ivy version only accepts real-valued inputs.

Parameters:
  • x (Union[Array, NativeArray]) – Input array.

  • out (Optional[Array], default: None) – Alternate output array in which to place the result. The default is None.

Return type:

Array

Returns:

ret – Array with values computed from digamma function from input arrays’ values, element-wise.

Examples

>>> x = ivy.array([.9, 3, 3.2])
>>> y = ivy.digamma(x)
ivy.array([-0.7549271   0.92278427  0.9988394])
Array.digamma(self, /, *, out=None)[source]#

ivy.Array instance method variant of ivy.digamma. This method simply wraps the function, and so the docstring for ivy.digamma also applies to this method with minimal changes.

Note

The Ivy version only accepts real-valued inputs.

Parameters:
  • self (Array) – Input array.

  • out (Optional[Array], default: None) – Alternate output array in which to place the result. The default is None.

Return type:

Array

Returns:

ret – Array with values computed from digamma function from input arrays’ values, element-wise.

Examples

>>> x = ivy.array([.9, 3, 3.2])
>>> y = ivy.digamma(x)
ivy.array([-0.7549271   0.92278427  0.9988394])
Container.digamma(self, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container instance method variant of ivy.digamma. This method simply wraps the function, and so the docstring for ivy.digamma also applies to this method with minimal changes.

Note

The Ivy version only accepts real-valued inputs.

Parameters:
  • self (Container) – Input container containing input arrays.

  • key_chains (Optional[Union[List[str], Dict[str, str]]], default: None) – The key-chains to apply or not apply the method to. Default is None.

  • to_apply (bool, default: True) – If True, the method will be applied to key_chains, otherwise key_chains will be skipped. Default is True.

  • prune_unapplied (bool, default: False) – Whether to prune key_chains for which the function was not applied. Default is False.

  • map_sequences (bool, default: False) – Whether to also map method to sequences (lists, tuples). Default is False.

  • out (Optional[Container], default: None) – Alternate output array in which to place the result. The default is None.

Return type:

Container

Returns:

ret – container including the digamma function computed element-wise

Examples

>>> x = ivy.Container(a=ivy.array([1, 0.5]), b=ivy.array([2.0, 3.0])
>>> x.digamma()
{
    a: ivy.array([-0.5772, -1.9635]),
    b: ivy.array([0.4228, 0.9228])
}