id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
148,389
import ast import logging import inspect import math import functools from numbers import Number from typing import Union, Tuple, List, Optional, Callable, Iterable, Any import numpy as np import importlib import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function,...
Reset the current default uint dtype to the previous state. Examples -------- >>> ivy.set_default_uint_dtype(ivy.UintDtype("uint8")) >>> ivy.default_uint_dtype() 'uint8' >>> ivy.unset_default_uint_dtype() >>> ivy.default_uint_dtype() 'uint32'
148,390
import ast import logging import inspect import math import functools from numbers import Number from typing import Union, Tuple, List, Optional, Callable, Iterable, Any import numpy as np import importlib import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function,...
Reset the current default complex dtype to the previous state. Examples -------- >>> ivy.set_default_complex_dtype(ivy.complex64) >>> ivy.set_default_complex_dtype(ivy.complex128) >>> ivy.default_complex_dtype_stack ['complex64','complex128'] >>> ivy.unset_default_complex_dtype() >>> ivy.default_complex_dtype_stack ['c...
148,391
import ast import logging import inspect import math import functools from numbers import Number from typing import Union, Tuple, List, Optional, Callable, Iterable, Any import numpy as np import importlib import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function,...
Determine whether the provided data type is supported by the current framework. Parameters ---------- dtype_in The data type for which to check for backend support Returns ------- ret Boolean, whether or not the data-type string is supported. Examples -------- >>> print(ivy.valid_dtype(None)) True >>> print(ivy.valid_d...
148,392
import ast import logging import inspect import math import functools from numbers import Number from typing import Union, Tuple, List, Optional, Callable, Iterable, Any import numpy as np import importlib import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_array_function,...
Determine whether the input dtype is a Native dtype. Parameters ---------- dtype_in Determine whether the input data type is a native data type object. Returns ------- ret Boolean, whether or not dtype_in is a native data type. Examples -------- >>> ivy.set_backend('numpy') >>> ivy.is_native_dtype(np.int32) True >>> iv...
148,393
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of whether to use a promotion table that avoids any precision loss or a compute efficient table that avoids most wider-than- necessary promotions. Parameter --------- mode boolean whether to use high precision promotion table Examples -------- >>> ivy.set_precise_mode(False) >>> ivy.precise_mode False >>> ...
148,394
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the mode of whether to use a promotion table that avoids any precision loss or a compute efficient table that avoids most wider-than- necessary promotions. Examples -------- >>> ivy.set_precise_mode(False) >>> ivy.precise_mode False >>> ivy.unset_precise_mode() >>> ivy.precise_mode True
148,395
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Recursively retrieve referrers for an object. This function recursively fetches referrers for the specified `item` up to a given `max_depth`. Parameters ---------- item The object for which referrers should be retrieved. depth Current depth in the recursion. (default is 0) max_depth Maximum depth of recursion. If `None...
148,396
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Determine whether the input x is an Ivy Container. Parameters ---------- x The input to check Returns ------- ret Boolean, whether or not x is an ivy container. Examples -------- >>> x = ivy.Container() >>> print(ivy.is_ivy_container(x)) True >>> x = [2, 3] >>> print(ivy.is_ivy_container(x)) False
148,397
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of whether to convert inputs to ivy.NativeArray, then convert outputs back to ivy.Array. It Stops the conversion of ivy.NativeArray to ivy.Array in the case when it is set to False. Parameter --------- mode boolean whether to perform ivy.Array conversions Examples -------- >>> ivy.set_array_mode(False) >>>...
148,398
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the mode of converting inputs to ivy.NativeArray, then converting outputs back to ivy.Array to the previous state. Examples -------- >>> ivy.set_array_mode(False) >>> ivy.array_mode False >>> ivy.unset_shape_array_mode() >>> ivy.array_mode True
148,399
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of whether to check if function inputs are ivy.Container. Parameter --------- mode boolean whether to check if function inputs are ivy.Container Examples -------- >>> ivy.set_nestable_mode(False) >>> ivy.nestable_mode False >>> ivy.set_nestable_mode(True) >>> ivy.nestable_mode True
148,400
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the mode of whether to check if function inputs are ivy.Container to the previous state. Examples -------- >>> ivy.set_nestable_mode(False) >>> ivy.nestable_mode False >>> ivy.unset_nestable_mode() >>> ivy.nestable_mode True
148,401
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of whether to show frontend-truncated exception stack traces, ivy- truncated exception stack traces or full exception stack traces. Parameter --------- mode str exception trace mode, one of `ivy`, `full` or `frontend` Examples -------- >>> ivy.set_exception_trace_mode("ivy") >>> ivy.exception_trace_mode 'i...
148,402
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the trace mode to the previously set mode. Examples -------- >>> ivy.set_exception_trace_mode("ivy") >>> ivy.exception_trace_mode 'ivy' >>> ivy.unset_exception_trace_mode() >>> ivy.exception_trace_mode 'full'
148,403
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of whether to show the full stack trace with function wrapping traces. Parameter --------- mode boolean whether to perform ivy.Array conversions Examples -------- >>> ivy.set_show_func_wrapper_trace_mode(False) >>> ivy.show_func_wrapper_trace_mode False >>> ivy.set_show_func_wrapper_trace_mode(True) >>> iv...
148,404
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the mode of whether to show the full stack trace with function wrapping traces. Examples -------- >>> ivy.set_show_func_wrapper_trace_mode(False) >>> ivy.show_func_wrapper_trace_mode False >>> ivy.unset_show_func_wrapper_trace_mode() >>> ivy.show_func_wrapper_trace_mode True
148,405
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Determine whether the inputs are all equal. Parameters ---------- xs inputs to compare. equality_matrix Whether to return a matrix of equalities comparing each input with every other. Default is ``False``. Returns ------- ret Boolean, whether or not the inputs are equal, or matrix array of booleans if equality_matrix=T...
148,406
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Create a (possibly nested) list from input array. Parameters ---------- x Input array. Returns ------- ret A list representation of the input array ``x``. Examples -------- With :class:`ivy.Array` input: >>> x = ivy.array([-1, 0, 1]) >>> y = ivy.to_list(x) >>> print(y) [-1, 0, 1] >>> x = ivy.array([[ 1.1, 2.2, 3.3], .....
148,407
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Clips (limits) the vector p-norm of an array. Parameters ---------- x Input array containing elements to clip. max_norm The maximum value of the array norm. p The p-value for computing the p-norm. Default is 2. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Retu...
148,408
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Clips (limits) the matrix norm of an array. Parameters ---------- x Input array containing elements to clip. max_norm The maximum value of the array norm. p The p-value for computing the p-norm. Default is 2. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Return...
148,409
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Pad an array with fourier encodings. Parameters ---------- x Input array to encode. max_freq The maximum frequency of the encoding. num_bands The number of frequency bands for the encoding. Default is 4. linear Whether to space the frequency bands linearly as opposed to geometrically. Default is ``False``. concat Wheth...
148,410
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Determine whether the array contains any nans, as well as infs or -infs if specified. Parameters ---------- x Input array. include_infs Whether to include ``+infinity`` and ``-infinity`` in the check. Default is ``True``. Returns ------- ret Boolean as to whether the array contains nans. Both the description and the ty...
148,411
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the input shape in ivy.Shape form. Parameters ---------- shape The input to be converted Returns ------- ret the input in ivy.Shape form
148,412
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the input shape in its native backend framework form. Parameters ---------- shape The input to be converted Returns ------- ret the input in its native framework form
148,413
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Try and return the function, otherwise return None if an exception was raised during function execution. Parameters ---------- fn Function to try and call and return. args list of arguments. kwargs dictionary of keyword arguments Returns ------- Either the function itself or None if an exception was raised during funct...
148,414
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Match keyword arguments to either class or function receivers. Parameters ---------- kwargs Keyword arguments to match. receivers Functions and/or classes to match the keyword arguments to. allow_duplicates Whether to allow one keyword argument to be used for multiple receivers. Default is ``False``. Returns ------- re...
148,415
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Cache function outputs. A decorator to wrap a function, such that computed outputs are cached to avoid recalculating them later. Parameters ---------- func The function to wrap, whose output should be cached for later. Returns ------- ret The newly cache wrapped function. Examples -------- With positional arguments onl...
148,416
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Perform einops rearrange operation on input array x. Parameters ---------- x Input array to be re-arranged. pattern Rearrangement pattern. axes_lengths Any additional specifications for dimensions. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- r...
148,417
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Perform einops reduce operation on input array x. Parameters ---------- x Input array to be reduced. pattern Reduction pattern. reduction One of available reductions ('min', 'max', 'sum', 'mean', 'prod'), or callable. axes_lengths Any additional specifications for dimensions. out optional output array, for writing the ...
148,418
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Perform einops repeat operation on input array x. Parameters ---------- x Input array to be repeated. pattern Rearrangement pattern. axes_lengths Any additional specifications for dimensions. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret New...
148,419
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the global minimum denominator used by ivy for numerically stable division. Parameters ---------- val The value to set the global minimum denominator to. Examples -------- >>> x = ivy.min_denominator >>> print(x) 1e-12 >>> ivy.set_min_denominator(1e-13) >>> y = ivy.min_denominator >>> print(y) 1e-13
148,420
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the global minimum denominator used by ivy for numerically stable division to the previous value. Examples -------- >>> ivy.set_min_denominator(1e-10) >>> y = ivy.min_denominator >>> print(y) 1e-10 >>> ivy.unset_min_denominator() >>> ivy.min_denominator 1e-12
148,421
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the global minimum base used by ivy for numerically stable power raising. Parameters ---------- val The new value to set the minimum base to. Examples -------- Retrieve the minimum base >>> x = ivy.min_base >>> print(x) 1e-05 >>> # Set the minimum base to 1e-04: >>> ivy.set_min_base(1e-04) Retrieve the minimum base...
148,422
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the global minimum base used by ivy for numerically stable power raising to the previous value. Examples -------- >>> ivy.set_min_base(1e-07) >>> y = ivy.min_base >>> print(y) 1e-07 >>> ivy.unset_min_base() >>> ivy.min_base 1e-05
148,423
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Raise the base by the power, with ivy.min_base added to the base when exponent > 1 for numerical stability. Parameters ---------- base The base number. exponent The exponent number. min_base The minimum base to use, use global ivy.min_base by default. Returns ------- ret The new item following the numerically stable po...
148,424
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the number of arrays which are currently alive. Returns ------- ret Number of all arrays which are alive. Examples -------- >>> ivy.num_arrays_in_memory() 0 >>> x = ivy.num_arrays_in_memory() >>> x 0 >>> y = ivy.array([0, 1, 2]) >>> x 1
148,425
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Print all native Ivy arrays in memory to the console. Gets all the native Ivy arrays which are currently alive(in the garbage collector) from get_all_arrays_in_memory() function and prints them to the console.
148,426
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set a timeout value (in seconds) for the global queue. Set the global queue timeout value (in seconds) Default value without this function being called is 15 seconds. Parameters ---------- timeout The timeout when waiting for containers to arrive from the queues. To be set in seconds. Examples -------- >>> x = ivy.set_...
148,427
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the global queue timeout value (in seconds) to the previous state. Examples -------- >>> ivy.set_queue_timeout(10.0) >>> y = ivy.queue_timeout >>> print(y) 10.0 >>> ivy.unset_queue_timeout() >>> ivy.queue_timeout 15.0
148,428
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the directory for saving temporary files. Parameters ---------- tmp_dr The new directory for saving temporary files Examples -------- >>> x = ivy.tmp_dir >>> print(x) /tmp >>> ivy.set_tmp_dir("/my_tmp") >>> y = ivy.tmp_dir >>> print(y) /my_tmp >>> # Unset the tmp_dr >>> ivy.unset_tmp_dir()
148,429
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the directory for saving temporary files to the previous value. Examples -------- >>> ivy.set_tmp_dir("/my_dir") >>> y = ivy.tmp_dir >>> print(y) /my_dir >>> ivy.unset_tmp_dir() >>> ivy.tmp_dir /tmp
148,430
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Summary. Returns ------- ret a key-value structure, and exposes public methods .keys(), .values() and items().
148,431
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Assert that inplace operations are supported for x. Parameters ---------- x Input variable or array to check for inplace support for. Returns ------- ret True if supports, raises IvyBackendException otherwise This function is *nestable*, and therefore also accepts :code:'ivy.Container' instance in place of the argument...
148,432
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Gather slices from x according to query array, identical to x[query]. Parameters ---------- x array, the array from which to gather values. query array, index array, integer indices or boolean mask. copy boolean indicating whether or not to copy the input array. If True, the function must always copy. If False, the fun...
148,433
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Replace slices of x (defined by query) with val, identical to x[query] = val. Parameters ---------- x the array to be updated. query either an index array, or a tuple of integers or slices. val the array containing the values to be infused into x copy boolean indicating whether to copy x. If True, the function will upd...
148,434
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the memory management behavior for in-place updates in Ivy. By default, Ivy creates new arrays in the backend for in-place updates. However, this behavior can be controlled by the user using the 'inplace_mode' parameter. Parameters ---------- mode : str The mode for memory management during in-place updates. - 'len...
148,435
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the memory management behavior for in-place updates in Ivy to the previous state. Examples -------- >>> set_inplace_mode('strict') >>> ivy.inplace_mode 'strict' >>> unset_inplace_mode() >>> ivy.inplace_mode 'lenient'
148,436
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Perform in-place decrement for the input array. Parameters ---------- x The input array to be decremented by the defined value. val The value of decrement. Returns ------- ret The array following the in-place decrement. Both the description and the type hints above assumes an array input for simplicity, but this functi...
148,437
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Perform in-place increment for the input array. Parameters ---------- x The input array to be incremented by the defined value. val The value of increment. Returns ------- ret The array following the in-place increment. Examples -------- With :class:`ivy.Array` input: >>> x = ivy.array([[5.3, 7., 0.],[6.8, 8, 3.9],[0.,...
148,438
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return backend-specific multiprocessing module. Parameters ---------- context The context of the multiprocessing, either 'fork', 'forkserver' or 'spawn'. Default is ``None``. Returns ------- ret Multiprocessing module Examples -------- >>> import ivy Using the default context (None): >>> mp_default = ivy.multiprocessin...
148,439
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Set the mode of returning shape as ivy.Array to the given mode instance. Parameter --------- mode boolean whether to return shape as ivy.Array Examples -------- >>> ivy.set_shape_array_mode(False) >>> ivy.shape_array_mode False >>> ivy.set_shape_array_mode(True) >>> ivy.shape_array_mode True
148,440
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Reset the mode of returning shape as ivy.Array to the previous state. Examples -------- >>> ivy.set_shape_array_mode(True) >>> ivy.shape_array_mode True >>> ivy.unset_shape_array_mode() >>> ivy.shape_array_mode False
148,441
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the index and `inspect.Parameter` representation of the specified argument. In the form of a dict with keys "idx" and "param". Parameters ---------- fn The function to retrieve the argument information for name The name of the argument idx the index of the argument in the inputs Returns ------- ret a `dict` cont...
148,442
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the supported combination of devices and dtypes of the current backend's function. The function returns a dict containing the supported combination of devices and dtypes of the primary and compositional implementations in case of partial mixed functions. Parameters ---------- fn The function to check for the sup...
148,443
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the unsupported combination of devices and dtypes of the current backend's function. The function returns a dict containing the unsupported combination of devices and dtypes of the primary and compositional implementations in case of partial mixed functions. Parameters ---------- fn The function to check for the...
148,444
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Test if each element of elements is in test_elements. Parameters ---------- elements input array test_elements values against which to test for each input element assume_unique If True, assumes both elements and test_elements contain unique elements, which can speed up the calculation. Default value is False. invert If...
148,445
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Return the input array's strides across each dimension. Parameters ---------- x The input array. Returns ------- ret A tuple containing the strides. Examples -------- >>> x = ivy.array([[1, 5, 9], [2, 6, 10]]) >>> ivy.strides(x) (4, 8)
148,446
import gc import inspect import itertools import math from functools import wraps from numbers import Number from typing import ( Callable, Any, Union, List, Tuple, Dict, Iterable, Optional, Sequence, Literal, ) import einops import ml_dtypes import numpy as np import ivy from i...
Determine whether the input x is an Ivy Nested Array. Parameters ---------- x The input to check Returns ------- ret Boolean, whether or not x is an ivy nested array.
148,447
import ivy from ivy.func_wrapper import handle_array_function from ivy.functional.ivy.gradients import gradient_descent_update from ivy.utils.exceptions import handle_exceptions from typing import Optional, Union, Callable, Tuple, Any def _train_tasks( batch, inner_batch_fn, outer_batch_fn, inner_cost_f...
Perform step of first order MAML. Parameters ---------- batch The input batch inner_cost_fn callable for the inner loop cost function, receiving sub-batch, inner vars and outer vars outer_cost_fn callable for the outer loop cost function, receiving task-specific sub-batch, inner vars and outer vars. If None, the cost f...
148,448
import ivy from ivy.func_wrapper import handle_array_function from ivy.functional.ivy.gradients import gradient_descent_update from ivy.utils.exceptions import handle_exceptions from typing import Optional, Union, Callable, Tuple, Any def _train_tasks( batch, inner_batch_fn, outer_batch_fn, inner_cost_f...
Perform a step of Reptile. Parameters ---------- batch The input batch. cost_fn The cost function that receives the task-specific sub-batch and variables, and returns the cost. variables Variables to be optimized. inner_grad_steps Number of gradient steps to perform during the inner loop. inner_learning_rate The learni...
148,449
import ivy from ivy.func_wrapper import handle_array_function from ivy.functional.ivy.gradients import gradient_descent_update from ivy.utils.exceptions import handle_exceptions from typing import Optional, Union, Callable, Tuple, Any def _train_tasks( batch, inner_batch_fn, outer_batch_fn, inner_cost_f...
Perform step of vanilla second order MAML. Parameters ---------- batch The input batch inner_cost_fn callable for the inner loop cost function, receiving sub-batch, inner vars and outer vars outer_cost_fn callable for the outer loop cost function, receiving task-specific sub-batch, inner vars and outer vars. If None, t...
148,450
from ivy.utils.backend import current_backend The provided code snippet includes necessary dependencies for implementing the `bind_custom_gradient_function` function. Write a Python function `def bind_custom_gradient_function(func, custom_grad_func)` to solve the following problem: Bind a custom gradient function to a...
Bind a custom gradient function to a function. Parameters ---------- func Function for which we compute the gradients of the output with respect to. custom_grad_func Custom gradient function. Should accept a tuple containing the (output, inputs) and the upstream gradients w.r.t previous operations. Returns ------- ret ...
148,451
from ivy.utils.backend import current_backend The provided code snippet includes necessary dependencies for implementing the `vjp` function. Write a Python function `def vjp(func, *primals)` to solve the following problem: Compute a (reverse-mode) vector-Jacobian product of `func`. Parameters ---------- func : callabl...
Compute a (reverse-mode) vector-Jacobian product of `func`. Parameters ---------- func : callable Function to be differentiated. primals sequence of primal values at which the Jacobian of `func` should be evaluated. Returns ------- ret The output of `func` evaluated at `primals`. And a function from a cotangent vector ...
148,452
from ivy.utils.backend import current_backend The provided code snippet includes necessary dependencies for implementing the `jvp` function. Write a Python function `def jvp(func, primals, tangents)` to solve the following problem: Compute a (forward-mode) Jacobian-vector product of `func`. Parameters ---------- func ...
Compute a (forward-mode) Jacobian-vector product of `func`. Parameters ---------- func : callable Function to be differentiated. primals sequence of primal values at which the Jacobian of `func` should be evaluated. tangents sequence of tangent vectors giving the Jacobian-vector product of `func` evaluated at `primals`...
148,453
from typing import Union, Optional import ivy from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_device, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions The provided code snippet includes necessary dependencies for imp...
Compute the inverse of an index permutation. Parameters ---------- x 1-D integer array-like, which represents indices of a zero-based array and is supposedly used to permute the array. Returns ------- ret the inverse of the index permutation represented by ''x'' Examples -------- >>> a = ivy.asarray([0, 3, 1, 2]) >>> i...
148,454
from typing import Union, Optional import ivy from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_device, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions The provided code snippet includes necessary dependencies for imp...
Perform an indirect stable sort with an array of keys in ascending order, with the last key used as primary sort order, second-to-last for secondary, and so on. Each row of the key must have the same length, which will also be the length of the returned array of integer indices, which describes the sort order. Paramete...
148,455
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Normalize the input array along the given axis to have L1 norm equal to 1. Parameters ---------- x Input array. axis Axis or axes along which to normalize. If ``None``, the whole array is normalized. out Optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns -------...
148,456
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Normalize the input array along the given axis to have L2 norm equal to 1. Parameters ---------- x Input array. axis Axis along which to normalize. If ``None``, the whole array is normalized. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret The...
148,457
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Apply local response normalization across the channels of a 4D input array. The 4-D array is treated as a 3-D array of 1-D vectors (along the channel dimension), and each vector is normalized independently. Within a given vector, each component is divided by the squared sum of the neighbouring components. Parameters --...
148,458
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Apply instance normalization to the input array and returns the normalized input, running mean and running variance arrays as output. If ``training == False``, the mean and variance arrays passed as input are used for normalization and the same arrays are returned as running mean and running variance respectively. Howe...
148,459
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Apply group normalization to the input array and returns the normalized input. Parameters ---------- x Input array of default shape (N, *S, C), where N is the batch dimension, *S corresponds to any number of spatial dimensions and C corresponds to the channel dimension. num_groups number of groups to separate the chann...
148,460
from typing import Literal, Union, Optional, Tuple import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( handle_partial_mixed_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays, ...
Normalize the input array along the given axis to have Lp norm equal to 1. Parameters ---------- x Input array. p The Lp norm to use for normalization. Default is L2 norm (p=2). axis Axis along which to normalize. If ``None``, the whole array is normalized. out optional output array, for writing the result to. It must ...
148,461
import ivy from ivy.func_wrapper import inputs_to_native_arrays from ivy.utils.exceptions import handle_exceptions class SparseArray(ivy.Array): def __init__( self, data=None, *, coo_indices=None, crow_indices=None, col_indices=None, ccol_indices=None, ...
null
148,462
import ivy from ivy.func_wrapper import inputs_to_native_arrays from ivy.utils.exceptions import handle_exceptions def native_sparse_array( data=None, *, coo_indices=None, crow_indices=None, col_indices=None, ccol_indices=None, row_indices=None, values=None, dense_shape=None, fo...
null
148,463
import ivy from ivy.func_wrapper import inputs_to_native_arrays from ivy.utils.exceptions import handle_exceptions def native_sparse_array_to_indices_values_and_shape(x): return ivy.current_backend().native_sparse_array_to_indices_values_and_shape(x)
null
148,464
from typing import Optional, Union, Tuple import ivy from ivy.func_wrapper import ( handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_device, handle_backend_invalid, ) from ivy.utils.exceptions import handle_exceptions The provided code snippet includes necessary dependencies ...
Convert a flat index or array of flat indices into a tuple of coordinate arrays. Parameters ---------- indices Input array. shape The shape of the array to use for unraveling indices. out optional output array, for writing the result to. Returns ------- ret Tuple with arrays of type int32 that have the same shape as th...
148,465
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the eigenvalues and eigenvectors of a Hermitian tridiagonal matrix. Parameters ---------- alpha A real or complex array of shape (n), the diagonal elements of the matrix. If alpha is complex, the imaginary part is ignored (assumed zero) to satisfy the requirement that the matrix be Hermitian. beta A real or com...
148,466
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Return a two-dimensional array with the flattened input as a diagonal. Parameters ---------- x Input data, which is flattened and set as the k-th diagonal of the output. k Diagonal to set. Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonal. out optional output array,...
148,467
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the matrix exponential of a square matrix. Parameters ---------- a Square matrix. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret the matrix exponential of the input. Examples -------- >>> x = ivy.array([[[1., 0.], [0., 1.]], [[2., 0.]...
148,468
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute eigenvalues of x. Returns a set of eigenvalues. Parameters ---------- x An array of shape (..., N, N). Returns ------- w Not necessarily ordered array(..., N) of eigenvalues in complex type. Examples -------- With :class:`ivy.Array` inputs: >>> x = ivy.array([[1,2], [3,4]]) >>> w = ivy.eigvals(x) >>> w ivy.arra...
148,469
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the complex conjugate transpose of x. Parameters ---------- x An array with more than one dimension. out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret the complex conjugate transpose of the input. Examples -------- >>> x = np.array([[1.-...
148,470
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Parameters ---------- A tensor of shape (*, m, n) where * is zero or more batch dimensions. pivot Whether to compute the LU decomposition with partial pivoting, or the regular LU decomposition. pivot = False not supported on CPU. Default: True. out tuple of two tensors to write the output to. Ignored if None. Default: ...
148,471
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
null
148,472
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Return the unique solution to the triangular system of linear equations AX = B. Parameters ---------- x1 Triangular coefficient array A of shape (..., N, N), with no zeros on diagonal. x2 Right-hand side array B of shape (..., N, K). upper Whether the input `x1` is upper triangular. adjoint Whether to take the adjoint ...
148,473
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the dot product of two or more matrices in a single function call, while selecting the fastest evaluation order. Parameters ---------- x sequence of matrices to multiply. out optional output array, for writing the result to. It must have a valid shape, i.e. the resulting shape after applying regular matrix mult...
148,474
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the condition number of x. Parameters ---------- x An array with more than one dimension. p The order of the norm of the matrix (see :func:`ivy.norm` for details). out optional output array, for writing the result to. It must have a shape that the inputs broadcast to. Returns ------- ret the condition number of...
148,475
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Kronecker product of a list of matrices. Parameters ---------- x Sequence of matrices skip_matrix if not None, index of a matrix to skip reverse if True, the order of the matrices is reversed Returns ------- kronecker_product: matrix of shape ``(prod(n_rows), prod(n_columns)`` where ``prod(n_rows) = prod([m.shape[0] fo...
148,476
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Khatri-Rao product of a sequence of matrices. This can be seen as a column-wise kronecker product. If one matrix only is given, that matrix is directly returned. Parameters ---------- x Sequence of tensors with the same number of columns, i.e.:: for i in len(x): x[i].shape = (n_i, m) weights array of weights for each r...
148,477
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
TT decomposition via recursive SVD. Decomposes the input into a sequence of order-3 tensors (factors) Also known as Tensor-Train decomposition [1]_ Parameters ---------- input_tensor tensor to decompose rank maximum allowable TT rank of the factors if int, then this is the same for all the factors if int list, then ran...
148,478
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Tucker decomposition via Higher Order Orthogonal Iteration (HOI) Decomposes `tensor` into a Tucker decomposition: ``tensor = [| core; factors[0], ...factors[-1] |]`` [1]_ Parameters ---------- x input tensor rank size of the core tensor, ``(len(ranks) == tensor.ndim)`` if int, the same rank is used for all modes fixed_...
148,479
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Return the full tensor whose TT-Matrix decomposition is given by 'factors' Re- assembles 'factors', which represent a tensor in TT-Matrix format into the corresponding full tensor. Parameters ---------- tt_matrix array of 4D-arrays TT-Matrix factors (known as core) of shape (rank_k, left_dim_k, right_dim_k, rank_{k+1})...
148,480
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Generalised inner products between tensors. Takes the inner product between the last (respectively first) `n_modes` of `a` (respectively `b`) Parameters ---------- a first input tensor. b second input tensor. n_modes int, default is None. If None, the traditional inner product is returned (i.e. a float) otherwise, the ...
148,481
import logging from typing import Union, Optional, Tuple, List, Sequence, Literal import ivy from ivy.utils.backend import current_backend from ivy.func_wrapper import ( to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, h...
Compute the Higher-Order Moment. Parameters ---------- x matrix of size (n_samples, n_features) or tensor of size(n_samples, D1, ..., DN) order number of the higher-order moment to compute Returns ------- tensor if tensor is a matrix of size (n_samples, n_features), tensor of size (n_features, )*order Examples --------...
148,482
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Return an array that contains a vorbis power complementary window of size window_length. Parameters ---------- window_length the length of the vorbis window. dtype data type of the returned array. By default float32. out optional output array, for writing the result to. Returns ------- ret Input array with the vorbis w...
148,483
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Generate a Hann window. The Hanning window is a taper formed by using a weighted cosine. Parameters ---------- size the size of the returned window. periodic If True, returns a window to be used as periodic function. If False, return a symmetric window. dtype The data type to produce. Must be a floating point type. out...
148,484
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Compute the Kaiser bessel derived window with window length window_length and shape beta. Parameters ---------- window_length an int defining the length of the window. beta a float used as shape parameter for the window. dtype data type of the returned array out optional output array, for writing the result to. Returns...
148,485
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Compute the Hamming window with window length window_length. Parameters ---------- window_length an int defining the length of the window. periodic If True, returns a window to be used as periodic function. If False, return a symmetric window. alpha The coefficient alpha in the hamming window equation beta The coeffici...
148,486
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Return the indices of the lower 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 lower triangular part of the m...
148,487
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Return a 2D array filled with ones on the k diagonal and zeros elsewhere. having the same ``shape`` as the first and last dim of input array ``x``. input array ``x`` should to be 2D. Parameters ---------- x input array from which to derive the output array shape. k index of the diagonal. A positive value refers to an u...
148,488
from typing import Union, Tuple, Optional, Sequence, Iterable, Generator import warnings import ivy from ivy.utils.backend import current_backend from ivy.utils.exceptions import handle_exceptions from ivy.func_wrapper import ( outputs_to_ivy_arrays, handle_nestable, to_native_arrays_and_back, handle_ou...
Multidimensional index iterator. Parameters ---------- input Input array to iterate over. Returns ------- ret An iterator yielding pairs of array coordinates and values. Examples -------- >>> a = ivy.array([[1, 2], [3, 4]]) >>> for index, x in ivy.ndenumerate(a): >>> print(index, x) (0, 0) 1 (0, 1) 2 (1, 0) 3 (1, 1) 4