associative_scan#
- ivy.associative_scan(x, fn, /, *, reverse=False, axis=0)[source]#
Perform an associative scan over the given array.
- Parameters:
x (
Union
[Array
,NativeArray
]) – The array to scan over.fn (
Callable
) – The associative function to apply.reverse (
bool
, default:False
) – Whether to scan in reverse with respect to the given axis.axis (
int
, default:0
) – The axis to scan over.
- Return type:
- Returns:
ret – The result of the scan.
- Array.associative_scan(self, fn, /, *, reverse=False, axis=0)[source]#
Perform an associative scan over the given array.
- Parameters:
self (
Array
) – The array to scan over.fn (
Callable
) – The associative function to apply.reverse (
bool
, default:False
) – Whether to scan in reverse with respect to the given axis.axis (
int
, default:0
) – The axis to scan over.
- Return type:
Array
- Returns:
ret – The result of the scan.
- Container.associative_scan(self, fn, /, *, reverse=False, axis=0)[source]#
ivy.Container instance method variant of ivy.associative_scan. This method simply wraps the function, and so the docstring for ivy.associative_scan also applies to this method with minimal changes.
- Parameters:
self (
Union
[Array
,NativeArray
,Container
]) – The Container to scan over.fn (
Union
[Callable
,Container
]) – The associative function to apply.reverse (
Union
[bool
,Container
], default:False
) – Whether to scan in reverse with respect to the given axis.axis (
Union
[int
,Container
], default:0
) – The axis to scan over.
- Return type:
Container
- Returns:
ret – The result of the scan.