id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
148,189
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
Compute the (vector) dot product of two arrays. Parameters ---------- x1 first input array. Should have a numeric data type. x2 second input array. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a numeric data type. axis axis over which to compute the dot product. Must be an integer on the interv...
148,190
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
r"""Compute the vector norm of a vector (or batch of vectors) ``x``. Parameters ---------- x input array. Should have a floating-point data type. axis If an integer, ``axis`` specifies the axis (dimension) along which to compute vector norms. If an n-tuple, ``axis`` specifies the axes (dimensions) along which to comput...
148,191
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
Return the specified diagonals of the input array, or an array with the input array's elements as diagonals. Parameters ---------- x An array with rank >= 1. k An integer that controls which diagonal to consider. Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonal. ou...
148,192
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
Generate a Vandermonde matrix. The columns of the output matrix are elementwise powers of the input vector x^{(N-1)}, x^{(N-2)}, ..., x^0x. If increasing is True, the order of the columns is reversed x^0, x^1, ..., x^{(N-1)}. Such a matrix with a geometric progression in each row is named for Alexandre-Theophile Vander...
148,193
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
Given vector, return the associated `Skew-symmetric matrix <https://en.wikipedia.org/wiki/Skew-symmetric_matrix#Cross_product/>`_. Parameters ---------- vector Vector to convert *(batch_shape,3)*. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- re...
148,194
from typing import Union, Optional, Tuple, Literal, List, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, ...
null
148,195
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
null
148,196
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
null
148,197
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
null
148,198
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
null
148,199
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
null
148,200
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return evenly spaced values within a given interval, with the spacing being specified. Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns a...
148,201
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return a new array filled with ``fill_value`` and having the same ``shape`` as an input array ``x`` . Parameters ---------- x input array from which to derive the output array shape. fill_value Scalar fill value dtype output array data type. If ``dtype`` is `None`, the output array data type must be inferred from ``x``...
148,202
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return a new array filled with zeros and having the same ``shape`` as an input array ``x``. Parameters ---------- x input array from which to derive the output array shape. dtype output array data type. If ``dtype`` is ``None``, the output array data type must be inferred from ``x``. Default: ``None``. device device on...
148,203
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return the lower triangular part of a matrix (or a stack of matrices) ``x``. .. note:: The main diagonal is defined as the set of indices ``{(i, i)}`` for ``i`` on the interval ``[0, min(M, N) - 1]``. Parameters ---------- x input array having shape (..., M, N) and whose innermost two dimensions form MxN matrices. k di...
148,204
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return the upper triangular part of a matrix (or a stack of matrices) ``x``. .. note:: The upper triangular part of the matrix is defined as the elements on and above the specified diagonal ``k``. Parameters ---------- x input array having shape (..., M, N) and whose innermost two dimensions form MxN matrices. *, k dia...
148,205
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return an uninitialized array with the same shape as an input array x. Parameters ---------- x input array from which to derive the output array shape. dtype output array data type. If dtype is None, the output array data type must be inferred from x. Default: ``None``. device device on which to place the created array...
148,206
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return coordinate matrices from coordinate vectors. Parameters ---------- arrays an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type. sparse if True, a sparse grid is returned in order to conserve memory. Default: ``False``. indexing Cartesian `...
148,207
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return PyCapsule Object. Parameters ---------- x object input (array) object. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret Return PyCapsule Object. .. admonition:: Note :class: note The returned array may be either a copy or a view. See :re...
148,208
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return a new array containing the data from another (array) object with a ``__dlpack__`` method or PyCapsule Object. Parameters ---------- x object input (array) object with a ``__dlpack__`` method or PyCapsule Object. out optional output array, for writing the result to. It must have a shape that the inputs broadcast ...
148,209
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Copy an array. Parameters ---------- x array, input array containing elements to copy. to_ivy_array boolean, if True the returned array will be an ivy.Array object otherwise returns an ivy.NativeArray object (i.e. a torch.tensor, np.array, etc., depending on the backend), defaults to True. out optional output array, fo...
148,210
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Convert the input to a native array. Parameters ---------- x input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays. dtype datatype, optional. Datatype is inferred from the input data. device device on which to place the cr...
148,211
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return a one-hot array. The locations represented by indices in the parameter indices take value on_value, while all other locations take value off_value. Parameters ---------- indices Indices for where the ones should be scattered *[batch_shape, dim]* depth Scalar defining the depth of the one-hot dimension. on_value ...
148,212
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Generate a certain number of evenly-spaced values in log space, in an interval along a given axis. Parameters ---------- start First value in the range in log space. base ** start is the starting value in the sequence. Can be an array or a float. stop Last value in the range in log space. base ** stop is the final valu...
148,213
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
r"""Interpret a buffer as a 1-dimensional array. .. note:: Note that either of the following must be true: 1. count is a positive non-zero number, and the total number of bytes in the buffer is equal or greater than offset plus count times the size (in bytes) of dtype. 2. count is negative, and the length (number of by...
148,214
from __future__ import annotations import functools from numbers import Number from typing import ( Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable, ) import numpy as np import ivy from ivy import to_ivy from ivy.utils.exceptions import handle_exceptions...
Return the indices of the upper triangular part of a row by col matrix in a 2-by-N shape (tuple of two N dimensional arrays), where the first row contains row coordinates of all indices and the second row contains column coordinates. Indices are ordered based on rows and then columns. The upper triangular part of the m...
148,215
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Calculate the arithmetic mean of the input array ``x``. **Special Cases** Let ``N`` equal the number of elements over which to compute the arithmetic mean. - If ``N`` is ``0``, the arithmetic mean is ``NaN``. - If ``x_i`` is ``NaN``, the arithmetic mean is ``NaN`` (i.e., ``NaN`` values propagate). Parameters ----------...
148,216
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Calculate the product of input array x elements. **Special Cases** Let ``N`` equal the number of elements over which to compute the product. - If ``N`` is ``0``, the product is ``1`` (i.e., the empty product). For both both real-valued and complex floating-point operands, special cases must be handled as the operation ...
148,217
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Calculate the standard deviation of the input array ``x``. **Special Cases** Let ``N`` equal the number of elements over which to compute the standard deviation. - If ``N - correction`` is less than or equal to ``0``, the standard deviation is ``NaN``. - If ``x_i`` is ``NaN``, the standard deviation is ``NaN`` (i.e., `...
148,218
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Calculate the sum of the input array x. **Special Cases** Let ``N`` equal the number of elements over which to compute the sum. - If ``N`` is ``0``, the sum is ``0`` (i.e., the empty sum). For floating-point operands, - If ``x_i`` is ``NaN``, the sum is ``NaN`` (i.e., ``NaN`` values propagate). For both real-valued and...
148,219
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Calculate the variance of the input array x. **Special Cases** Let N equal the number of elements over which to compute the variance. If N - correction is less than or equal to 0, the variance is NaN. If x_i is NaN, the variance is NaN (i.e., NaN values propagate). Parameters ---------- x input array. Should have a flo...
148,220
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Return the cumulative sum of the elements along a given axis. Parameters ---------- x Input array. axis Axis along which the cumulative sum is computed. Default is ``0``. exclusive Whether to perform cumsum exclusively. Default is ``False``. reverse Whether to perform the cumsum from last to first element in the select...
148,221
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Return the cumulative product of the elements along a given axis. Parameters ---------- x Input array. axis int , axis along which the cumulative product is computed. By default 0. exclusive optional bool, Whether to perform the cumprod exclusively. Defaults is False. reverse Whether to perform the cumprod from last to...
148,222
from typing import Union, Optional, Sequence import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_inva...
Sum the product of the elements of the input operands along dimensions specified using a notation based on the Einstein summation convention. Parameters ---------- equation A str describing the contraction, in the same format as numpy.einsum. operands seq of arrays, the inputs to contract (each one an ivy.Array), whose...
148,223
from typing import Union, Optional, Sequence import ivy from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions import...
Test whether all input array elements evaluate to ``True`` along a specified axis. .. note:: Positive infinity, negative infinity, and NaN must evaluate to ``True``. .. note:: If ``x`` is an empty array or the size of the axis (dimension) along which to evaluate elements is zero, the test result must be ``True``. Param...
148,224
from typing import Union, Optional, Sequence import ivy from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions import...
Test whether any input array element evaluates to ``True`` along a specified axis. .. note:: Positive infinity, negative infinity, and NaN must evaluate to ``True``. .. note:: If ``x`` is an empty array or the size of the axis (dimension) along which to evaluate elements is zero, the test result must be ``False``. Para...
148,225
from typing import Union, Optional, Sequence import ivy from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions import...
null
148,226
from typing import Union, Optional, Sequence import ivy from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions import...
null
148,227
import ivy from typing import Optional, Union from ivy.func_wrapper import ( handle_array_function, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ) from ivy.utils.exceptions import handle_exceptions def _reduce_loss(red, loss, axis, out): if red == "sum": return...
Compute the binary cross entropy loss. Parameters ---------- true input array containing true labels. pred input array containing Predicted labels. from_logits Whether `pred` is expected to be a logits tensor. By default, we assume that `pred` encodes a probability distribution. epsilon a float in [0.0, 1.0] specifying...
148,228
import ivy from typing import Optional, Union from ivy.func_wrapper import ( handle_array_function, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ) from ivy.utils.exceptions import handle_exceptions def cross_entropy( true: Union[ivy.Array, ivy.NativeArray], pred: U...
Compute sparse cross entropy between logits and labels. Parameters ---------- true input array containing the true labels as logits. pred input array containing the predicted labels as logits. axis the axis along which to compute the cross-entropy. If axis is ``-1``, the cross-entropy will be computed along the last di...
148,229
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
null
148,230
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the Gaussian error linear unit (GELU) activation function. Parameters ---------- x Input array. approximate Whether to approximate, default is ``True``. An approximation is always used if the input array is complex. complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handl...
148,231
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
null
148,232
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the leaky rectified linear unit function element-wise. If the input is complex, then by default each element is scaled by `alpha` if either its real part is strictly negative or if its real part is zero and its imaginary part is negative. This behaviour can be changed by specifying a different `complex_mode`. Par...
148,233
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the log_softmax function element-wise. Parameters ---------- x Input array. axis The dimension log_softmax would be performed on. The default is ``None``. complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handle_complex_input`` for more detail. out optional output array,...
148,234
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
null
148,235
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the sigmoid function element-wise. Parameters ---------- x input array. complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handle_complex_input`` for more detail. out optional output array, for writing the result to. It must have a shape that the input broadcast to. defau...
148,236
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the softmax function element-wise. Parameters ---------- x Input array. axis The dimension softmax would be performed on. The default is ``None``. complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handle_complex_input`` for more detail. out optional output array, for wri...
148,237
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
null
148,238
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the softplus function element-wise. If the input is complex, then by default we apply the softplus operation `log(1+ exp(x))` to each element If threshold is set we check if either its real part is strictly negative or if its real part is zero and its imaginary part is negative then we apply `input×β > threshold`...
148,239
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the softsign function element-wise. Parameters ---------- x Input array. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret The input array with softsign applied element-wise. Examples -------- With :class:`ivy.Array` input: >>> x = ivy.arr...
148,240
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the mish activation function element-wise. Parameters ---------- x input array complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handle_complex_input`` for more detail. out optional output array, for writing the result to. It must have a shape that the inputs broadcast t...
148,241
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
null
148,242
from typing import Union, Optional, Callable, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_com...
Apply the hardswish activation function element-wise. Parameters ---------- x input array complex_mode optional specifier for how to handle complex data types. See ``ivy.func_wrapper.handle_complex_input`` for more detail. out optional output array, for writing the result to. It must have a shape that the inputs broadc...
148,243
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Reverses the order of elements in an array along the given axis. The shape of the array must be preserved. Parameters ---------- x input array. copy boolean indicating whether or not to copy the input array. If True, the function must always copy. If False, the function must never copy. In case copy is False we avoid c...
148,244
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Roll array elements along a specified axis. Array elements that roll beyond the last position are re-introduced at the first position. Array elements that roll beyond the first position are re-introduced at the last position. Parameters ---------- x input array. shift number of places by which the elements are shifted....
148,245
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Join a sequence of arrays along a new axis. Parameters ---------- arrays input arrays to join. Each array must have the same shape. axis axis along which the arrays will be joined. Providing an axis specifies the index of the new axis in the dimensions of the result. For example, if axis is 0, the new axis will be the ...
148,246
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Clips (limits) the values in an array. Given an interval, values outside the interval are clipped to the interval edges (element-wise). For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1. Minimum value needs to smaller or equal to maximum value to retur...
148,247
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Split an array into multiple sub-arrays. Parameters ---------- x array to be divided into sub-arrays. copy boolean indicating whether or not to copy the input array. If True, the function must always copy. If False, the function must never copy. In case copy is False we avoid copying by returning a view of the input ar...
148,248
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Interchange two axes of an array. Parameters ---------- x Input array. axis0 First axis to be swapped. axis1 Second axis to be swapped. copy boolean indicating whether or not to copy the input array. If True, the function must always copy. If False, the function must never copy. In case copy is False we avoid copying b...
148,249
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Construct an array by repeating x the number of times given by reps. Parameters ---------- x Input array. repeats The number of repetitions of x along each axis. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret The tiled output array. Examples ...
148,250
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Unpacks the given dimension of a rank-R array into rank-(R-1) arrays. Parameters ---------- x Input array to unstack. copy boolean indicating whether or not to copy the input array. If True, the function must always copy. If False, the function must never copy. In case copy is False we avoid copying by returning a view...
148,251
from typing import Union, Optional, Tuple, List, Iterable, Sequence from numbers import Number from numpy.core.numeric import normalize_axis_tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function, to_native_arrays_and_back, handle_out_argument, ...
Pad an array with zeros. Parameters ---------- x Input array to pad. pad_width Number of values padded to the edges of each axis. Specified as ((before_1, after_1), … (before_N, after_N)), where N is number of axes of x. out optional output array, for writing the result to. It must have a shape that the inputs broadcas...
148,252
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate the absolute value for each element ``x_i`` of the input array ``x`` (i.e., the element-wise result has the same magnitude as the respective element in ``x`` but has positive sign). .. note:: For signed integer data types, the absolute value of the minimum representable integer is implementation-dependent. **...
148,253
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation of the principal value of the inverse cosine, having domain [-1, +1] and codomain [+0, +π], for each element x_i of the input array x. Each element-wise result is expressed in radians. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, the result ...
148,254
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the inverse hyperbolic cosine, having domain ``[+1, +infinity]`` and codomain ``[+0, +infinity]``, for each element ``x_i`` of the input array ``x``. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, the result is ``NaN``. - If ``x_i`` is less...
148,255
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate the sum for each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``. **Special cases** For floating-point operands, - If either ``x1_i`` or ``x2_i`` is ``NaN``, the result is ``NaN``. - If ``x1_i`` is ``+infinity`` and ``x2_i`` is ``-infinity``, the resul...
148,256
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation of the principal value of the inverse sine, having domain ``[-1, +1]`` and codomain ``[-π/2, +π/2]`` for each element ``x_i`` of the input array ``x``. Each element- wise result is expressed in radians. **Special cases** For floating-point operands, - If ``x_i`` is ``...
148,257
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the inverse hyperbolic sine, having domain ``[-infinity, +infinity]`` and codomain ``[-infinity, +infinity]``, for each element ``x_i`` in the input array ``x``. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, the result is ``NaN``. - If ``x...
148,258
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation of the principal value of the inverse tangent, having domain ``[-infinity, +infinity]`` and codomain ``[-π/2, +π/2]``, for each element ``x_i`` of the input array ``x``. Each element-wise result is expressed in radians. **Special cases** For floating-point operands, -...
148,259
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation of the inverse tangent of the quotient ``x1/x2``, having domain ``[-infinity, +infinity] x. [-infinity, +infinity]`` (where the ``x`` notation denotes the set of ordered pairs of elements ``(x1_i, x2_i)``) and codomain ``[-π, +π]``, for each pair of elements ``(x1_i, ...
148,260
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Return a new array with the inverse hyperbolic tangent of the elements of ``x``. Parameters ---------- x input array whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type. out optional output array, for writing the result to. It must have a shape that the inputs broadcast...
148,261
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the bitwise AND of the underlying binary representation of each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``. Parameters ---------- x1 first input array. Should have an integer or boolean data type. x2 second input array. Must be compatible with ``x1`...
148,262
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Inverts (flips) each bit for each element ``x_i`` of the input array ``x``. Parameters ---------- x input array. Should have an integer or boolean data type. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret an array containing the element-wise ...
148,263
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Shifts the bits of each element ``x1_i`` of the input array ``x1`` to the left by appending ``x2_i`` (i.e., the respective element in the input array ``x2``) zeros to the right of ``x1_i``. Parameters ---------- x1 first input array. Should have an integer data type. x2 second input array. Must be compatible with ``x1`...
148,264
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the bitwise OR of the underlying binary representation of each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``. Parameters ---------- x1 first input array. Should have an integer or boolean data type. x2 second input array. Must be compatible with ``x1``...
148,265
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Shifts the bits of each element ``x1_i`` of the input array ``x1`` to the right according to the respective element ``x2_i`` of the input array ``x2``. .. note:: This operation must be an arithmetic shift (i.e., sign-propagating) and thus equivalent to floor division by a power of two. Parameters ---------- x1 first in...
148,266
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the bitwise XOR of the underlying binary representation of each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``. Parameters ---------- x1 first input array. Should have an integer or boolean data type. x2 second input array. Must be compatible with ``x1`...
148,267
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Round each element ``x_i`` of the input array ``x`` to the smallest (i.e., closest to ``-infinity``) integer-valued number that is not less than ``x_i``. **Special cases** - If ``x_i`` is already integer-valued, the result is ``x_i``. For floating-point operands, - If ``x_i`` is ``+infinity``, the result is ``+infinity...
148,268
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the cosine, having domain ``(-infinity, +infinity)`` and codomain ``[-1, +1]``, for each element ``x_i`` of the input array ``x``. Each element ``x_i`` is assumed to be expressed in radians. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, th...
148,269
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the hyperbolic cosine, having domain ``[-infinity, +infinity]`` and codomain ``[-infinity, +infinity]``, for each element ``x_i`` in the input array ``x``. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, the result is ``NaN``. - If ``x_i`` i...
148,270
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the truth value of x1_i == x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. Parameters ---------- x1 first input array. May have any data type. x2 second input array. Must be compatible with x1 (with Broadcasting). May have any data type. out optional outp...
148,271
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the exponential function, having domain ``[-infinity, +infinity]`` and codomain ``[+0, +infinity]``, for each element ``x_i`` of the input array ``x`` (``e`` raised to the power of ``x_i``, where ``e`` is the base of the natural logarithm). .. note:: For complex fl...
148,272
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Return the imaginary part of a complex number for each element ``x_i`` of the input array ``val``. Parameters ---------- val input array. Should have a complex floating-point data type. out optional output array, for writing the result to. Returns ------- ret Returns an array with the imaginary part of complex numbers....
148,273
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate Element-wise the angle for an array of complex numbers(x+yj). Parameters ---------- z Array-like input. deg optional bool. out optional output array, for writing the result to. Returns ------- ret Returns an array of angles for each complex number in the input. If deg is False(default), angle is calculated in...
148,274
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Return the greatest common divisor of |x1| and |x2|. Parameters ---------- x1 First array-like input. x2 Second array-input. out optional output array, for writing the result to. Returns ------- ret Element-wise gcd of |x1| and |x2|. Examples -------- >>> x1 = ivy.array([1, 2, 3]) >>> x2 = ivy.array([4, 5, 6]) >>> ivy....
148,275
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate 2**p for all p in the input array. Parameters ---------- x Array-like input. out optional output array, for writing the result to. Returns ------- ret Element-wise 2 to the power x. This is a scalar if x is a scalar. Examples -------- >>> x = ivy.array([1, 2, 3]) >>> ivy.exp2(x) ivy.array([2., 4., 8.]) >>> x ...
148,276
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to ``exp(x)-1``, having domain ``[-infinity, +infinity]`` and codomain ``[-1, +infinity]``, for each element ``x_i`` of the input array ``x``. .. note:: The purpose of this function is to calculate ``exp(x)-1.0`` more accurately when ``x`` is close to zero. Accordingl...
148,277
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Round each element ``x_i`` of the input array ``x`` to the greatest (i.e., closest to ``+infinity``) integer-valued number that is not greater than ``x_i``. **Special cases** - If ``x_i`` is already integer-valued, the result is ``x_i``. For floating-point operands, - If ``x_i`` is ``+infinity``, the result is ``+infin...
148,278
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
r"""Round the result of dividing each element x1_i of the input array x1 by the respective element x2_i of the input array x2 to the greatest (i.e., closest to +infinity) integer-value number that is not greater than the division result. .. note:: For input arrays which promote to an integer data type, the result of di...
148,279
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the element-wise minimums of two arrays. Differs from ivy.minimum in the case where one of the elements is NaN. ivy.minimum returns the NaN element while ivy.fmin returns the non-NaN element. Parameters ---------- x1 First input array. x2 Second input array. out optional output array, for writing the result to....
148,280
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the truth value of x1_i < x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. Parameters ---------- x1 Input array. x2 Input array. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret an...
148,281
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the truth value of x1_i >= x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. Parameters ---------- x1 first input array. May have any data type. x2 second input array. Must be compatible with x1 (with Broadcasting). May have any data type. out optional outp...
148,282
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the truth value of x1_i <= x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. Parameters ---------- x1 first input array. May have any data type. x2 second input array. Must be compatible with x1 (with Broadcasting). May have any data type. out optional outp...
148,283
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
r"""Calculate the product for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. .. note:: Floating-point multiplication is not always associative due to finite precision. **Special Cases** For real-valued floating-point operands, - If either ``x1_i`` or ``x2_i`` is ``NaN``,...
148,284
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Test each element ``x_i`` of the input array ``x`` to determine if finite (i.e., not ``NaN`` and not equal to positive or negative infinity). Parameters ---------- x input array. Should have a numeric data type. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Ret...
148,285
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Test each element x_i of the input array x to determine if equal to positive or negative infinity. Parameters ---------- x input array. Should have a numeric data type. detect_positive if ``True``, positive infinity is detected. detect_negative if ``True``, negative infinity is detected. out optional output array, for ...
148,286
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Test each element ``x_i`` of the input array ``x`` to determine whether the element is ``NaN``. Parameters ---------- x input array. Should have a numeric data type. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret an array containing test resu...
148,287
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Compute the truth value of ``x1_i < x2_i`` for each element ``x1_i`` of the input array ``x1`` with the respective element ``x2_i`` of the input array ``x2``. Parameters ---------- x1 first input array. Should have a numeric data type. x2 second input array. Must be compatible with ``x1`` (see ref:`broadcasting`). Shou...
148,288
from numbers import Number from typing import Optional, Union, Literal import ivy from ivy.func_wrapper import ( handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_device, handle_comple...
Calculate an implementation-dependent approximation to the natural (base ``e``) logarithm, having domain ``[0, +infinity]`` and codomain ``[-infinity, +infinity]``, for each element ``x_i`` of the input array ``x``. **Special cases** For floating-point operands, - If ``x_i`` is ``NaN``, the result is ``NaN``. - If ``x_...