Elementwise#

class ivy.data_classes.container.elementwise._ContainerWithElementwise(dict_in=None, queues=None, queue_load_sizes=None, container_combine_method='list_join', queue_timeout=None, print_limit=10, key_length_limit=None, print_indent=4, print_line_spacing=0, ivyh=None, default_key_color='green', keyword_color_dict=None, rebuild_child_containers=False, types_to_iteratively_nest=None, alphabetical_keys=True, dynamic_backend=None, build_callable=False, **kwargs)[source]#

Bases: ContainerBase

_abc_impl = <_abc._abc_data object>#
static _static_abs(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the absolute value of each element in x. The returned container must have the same data type as x.

Examples

>>> x = ivy.Container(a=ivy.array([0., 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -0, -2.3]))
>>> y = ivy.Container.static_abs(x)
>>> print(y)
{
    a: ivy.array([0., 2.6, 3.5]),
    b: ivy.array([4.5, 5.3, 0, 2.3])
}
static _static_acos(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse cosine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -1.]))
>>> y = ivy.Container.static_acos(x)
>>> print(y)
{
    a: ivy.array([1.57, 3.14, 0.]),
    b: ivy.array([0., 1.57, 3.14])
}
static _static_acosh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic cosine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1., 2., 3, 4]),
...                   b=ivy.array([1., 3., 10.0, 6]))
>>> y = ivy.Container.static_acosh(x)
>>> print(y)
{
    a: ivy.array([0., 1.32, 1.76, 2.06]),
    b: ivy.array([0., 1.76, 2.99, 2.48])
}
static _static_add(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, alpha=None, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have a numeric data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container. Must be compatible with x1 (see broadcasting). Should have a numeric data type.

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

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

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

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

  • alpha (Optional[Union[int, float, Container]], default: None) – scalar multiplier for x2.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise sums. The returned container must have a data type determined by type-promotion.

Examples

With one ivy.Container input:

>>> x = ivy.array([[1.1, 2.3, -3.6]])
>>> y = ivy.Container(a=ivy.array([[4.], [5.], [6.]]),
...                   b=ivy.array([[5.], [6.], [7.]]))
>>> z = ivy.Container.static_add(x, y)
>>> print(z)
{
    a: ivy.array([[5.1, 6.3, 0.4],
                  [6.1, 7.3, 1.4],
                  [7.1, 8.3, 2.4]]),
    b: ivy.array([[6.1, 7.3, 1.4],
                  [7.1, 8.3, 2.4],
                  [8.1, 9.3, 3.4]])
}

With multiple ivy.Container inputs:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_add(x, y)
>>> print(z)
{
    a: ivy.array([5, 7, 9]),
    b: ivy.array([7, 9, 11])
}
>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_add(x, y, alpha=2)
>>> print(z)
{
    a: ivy.array([9, 12, 15]),
    b: ivy.array([12, 15, 18])
}
static _static_asin(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse sine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., -0.5, -1.]),
...                   b=ivy.array([0.1, 0.8, 2.]))
>>> y = ivy.Container.static_asin()
>>> print(y)
{
    a: ivy.array([0., -0.524, -1.57]),
    b: ivy.array([0.1, 0.927, nan])
}
>>> x = ivy.Container(a=ivy.array([0.4, 0.9, -0.9]),
...                   b=ivy.array([[4, -3, -0.2]))
>>> y = ivy.Container(a=ivy.zeros(3), b=ivy.zeros(3))
>>> ivy.Container.static_asin(out=y)
>>> print(y)
{
    a: ivy.array([0.412, 1.12, -1.12]),
    b: ivy.array([nan, nan, -0.201])
}
static _static_asinh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic sine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1.5, 0., -3.5]),
...                   b=ivy.array([3.4, -5.3, -0, -2.8]))
>>> y = ivy.Container.static_asinh(x)
>>> print(y)
{
    a: ivy.array([1.19, 0., -1.97]),
    b: ivy.array([1.94, -2.37, 0., -1.75])
}
static _static_atan(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse tangent of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -6]))
>>> y = ivy.Container.static_atan(x)
>>> print(y)
{
    a: ivy.array([0., -0.785, 0.785]),
    b: ivy.array([0.785, 0., -1.41])
}
static _static_atan2(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container corresponding to the y-coordinates. Should have a real-valued floating-point data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container corresponding to the x-coordinates. Must be compatible with x1 (see broadcasting). Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse tangent of the quotient x1/x2. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -0]))
>>> y = ivy.array([3.0, 2.0, 1.0])
>>> ivy.Container.static_atan2(x, y)
{
    a: ivy.array([0., 0.915, -1.29]),
    b: ivy.array([0.983, -1.21, 0.])
}
>>> x = ivy.Container(a=ivy.array([0., 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -0, -2.3]))
>>> y = ivy.Container(a=ivy.array([-2.5, 1.75, 3.5]),
...                   b=ivy.array([2.45, 6.35, 0, 1.5]))
>>> z = ivy.Container.static_atan2(x, y)
>>> print(z)
{
    a: ivy.array([3.14, 0.978, -0.785]),
    b: ivy.array([1.07, -0.696, 0., -0.993])
}
static _static_atanh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic tangent of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0, 0.5, -0.5]), b=ivy.array([0., 0.2, 0.9]))
>>> y = ivy.Container.static_atanh(x)
>>> print(y)
{
    a: ivy.array([0., 0.549, -0.549]),
    b: ivy.array([0., 0.203, 1.47])
}
static _static_bitwise_and(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container Must be compatible with x1 (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With one ivy.Container input:

>>> x = ivy.array([1, 2, 3])
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_bitwise_and(x, y)
>>> print(z)
{
        a: ivy.array([0, 0, 2]),
        b: ivy.array([1, 2, 3])
}

With multiple ivy.Container inputs:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_bitwise_and(x, y)
>>> print(z)
{
        a: ivy.array([0, 0, 2]),
        b: ivy.array([0, 2, 4])
}
static _static_bitwise_invert(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned array must have the same data type as x.

Examples

>>> x = ivy.Container(a=[False, True, False], b=[True, True, False])
>>> y = ivy.Container.static_bitwise_invert(x)
>>> print(y)
{
    a: ivy.array([True, False, True]),
    b: ivy.array([False, False, True])
}
>>> x = ivy.Container(a=[1, 2, 3], b=[4, 5, 6])
>>> y = ivy.Container.static_bitwise_invert(x)
>>> print(y)
{
    a: ivy.array([-2, -3, -4]),
    b: ivy.array([-5, -6, -7])
}
static _static_bitwise_left_shift(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container Must be compatible with x1 (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

static _static_bitwise_or(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x – input container. Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned array must have the same data type as x.

Examples

With one ivy.Container input:

>>> y = ivy.array([1, 2, 3])
>>> x = ivy.Container(a=ivy.array([4, 5, 6]))
>>> z = ivy.Container.static_bitwise_or(x, y)
>>> print(z)
{
    a: ivy.array([5, 7, 7]),
}

With multiple ivy.Container inputs:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_bitwise_or(x, y)
>>> print(z)
{
    a: ivy.array([5, 7, 7]),
    b: ivy.array([7, 7, 7])
}
static _static_bitwise_right_shift(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container Must be compatible with x1 (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With one ivy.Container input:

>>> a = ivy.Container(a = ivy.array([2, 3, 4]), b = ivy.array([5, 10, 64]))
>>> b = ivy.array([0, 1, 2])
>>> y = ivy.Container.static_bitwise_right_shift(a, b)
>>> print(y)
{
    a: ivy.array([2, 1, 1]),
    b: ivy.array([5, 5, 16])
}

With multiple ivy.Container inputs:

>>> a = ivy.Container(a = ivy.array([2, 3, 4]), b = ivy.array([5, 10, 64]))
>>> b = ivy.Container(a = ivy.array([0, 1, 2]), b = ivy.array([2]))
>>> y = ivy.Container.static_bitwise_right_shift(a, b)
>>> print(y)
{
    a: ivy.array([2, 1, 1]),
    b: ivy.array([1, 2, 16])
}
static _static_bitwise_xor(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container Must be compatible with x1 (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

>>> x = ivy.Container(a = ivy.array([89]), b = ivy.array([3]))
>>> y = ivy.Container(a = ivy.array([12]), b = ivy.array([5]))
>>> z = ivy.Container.static_bitwise_xor(x, y)
>>> print(z)
{
    a: ivy.array([85]),
    b: ivy.array([6])
}
static _static_ceil(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an container containing the rounded result for each element in x. The returned array must have the same data type as x.

Examples

>>> x = ivy.Container(a=ivy.array([2.5, 0.5, -1.4]),
...                   b=ivy.array([5.4, -3.2, 5.2]))
>>> y = ivy.Container.static_ceil(x)
>>> print(y)
{
    a: ivy.array([3., 1., -1.]),
    b: ivy.array([6., -3., 6.])
}
static _static_cos(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements are each expressed in radians. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the cosine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -6]))
>>> y = ivy.Container.static_cos(x)
>>> print(y)
{
    a: ivy.array([1., 0.54, 0.54]),
    b: ivy.array([0.54, 1., 0.96])
}
static _static_cosh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements each represent a hyperbolic angle. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an container containing the hyperbolic cosine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([-1, 0.23, 1.12]), b=ivy.array([1, -2, 0.76]))
>>> y = ivy.Container.static_cosh(x)
>>> print(y)
{
    a: ivy.array([1.54, 1.03, 1.7]),
    b: ivy.array([1.54, 3.76, 1.3])
}
>>> x = ivy.Container(a=ivy.array([-3, 0.34, 2.]),
...                   b=ivy.array([0.67, -0.98, -3]))
>>> y = ivy.Container(a=ivy.zeros(1), b=ivy.zeros(1))
>>> ivy.Container.static_cosh(x, out=y)
>>> print(y)
{
    a: ivy.array([10.1, 1.06, 3.76]),
    b: ivy.array([1.23, 1.52, 10.1])
}
static _static_deg2rad(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. to be converted from degrees to radians.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container with each element in x converted from degrees to radians.

Examples

>>> x=ivy.Container(a=ivy.array([0,90,180,270,360]),
...                 b=ivy.native_array([0,-1.5,-50,ivy.nan]))
>>> y=ivy.Container.static_deg2rad(x)
>>> print(y)
{
    a: ivy.array([0., 1.57, 3.14, 4.71, 6.28]),
    b: ivy.array([0., -0.0262, -0.873, nan])
}
static _static_divide(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – dividend input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – divisor input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([12., 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))
>>> x2 = ivy.Container(a=ivy.array([1., 2.3, 3]), b=ivy.array([2.4, 3., 2.]))
>>> y = ivy.Container.static_divide(x1, x2)
>>> print(y)
{
    a: ivy.array([12., 1.52, 2.1]),
    b: ivy.array([1.25, 0.333, 0.45])
}
static _static_equal(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. May have any data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). May have any data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([12, 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))
>>> x2 = ivy.Container(a=ivy.array([12, 2.3, 3]), b=ivy.array([2.4, 3., 2.]))
>>> y = ivy.Container.static_equal(x1, x2)
>>> print(y)
{
    a: ivy.array([True, False, False]),
    b: ivy.array([False, False, False])
}
static _static_erf(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container to compute exponential for.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the Gauss error of x.

Examples

>>> x = ivy.Container(a=ivy.array([-0.25, 4, 1.3]),
...                   b=ivy.array([12, -3.5, 1.234]))
>>> y = ivy.Container.static_erf(x)
>>> print(y)
{
    a: ivy.array([-0.27632612, 1., 0.934008]),
    b: ivy.array([1., -0.99999928, 0.91903949])
}
static _static_exp(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1., 2.,]), b=ivy.array([4., 5.]))
>>> y = ivy.Container.static_exp(x)
>>> print(y)
{
    a: ivy.array([2.71828198, 7.38905573]),
    b: ivy.array([54.59814835, 148.4131622])
}
static _static_expm1(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container static method variant of ivy.expm1. This method simply wraps thefunction, and so the docstring for ivy.expm1 also applies to this method with minimal changes.

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned array must have areal-valued floating-point data type determined by type-promotion.

Examples

With ivy.Container static method:

>>> x = ivy.Container(a=ivy.array([1, 2]), b=ivy.array([3, 4]))
>>> print(ivy.Container.static_expm1(x))
{
    a: ivy.array([1.71828175, 6.38905621]),
    b: ivy.array([19.08553696, 53.59815216])
}
static _static_floor(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container static method variant of ivy.floor. This method simply wraps thefunction, and so the docstring for ivy.floor also applies to this method with minimal changes.

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the rounded result for each element in x. The returned array must have the same data type as x.

Examples

>>> x = ivy.Container(a=ivy.array([2.5, 0.5, -1.4]),
...                   b=ivy.array([5.4, -3.2, 5.2]))
>>> y = ivy.Container.static_floor(x)
>>> print(y)
{
    a: ivy.array([2., 0., -2.]),
    b: ivy.array([5., -4., 5.])
}
static _static_floor_divide(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – dividend input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – divisor input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([4., 5., 6.]), b=ivy.array([7., 8., 9.]))
>>> x2 = ivy.Container(a=ivy.array([5., 4., 2.5]), b=ivy.array([2.3, 3.7, 5]))
>>> y = ivy.Container.static_floor_divide(x1, x2)
>>> print(y)
{
    a: ivy.array([0., 1., 2.]),
    b: ivy.array([3., 2., 1.])
}

With mixed ivy.Container and ivy.Array inputs:

>>> x1 = ivy.Container(a=ivy.array([4., 5., 6.]), b=ivy.array([7., 8., 9.]))
>>> x2 = ivy.array([2, 3, 4])
>>> y = ivy.Container.static_floor_divide(x1, x2)
>>> print(y)
{
    a: ivy.array([2., 1., 1.]),
    b: ivy.array([3., 2., 2.])
}
static _static_greater(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – divisor input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned array must have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_greater(y,x)
>>> print(z)
{
    a: ivy.array([False, False, False]),
    b: ivy.array([True, True, True])
}
static _static_greater_equal(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_greater_equal(y)
>>> print(z)
{
    a:ivy.array([True,True,True]),
    b:ivy.array([False,False,False])
}
static _static_isfinite(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the test result. An element out_i is True if x_i is finite and False otherwise. The returned array must have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([0., 999999999999]),
...                   b=ivy.array([float('-0'), ivy.nan]))
>>> y = ivy.Container.static_isfinite(x)
>>> print(y)
{
    a: ivy.array([True, True]),
    b: ivy.array([True, False])
}
static _static_isinf(x, /, *, detect_positive=True, detect_negative=True, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued data type.

  • detect_positive (Union[bool, Container], default: True) – if True, positive infinity is detected.

  • detect_negative (Union[bool, Container], default: True) – if True, negative infinity is detected.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the test result. An element out_i is True if x_i is either positive or negative infinity and False otherwise. The returned array must have a data type of bool.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([-1, -float('inf'), 1.23]),
...                   b=ivy.array([float('inf'), 3.3, -4.2]))
>>> z = ivy.Container.static_isinf(x)
>>> print(z)
{
    a: ivy.array([False, True, False]),
    b: ivy.array([True, False, False])
}
static _static_isnan(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the test result. An element out_i is True if x_i is NaN and False otherwise. The returned array should have a data type of bool.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([-1, -float('nan'), 1.23]),
...                   b=ivy.array([float('nan'), 3.3, -4.2]))
>>> z = ivy.Container.static_isnan(x)
>>> print(z)
{
    a: ivy.array([False, True, False]),
    b: ivy.array([True, False, False])
}
static _static_isreal(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the test result. An element out_i is True if x_i is real number and False otherwise. The returned array should have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([-1+5j, 0-0j, 1.23j]),
...                   b=ivy.array([7.9, 3.3j, -4.2-5.9j]))
>>> z = ivy.Container.static_isreal(x)
>>> print(z)
{
    a: ivy.array([False, True, False]),
    b: ivy.array([True, False, False])
}
static _static_lcm(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Container, Array, NativeArray]) – first input container.

  • x2 (Union[Container, Array, NativeArray]) – second input container.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – a container containing the element-wise least common multiples of the arrays contained in x1 and x2.

Examples

>>> x1=ivy.Container(a=ivy.array([2, 3, 4]),
...                  b=ivy.array([6, 54, 62, 10]))
>>> x2=ivy.Container(a=ivy.array([5, 8, 15]),
...                  b=ivy.array([32, 40, 25, 13]))
>>> ivy.Container.lcm(x1, x2)
{
    a: ivy.array([10, 21, 60]),
    b: ivy.array([96, 1080, 1550, 130])
}
static _static_less(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([5, 6, 7]))
>>> z = ivy.Container.static_less(y,x)
>>> print(z)
{
    a: ivy.array([True, True, True]),
    b: ivy.array([False, False, False])
}
static _static_less_equal(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

With :code:’ivy.Container’ inputs:

>>> x1 = ivy.Container(a=ivy.array([12, 3.5, 9.2]), b=ivy.array([2., 1.1, 5.5]))
>>> x2 = ivy.Container(a=ivy.array([12, 2.2, 4.1]), b=ivy.array([1, 0.7, 3.8]))
>>> y = ivy.Container.static_less_equal(x1, x2)
>>> print(y)
{
    a: ivy.array([True, False, False]),
    b: ivy.array([False, False, False])
}
static _static_log(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the log for each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

Using ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0.0, float('nan')]),
...                   b=ivy.array([-0., -3.9, float('+inf')]),
...                   c=ivy.array([7.9, 1.1, 1.]))
>>> y = ivy.Container.static_log(x)
>>> print(y)
{
    a: ivy.array([-inf, nan]),
    b: ivy.array([-inf, nan, inf]),
    c: ivy.array([2.07, 0.0953, 0.])
}
static _static_log10(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated base 10 logarithm for each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

Using ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0.0, float('nan')]),
...                   b=ivy.array([-0., -3.9, float('+inf')]),
...                   c=ivy.array([7.9, 1.1, 1.]))
>>> y = ivy.Container.static_log10(x)
>>> print(y)
{
    a: ivy.array([-inf, nan]),
    b: ivy.array([-inf, nan, inf]),
    c: ivy.array([0.898, 0.0414, 0.])
}
static _static_log1p(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([3., 4., 5.1]))
>>> y = ivy.Container.static_log1p(x)
>>> print(y)
{
    a: ivy.array([0., 0.693, 1.1]),
    b: ivy.array([1.39, 1.61, 1.81])
}
>>> x = ivy.Container(a=ivy.array([0., 2.]), b=ivy.array([ 4., 5.1]))
>>> ivy.Container.static_log1p(x, out = x)
>>> print(y)
{
    a: ivy.array([0., 0.693, 1.1]),
    b: ivy.array([1.39, 1.61, 1.81])
}
static _static_log2(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated base 2 logarithm for each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

Using ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0.0, float('nan')]),                              b=ivy.array([-0., -4.9, float('+inf')]),                              c=ivy.array([8.9, 2.1, 1.]))
>>> y = ivy.Container.static_log2(x)
>>> print(y)
{
    a: ivy.array([-inf, nan]),
    b: ivy.array([-inf, nan, inf]),
    c: ivy.array([3.15, 1.07, 0.])
}
static _static_logaddexp(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a real-valued floating-point data type determined by type-promotion.

Examples

Using ivy.Container input:

>>> x = ivy.Container(a=ivy.array([4., 5., .]),
...                   b=ivy.array([2., 3., 4.]))
>>> y = ivy.Container(a=ivy.array([1., 2., 3.]),
...                   b=ivy.array([5., 6., 7.]))
>>> z = ivy.Container.static_logaddexp(y,x)
>>> print(z)
{
    a: ivy.array([4.05, 5.05, 6.05]),
    b: ivy.array([5.05, 6.05, 7.05])
}
static _static_logical_and(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

Using ‘ivy.Container’ instance

>>> a = ivy.Container(a=ivy.array([True, False, True, False]))
>>> b = ivy.Container(a=ivy.array([True, True, False, False]))
>>> w = ivy.Container.static_logical_and(a, b)
>>> print(w)
{
    a:ivy.array([True,False,False,False])
}
>>> j = ivy.Container(a=ivy.array([True, True, False, False]))
>>> m = ivy.array([False, True, False, True])
>>> x = ivy.Container.static_logical_and(j, m)
>>> print(x)
{
    a:ivy.array([False,True,False,False])
}
>>> k = ivy.Container(a=ivy.array([True, False, True]),
...                   b=ivy.array([True, False, False]))
>>> l = ivy.Container(a=ivy.array([True, True, True]),
...                   b=ivy.array([False, False, False]))
>>> z = ivy.Container.static_logical_and(k, l)
>>> print(z)
{
    a:ivy.array([True,False,True]),
    b:ivy.array([False,False,False])
}
static _static_logical_not(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned container must have a data type of bool.

Examples

Using ‘ivy.Container’ instance

>>> x=ivy.Container(a=ivy.array([1,0,0,1]), b=ivy.array([3,1,7,0]))
>>> ivy.Container.static_logical_not(x)
{
    a: ivy.array([False, True, True, False]),
    b: ivy.array([False, False, False, True])
}
static _static_logical_or(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

>>> x = ivy.Container(a=ivy.array([False, False, True]),
...                   b=ivy.array([True, False, True]))
>>> y = ivy.Container(a=ivy.array([False, True, False]),
...                   b=ivy.array([True, True, False]))
>>> z = ivy.Container.static_logical_or(x, y)
>>> print(z)
{
    a: ivy.array([False, True, True]),
    b: ivy.array([True, True, True])
}
static _static_logical_xor(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a boolean data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

With one ivy.Container input:

>>> x = ivy.array([0,0,1,1,0])
>>> y = ivy.Container(a=ivy.array([1,0,0,1,0]), b=ivy.array([1,0,1,0,0]))
>>> z = ivy.Container.static_logical_xor(x, y)
>>> print(z)
{
    a: ivy.array([True, False, True, False, False]),
    b: ivy.array([True, False, False, True, False])
}

With multiple ivy.Container inputs:

>>> x = ivy.Container(a=ivy.array([1,0,0,1,0]), b=ivy.array([1,0,1,0,0]))
>>> y = ivy.Container(a=ivy.array([0,0,1,1,0]), b=ivy.array([1,0,1,1,0]))
>>> z = ivy.Container.static_logical_xor(x, y)
>>> print(z)
{
    a: ivy.array([True, False, True, False, False]),
    b: ivy.array([False, False, False, True, False])
}
static _static_maximum(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, use_where=True, out=None)[source]#

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

Parameters:
  • x1 (Union[Container, Array, NativeArray]) – Input array containing elements to maximum threshold.

  • x2 (Union[Container, Array, NativeArray]) – Tensor containing maximum values, must be broadcastable to x1.

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

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

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

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

  • use_where (Union[bool, Container], default: True) – Whether to use where() to calculate the maximum. If False, the maximum is calculated using the (x + y + |x - y|)/2 formula. Default is True.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – A container with the elements of x1, but clipped to not be lower than the x2 values.

Examples

With one ivy.Container input:

>>> x = ivy.array([[1, 3], [2, 4], [3, 7]])
>>> y = ivy.Container(a=ivy.array([1, 0,]),
...                   b=ivy.array([-5, 9]))
>>> z = ivy.Container.static_maximum(x, y)
>>> print(z)
{
    a: ivy.array([[1, 3],
                  [2, 4],
                  [3, 7]]),
    b: ivy.array([[1, 9],
                  [2, 9],
                  [3, 9]])
}
static _static_minimum(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, use_where=True, out=None)[source]#

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

Parameters:
  • x1 (Union[Container, Array, NativeArray]) – Input array containing elements to minimum threshold.

  • x2 (Union[Container, Array, NativeArray]) – The other container or number to compute the minimum against.

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

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

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

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

  • use_where (Union[bool, Container], default: True) – Whether to use where() to calculate the minimum. If False, the minimum is calculated using the (x + y - |x - y|)/2 formula. Default is True.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

Container object with all sub-arrays having the minimum values computed.

Examples

With multiple ivy.Container inputs:

>>> x = ivy.Container(a=ivy.array([1, 3, 1]),
...                   b=ivy.array([2, 8, 5]))
>>> y = ivy.Container(a=ivy.array([1, 5, 6]),
...                   b=ivy.array([5, 9, 7]))
>>> z = ivy.Container.static_minimum(x, y)
>>> print(z)
{
    a: ivy.array([1, 3, 1]),
    b: ivy.array([2, 8, 5])
}
static _static_multiply(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([15., 4.5, 6.5]),                               b=ivy.array([3.2, 5., 7.5]))
>>> x2 = ivy.Container(a=ivy.array([1.7, 2.8, 3.]),                               b=ivy.array([5.6, 1.2, 4.2]))
>>> y =ivy.Container.static_multiply(x1, x2)
>>> print(y)
{
    a: ivy.array([25.5, 12.6, 19.5]),
    b: ivy.array([17.9, 6., 31.5])
}
static _static_negative(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned container must have the same data type as x.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
...                   b=ivy.array([3., 4., -5.]))
>>> y = ivy.Container.static_negative(x)
>>> print(y)
{
    a: ivy.array([-0., -1., -2.]),
    b: ivy.array([-3., -4., 5.])
}
static _static_not_equal(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. May have any data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). May have any data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type of bool.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([12, 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))
>>> x2 = ivy.Container(a=ivy.array([12, 2.3, 3]), b=ivy.array([2.4, 3., 2.]))
>>> y = ivy.Container.static_not_equal(x1, x2)
>>> print(y)
{
    a: ivy.array([False, True, True]),
    b: ivy.array([True, True, True])
}
static _static_positive(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned container must have the same data type as x.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0., 1., 2.]),
...                   b=ivy.array([3., 4., -5.]))
>>> y = ivy.Container.static_positive(x)
>>> print(y)
{
    a: ivy.array([0., 1., 2.]),
    b: ivy.array([3., 4., -5.])
}
static _static_pow(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[int, float, Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0, 1]), b=ivy.array([2, 3]))
>>> y = ivy.Container.static_pow(x, 2)
>>> print(y)
{
    a: ivy.array([0, 1]),
    b: ivy.array([4, 9])
}
static _static_rad2deg(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. to be converted from radians to degrees.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container with each element in x converted from radians to degrees.

Examples

>>> x=ivy.Container(a=ivy.array([0,90,180,270,360]),
...                 b=ivy.native_array([0,-1.5,-50,ivy.nan]))
>>> y=ivy.Container.static_rad2deg(x)
>>> print(y)
{
    a: ivy.array([0., 5160., 10300., 15500., 20600.]),
    b: ivy.array([0., -85.9, -2860., nan])
}
static _static_reciprocal(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container with the element-wise recirpocal of x

Examples

>>> x = ivy.Container(a=ivy.array([1, 2]), b=ivy.array([4, 5]))
>>> y = ivy.Container.static_reciprocal(x)
>>> print(y)
{
    a: ivy.array([1, 0.5]),
    b: ivy.array([0.25, 0.2])
}
static _static_remainder(x1, x2, /, *, modulus=True, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

  • modulus (Union[bool, Container], default: True) – whether to compute the modulus instead of the remainder. Default is True.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have the same sign as the respective element x2_i.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([2., 3., 5.]), b=ivy.array([2., 2., 4.]))
>>> x2 = ivy.Container(a=ivy.array([1., 3., 4.]), b=ivy.array([1., 3., 3.]))
>>> y = ivy.Container.static_remainder(x1, x2)
>>> print(y)
{
    a: ivy.array([0., 0., 1.]),
    b: ivy.array([0., 2., 1.])
}

With mixed ivy.Container and ivy.Array inputs:

>>> x1 = ivy.Container(a=ivy.array([2., 3., 5.]), b=ivy.array([2., 2., 4.]))
>>> x2 = ivy.array([1., 2., 3.])
>>> y = ivy.Container.static_remainder(x1, x2)
>>> print(y)
{
    a: ivy.array([0., 1., 2.]),
    b: ivy.array([0., 0., 1.])
}

With mixed ivy.Container and ivy.NativeArray inputs:

>>> x1 = ivy.Container(a=ivy.array([2., 3., 5.]), b=ivy.array([2., 2., 4.]))
>>> x2 = ivy.native_array([1., 2., 3.])
>>> y = ivy.Container.static_remainder(x1, x2)
>>> print(y)
{
    a: ivy.array([0., 1., 2.]),
    b: ivy.array([0., 0., 1.])
}
static _static_round(x, /, *, decimals=0, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container static method variant of ivy.round. This method simply wraps thevfunction, and so the docstring for ivy.round also applies to this method with minimal changes.

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a numeric data type.

  • decimals (Union[int, Container], default: 0) – number of decimal places to round to. Default is 0.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the rounded result for each element in x. The returned container must have the same data type as x.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([4.20, 8.6, 6.90, 0.0]),
...                   b=ivy.array([-300.9, -527.3, 4.5]))
>>> y = ivy.Container.static_round(x)
>>> print(y)
{
    a: ivy.array([4., 9., 7., 0.]),
    b: ivy.array([-301., -527., 4.])
}
static _static_sign(x, /, *, np_variant=True, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[float, Container, Array, NativeArray]) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in x. The returned container must have the same data type as x.

Examples

>>> x = ivy.Container(a=ivy.array([0, -1., 6.6]),
...                   b=ivy.array([-14.2, 8.3, 0.1, -0]))
>>> y = ivy.Container.static_sign(x)
>>> print(y)
{
    a: ivy.array([0., -1., 1.]),
    b: ivy.array([-1., 1., 1., 0.])
}
static _static_sin(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements are each expressed in radians. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the sine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([-1., -2., -3.]),
...                   b=ivy.array([4., 5., 6.]))
>>> y = ivy.Container.static_sin(x)
>>> print(y)
{
    a: ivy.array([-0.841, -0.909, -0.141]),
    b: ivy.array([-0.757, -0.959, -0.279])
}
static _static_sinh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements each represent a hyperbolic angle. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an container containing the hyperbolic sine of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([-1, 0.23, 1.12]), b=ivy.array([1, -2, 0.76]))
>>> y = ivy.Container.static_sinh(x)
>>> print(y)
{
    a: ivy.array([-1.18, 0.232, 1.37]),
    b: ivy.array([1.18, -3.63, 0.835])
}
>>> x = ivy.Container(a=ivy.array([-3, 0.34, 2.]),
...                   b=ivy.array([0.67, -0.98, -3]))
>>> y = ivy.Container(a=ivy.zeros(1), b=ivy.zeros(1))
>>> ivy.Container.static_sinh(x, out=y)
>>> print(y)
{
    a: ivy.array([-10., 0.347, 3.63]),
    b: ivy.array([0.721, -1.14, -10.])
}
static _static_sqrt(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the square root of each element in x. The returned container must have a real-valued floating-point data type determined by type-promotion.

Examples

with ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0., 100., 27.]),
...                   b=ivy.native_array([93., 54., 25.]))
>>> y = ivy.Container.static_sqrt(x)
>>> print(y)
{
    a: ivy.array([0., 10., 5.2]),
    b: ivy.array([9.64, 7.35, 5.])
}
static _static_square(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the square of each element in x. The returned container must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0, 1]), b=ivy.array([2, 3]))
>>> y = ivy.Container.static_square(x)
>>> print(y)
{
    a:ivy.array([0,1]),
    b:ivy.array([4,9])
}
static _static_subtract(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, alpha=None, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – first input array or container. Should have a numeric data type.

  • x2 (Union[Array, NativeArray, Container]) – second input array or container. Must be compatible with x1 (see broadcasting). Should have a numeric data type.

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

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

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

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

  • alpha (Optional[Union[int, float, Container]], default: None) – optional scalar multiplier for x2.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise sums. The returned container must have a data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 1, 3]),
...                   b=ivy.array([1, -1, 0]))
>>> z = ivy.Container.static_subtract(x, y)
>>> print(z)
{
    a: ivy.array([-3, 1, 0]),
    b: ivy.array([1, 4, 4])
}
>>> z = ivy.Container.static_subtract(x, y, alpha=3)
>>> print(z)
{
    a: ivy.array([-11, -1, -6]),
    b: ivy.array([-1, 6, 4])
}
static _static_tan(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Container) – input array whose elements are expressed in radians. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an array containing the tangent of each element in x. The return must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([3., 4., 5.]))
>>> y = ivy.Container.static_tan(x)
>>> print(y)
{
    a: ivy.array([0., 1.56, -2.19]),
    b: ivy.array([-0.143, 1.16, -3.38])
}
static _static_tanh(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, complex_mode='jax', out=None)[source]#

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

Parameters:
  • x (Container) – input container whose elements each represent a hyperbolic angle. Should have a real-valued floating-point data type.

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

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

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

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

  • complex_mode (Literal['split', 'magnitude', 'jax'], default: 'jax') – optional specifier for how to handle complex data types. See ivy.func_wrapper.handle_complex_input for more detail.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the hyperbolic tangent of each element in x. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([3., 4., 5.]))
>>> y = ivy.Container.static_tanh(x)
>>> print(y)
{
    a: ivy.array([0., 0.76, 0.96]),
    b: ivy.array([0.995, 0.999, 0.9999])
}
static _static_trapz(y, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, x=None, dx=1.0, axis=-1, out=None)[source]#

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

Parameters:
  • y (Union[Array, NativeArray, Container]) – The container whose arrays should be integrated.

  • x (Optional[Union[Array, NativeArray, Container]], default: None) – The sample points corresponding to the input array values. If x is None, the sample points are assumed to be evenly spaced dx apart. The default is None.

  • dx (Union[float, Container], default: 1.0) – The spacing between sample points when x is None. The default is 1.

  • axis (Union[int, Container], default: -1) – The axis along which to integrate.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – container including definite integrals of n-dimensional arrays as approximated along a single axis by the trapezoidal rule.

Examples

With one ivy.Container input: >>> y = ivy.Container(a=ivy.array((1, 2, 3)), b=ivy.array((1, 5, 10))) >>> ivy.Container.static_trapz(y) {

a: 4.0 b: 10.5

}

static _static_trunc(x, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x (Union[Container, Array, NativeArray]) – input container. Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the rounded result for each element in x. The returned container must have the same data type as x.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([-0.25, 4, 1.3]),
...                   b=ivy.array([12, -3.5, 1.234]))
>>> y = ivy.Container.static_trunc(x)
>>> print(y)
{
    a: ivy.array([-0., 4., 1.]),
    b: ivy.array([12., -3., 1.])
}
static _static_trunc_divide(x1, x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 (Union[Array, NativeArray, Container]) – dividend input array or container. Should have a real-valued data type.

  • x2 (Union[Array, NativeArray, Container]) – divisor input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([12., 3.5, 6.3]), b=ivy.array([3., 1., 9.]))
>>> x2 = ivy.Container(a=ivy.array([1., 2.3, -3]), b=ivy.array([2.4, 3., -2.]))
>>> y = ivy.Container.static_divide(x1, x2)
>>> print(y)
{
    a: ivy.array([12., 1., -2.]),
    b: ivy.array([1., 0., -4.])
}
abs(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the absolute value of each element in self. The returned container must have the same data type as self.

Examples

>>> x = ivy.Container(a=ivy.array([-1.6, 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -2.3]))
>>> y = x.abs()
>>> print(y)
{
    a: ivy.array([1.6, 2.6, 3.5]),
    b: ivy.array([4.5, 5.3, 2.3])
}
acos(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse cosine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -1.]))
>>> y = x.acos()
>>> print(y)
{
    a: ivy.array([1.57, 3.14, 0.]),
    b: ivy.array([0., 1.57, 3.14])
}
acosh(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic cosine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1., 2., 3, 4]),
...                   b=ivy.array([1., 3., 10.0, 6]))
>>> y = x.acosh()
>>> print(y)
{
    a: ivy.array([0., 1.32, 1.76, 2.06]),
    b: ivy.array([0., 1.76, 2.99, 2.48])
}
add(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, alpha=None, out=None)[source]#

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

Parameters:
  • self (Container) – first input container. Should have a numeric data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container. Must be compatible with self (see broadcasting). Should have a numeric data type.

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

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

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

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

  • alpha (Optional[Union[int, float, Container]], default: None) – scalar multiplier for x2.

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise sums. The returned container must have a data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = x.add(y)
>>> print(z)
{
    a: ivy.array([5, 7, 9]),
    b: ivy.array([7, 9, 11])
}
>>> z = x.add(y, alpha=3)
>>> print(z)
{
    a: ivy.array([13, 17, 21]),
    b: ivy.array([17, 21, 25])
}
angle(*, deg=False, out=None)[source]#

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

Parameters:
  • z – Array-like input.

  • deg (Union[bool, Container], default: False) – optional bool.

  • out (Optional[Container], default: None) – optional output array, for writing the result to.

Return type:

Container

Returns:

ret – Returns an array of angles for each complex number in the input. If def is False(default), angle is calculated in radian and if def is True, then angle is calculated in degrees.

Examples

>>> ivy.set_backend('tensorflow')
>>> x = ivy.Container(a=ivy.array([-2.25 + 4.75j, 3.25 + 5.75j]),
                        b=ivy.array([-2.25 + 4.75j, 3.25 + 5.75j]))
>>> x
{
    a: ivy.array([-2.25+4.75j, 3.25+5.75j]),
    b: ivy.array([-2.25+4.75j, 3.25+5.75j])
}
>>> x.angle()
{
    a: ivy.array([2.01317055, 1.05634501]),
    b: ivy.array([2.01317055, 1.05634501])
}
>>> ivy.set_backend('numpy')
>>> x.angle(deg=True)
{
    a: ivy.array([115.3461759, 60.524111]),
    b: ivy.array([115.3461759, 60.524111])
}
asin(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse sine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 0.5, 1.]),
...                   b=ivy.array([-4., 0.8, 2.]))
>>> y = x.asin()
>>> print(y)
{
    a: ivy.array([0., 0.524, 1.57]),
    b: ivy.array([nan, 0.927, nan])
}
>>> x = ivy.Container(a=ivy.array([12., 1.5, 0.]),
...                   b=ivy.array([-0.85, 0.6, 0.3]))
>>> y = ivy.Container(a=ivy.zeros(3), b=ivy.zeros(3))
>>> x.asin(out=y)
>>> print(y)
{
    a: ivy.array([nan, nan, 0.]),
    b: ivy.array([-1.02, 0.644, 0.305])
}
asinh(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic sine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([-1, 3.7, -5.1]),
...                   b=ivy.array([4.5, -2.4, -1.5]))
>>> y = x.asinh()
>>> print(y)
{
    a: ivy.array([-0.881, 2.02, -2.33]),
    b: ivy.array([2.21, -1.61, -1.19])
}
atan(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse tangent of each element in x. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -6]))
>>> y = x.atan()
>>> print(y)
{
    a: ivy.array([0., -0.785, 0.785]),
    b: ivy.array([0.785, 0., -1.41])
}
atan2(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – first input array or container corresponding to the y-coordinates. Should have a real-valued floating-point data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container corresponding to the x-coordinates. Must be compatible with self (see broadcasting). Should have a real-valued floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse tangent of the quotient self/x2. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0., 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -0]))
>>> y = ivy.array([3.0, 2.0, 1.0])
>>> x.atan2(y)
{
    a: ivy.array([0., 0.915, -1.29]),
    b: ivy.array([0.983, -1.21, 0.])
}
>>> x = ivy.Container(a=ivy.array([0., 2.6, -3.5]),
...                   b=ivy.array([4.5, -5.3, -0, -2.3]))
>>> y = ivy.Container(a=ivy.array([-2.5, 1.75, 3.5]),
...                   b=ivy.array([2.45, 6.35, 0, 1.5]))
>>> z = x.atan2(y)
>>> print(z)
{
    a: ivy.array([3.14, 0.978, -0.785]),
    b: ivy.array([1.07, -0.696, 0., -0.993])
}
atanh(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the inverse hyperbolic tangent of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([0, 0.5, -0.5]), b=ivy.array([0., 0.2, 0.9]))
>>> y = x.atanh()
>>> print(y)
{
    a: ivy.array([0., 0.549, -0.549]),
    b: ivy.array([0., 0.203, 1.47])
}
bitwise_and(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container Must be compatible with self (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([True, True]), b=ivy.array([False, True]))
>>> y = ivy.Container(a=ivy.array([False, True]), b=ivy.array([False, True]))
>>> x.bitwise_and(y, out=y)
>>> print(y)
{
    a: ivy.array([False, True]),
    b: ivy.array([False, True])
}
bitwise_invert(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned array must have the same data type as self.

Examples

>>> x = ivy.Container(a = ivy.array([False, True, False]),
...                   b = ivy.array([True, True, False]))
>>> y = x.bitwise_invert()
>>> print(y)
{
    a: ivy.array([True, False, True]),
    b: ivy.array([False, False, True])
}
>>> x = ivy.Container(a = ivy.array([1, 2, 3]),
...                   b = ivy.array([4, 5, 6]))
>>> y = x.bitwise_invert()
>>> print(y)
{
    a: ivy.array([-2, -3, -4]),
    b: ivy.array([-5, -6, -7])
}
bitwise_left_shift(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container Must be compatible with self (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

bitwise_or(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned array must have the same data type as self.

Examples

Using ivy.Container instance method:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),
...                   b=ivy.array([2, 3, 4]))
>>> y = ivy.Container(a=ivy.array([4, 5, 6]),
...                   b=ivy.array([5, 6, 7]))
>>> z = x.bitwise_or(y)
>>> print(z)
{
    a: ivy.array([5, 7, 7]),
    b: ivy.array([7, 7, 7])
}
bitwise_right_shift(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container Must be compatible with self (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

>>> a = ivy.Container(a = ivy.array([2, 3, 4]), b = ivy.array([5, 10, 64]))
>>> b = ivy.Container(a = ivy.array([0, 1, 2]), b = ivy.array([2]))
>>> y = a.bitwise_right_shift(b)
>>> print(y)
{
    a: ivy.array([2, 1, 1]),
    b: ivy.array([1, 2, 16])
}
bitwise_xor(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – first input array or container. Should have an integer or boolean data type.

  • x2 (Union[Container, Array, NativeArray]) – second input array or container Must be compatible with self (see broadcasting). Should have an integer or boolean data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

>>> x = ivy.Container(a = ivy.array([89]), b = ivy.array([3]))
>>> y = ivy.Container(a = ivy.array([12]), b = ivy.array([5]))
>>> z = x.bitwise_xor(y)
>>> print(z)
{
    a: ivy.array([85]),
    b: ivy.array([6])
}
ceil(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an container containing the rounded result for each element in self. The returned container must have the same data type as self.

Examples

>>> x = ivy.Container(a=ivy.array([2.5, 0.5, -1.4]),
...                   b=ivy.array([5.4, -3.2, 5.2]))
>>> y = x.ceil()
>>> print(y)
{
    a: ivy.array([3., 1., -1.]),
    b: ivy.array([6., -3., 6.])
}
cos(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container whose elements are each expressed in radians. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the cosine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0., -1, 1]), b=ivy.array([1., 0., -6]))
>>> y = x.cos()
>>> print(y)
{
    a: ivy.array([1., 0.54, 0.54]),
    b: ivy.array([0.54, 1., 0.96])
}
cosh(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container whose elements each represent a hyperbolic angle. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – an container containing the hyperbolic cosine of each element in self. The returned container must have a floating-point data type determined by type-promotion.

Examples

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([-1, 0.23, 1.12]), b=ivy.array([1, -2, 0.76]))
>>> y = x.cosh()
>>> print(y)
{
    a: ivy.array([1.54, 1.03, 1.7]),
    b: ivy.array([1.54, 3.76, 1.3])
}
>>> x = ivy.Container(a=ivy.array([-3, 0.34, 2.]),
...                   b=ivy.array([0.67, -0.98, -3]))
>>> y = ivy.Container(a=ivy.zeros(3), b=ivy.zeros(3))
>>> x.cosh(out=y)
>>> print(y)
{
    a: ivy.array([10.1, 1.06, 3.76]),
    b: ivy.array([1.23, 1.52, 10.1])
}
deg2rad(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. to be converted from degrees to radians.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container with each element in x converted from degrees to radians.

Examples

With ivy.Container input:

>>> x=ivy.Container(a=ivy.array([0., 0.351, -0.881, ivy.nan]),
...                 b=ivy.native_array([0,-1.5,-50,ivy.nan]))
>>> y=x.deg2rad()
>>> print(y)
{
    a: ivy.array([0., 0.00613, -0.0154, nan]),
    b: ivy.array([0., -0.0262, -0.873, nan])
}
divide(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – dividend input array or container. Should have a real-valued data type.

  • x2 (Union[Container, Array, NativeArray]) – divisor input array or container. Must be compatible with self (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([12., 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))
>>> x2 = ivy.Container(a=ivy.array([1., 2.3, 3]), b=ivy.array([2.4, 3., 2.]))
>>> y = x1.divide(x2)
>>> print(y)
{
    a: ivy.array([12., 1.52, 2.1]),
    b: ivy.array([1.25, 0.333, 0.45])
}

With Number instances at the leaves:

>>> x = ivy.Container(a=1, b=2)
>>> y = ivy.Container(a=5, b=4)
>>> z = x.divide(y)
>>> print(z)
{
    a: 0.2,
    b: 0.5
}
equal(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • x1 – input array or container. May have any data type.

  • x2 (Union[Container, Array, NativeArray]) – input array or container. Must be compatible with x1 (see broadcasting). May have any data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

  • ret – a container containing the element-wise results. The returned container must have a data type of bool.

  • With ivy.Container inputs

  • >>> x1 = ivy.Container(a=ivy.array([12, 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))

  • >>> x2 = ivy.Container(a=ivy.array([12, 2.3, 3]), b=ivy.array([2.4, 3., 2.]))

  • >>> y = x1.equal(x2)

  • >>> print(y)

  • { – a: ivy.array([True, False, False]), b: ivy.array([False, False, False])

  • }

  • With mixed ivy.Container and ivy.Array inputs

  • >>> x1 = ivy.Container(a=ivy.array([12., 3.5, 6.3]), b=ivy.array([3., 1., 0.9]))

  • >>> x2 = ivy.array([3., 1., 0.9])

  • >>> y = x1.equal(x2)

  • >>> print(y)

  • { – a: ivy.array([False, False, False]), b: ivy.array([True, True, True])

  • }

erf(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container to compute exponential for.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the Gauss error of self.

Examples

>>> x = ivy.Container(a=ivy.array([-0.25, 4, 1.3]),
...                   b=ivy.array([12, -3.5, 1.234]))
>>> y = x.erf()
>>> print(y)
{
    a: ivy.array([-0.27632612, 1., 0.934008]),
    b: ivy.array([1., -0.99999928, 0.91903949])
}
exp(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in self. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([1., 2., 3.]), b=ivy.array([4., 5., 6.]))
>>> y = x.exp()
>>> print(y)
{
    a: ivy.array([2.71828198, 7.38905573, 20.08553696]),
    b: ivy.array([54.59814835, 148.4131622, 403.428772])
}
exp2(*, out=None)[source]#

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

Parameters:
  • self (Container) – container with the base input arrays.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – Container including arrays with element-wise 2 to the power of input array elements.

Examples

>>> x = ivy.Container(a=ivy.array([1, 2, 3]),                               b=[5, 6, 7])
>>> x.exp2()
{
    a: ivy.array([2.,  4.,  8.])
    b: ivy.array([32., 64., 128.])
}
expm1(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a floating-point data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the evaluated result for each element in self. The returned array must have a real-valued floating-point data type determined by type-promotion.

Examples

>>> x = ivy.Container(a=ivy.array([2.5, 0.5]),
...                   b=ivy.array([5.4, -3.2]))
>>> y = x.expm1()
>>> print(y)
{
    a: ivy.array([11.2, 0.649]),
    b: ivy.array([220., -0.959])
}
>>> y = ivy.Container(a=ivy.array([0., 0.]))
>>> x = ivy.Container(a=ivy.array([4., -2.]))
>>> x.expm1(out=y)
>>> print(y)
{
    a: ivy.array([53.6, -0.865])
}
floor(*, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – input container. Should have a numeric data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the rounded result for each element in self. The returned array must have the same data type as self.

Examples

>>> x = ivy.Container(a=ivy.array([2.5, 0.5, -1.4]),
...                   b=ivy.array([5.4, -3.2, 5.2]))
>>> y = x.floor()
>>> print(y)
{
    a: ivy.array([2., 0., -2.]),
    b: ivy.array([5., -4., 5.])
}
floor_divide(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

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

Parameters:
  • self (Container) – dividend input array or container. Should have a real-valued data type.

  • x2 (Union[Container, Array, NativeArray]) – divisor input array or container. Must be compatible with x1 (see broadcasting). Should have a real-valued data type.

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

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the element-wise results. The returned container must have a data type determined by type-promotion.

Examples

With ivy.Container inputs:

>>> x1 = ivy.Container(a=ivy.array([4., 5., 6.]), b=ivy.array([7., 8., 9.]))
>>> x2 = ivy.Container(a=ivy.array([5., 4., 2.5]), b=ivy.array([2.3, 3.7, 5]))
>>> y = x1.floor_divide(x2)
>>> print(y)
{
    a: ivy.array([0., 1., 2.]),
    b: ivy.array([3., 2., 1.])
}

With mixed ivy.Container and ivy.Array inputs:

>>> x1 = ivy.Container(a=ivy.array([4., 5., 6.]), b=ivy.array([7., 8., 9.]))
>>> x2 = ivy.array([2, 3, 4])
>>> y = x1.floor_divide(x2)
>>> print(y)
{
    a: ivy.array([2., 1., 1.]),
    b: ivy.array([3., 2., 2.])
}
fmin(x2, /, *, out=None)[source]#

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

Parameters:
  • self (Container) – container with the first input arrays.

  • x2 (Container) – container with the second input arrays

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – Container including arrays with element-wise minimums.

Examples

>>> x1 = ivy.Container(a=ivy.array([2, 3, 4]),                               b=ivy.array([ivy.nan, 0, ivy.nan]))
>>> x2 = ivy.Container(a=ivy.array([1, 5, 2]),                               b=ivy.array([0, ivy.nan, ivy.nan]))
>>> x1.fmin(x2)
{
    a: ivy.array([1, 3, 2]),
    b: ivy.array([0., 0., nan])
}
gcd(x2, /, *, out=None)[source]#

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

Parameters:
  • self (Container) – first input container with array-like items.

  • x2 (Container) – second input container with array-like items.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – Container including arrays with element-wise gcd of input arrays.

Examples

>>> x1 = ivy.Container(a=ivy.array([1, 2, 3]),                               b=ivy.array([1, 2, 3]))
>>> x2 = ivy.Container(a=ivy.array([5, 6, 7]),                               b=10)
>>> x1.gcd(x2)
{
    a: ivy.array([1.,  1.,  3.])
    b: ivy.array([1., 2., 1.])
}
greater(x2, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False,