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) – Whether to scan in reverse with respect to the given axis. (default: False)

  • axis (int) – The axis to scan over. (default: 0)

Return type:

Array

Returns:

ret – The result of the scan.

Array.associative_scan(self, fn, /, *, reverse=False, axis=0)#

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) – Whether to scan in reverse with respect to the given axis. (default: False)

  • axis (int) – The axis to scan over. (default: 0)

Return type:

Array

Returns:

ret – The result of the scan.

Container.associative_scan(self, fn, /, *, reverse=False, axis=0)#

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 (Callable) – The associative function to apply.

  • reverse (bool) – Whether to scan in reverse with respect to the given axis. (default: False)

  • axis (int) – The axis to scan over. (default: 0)

Return type:

Container

Returns:

ret – The result of the scan.