stable_pow#

ivy.stable_pow(base, exponent, /, *, min_base=None)[source]#

Raise the base by the power, with MIN_BASE added to the base when exponent > 1 for numerical stability.

Parameters:
  • base (Union[Number, Array, NativeArray]) – The base number.

  • exponent (Union[Number, Array, NativeArray]) – The exponent number.

  • min_base (Optional[float]) – The minimum base to use, use global ivy._MIN_BASE by default. (default: None)

Return type:

Any

Returns:

ret – The new item following the numerically stable power.

Array.stable_pow(self, exponent, /, *, min_base=None)#

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

Parameters:
  • self (Array) – input array, used as the base.

  • exponent (Union[Number, Array, NativeArray]) – The exponent number.

  • min_base (Optional[float]) – The minimum base to use, use global ivy._MIN_BASE by default. (default: None)

Return type:

Array

Returns:

ret – The new item following the numerically stable power.

Container.stable_pow(self, exponent, /, *, min_base=None, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)#

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

Parameters:
  • self – Container of the base.

  • exponent (Union[Number, Array, NativeArray, Container]) – Container of the exponent.

  • min_base (Optional[float]) – The minimum base to use, use global ivy._MIN_BASE by default. (default: None)

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

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

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

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

Return type:

Container

Returns:

ret – A container of elements containing the new items following the numerically stable power.