- ivy.split_func_call(func, inputs, mode, /, *, max_chunk_size=None, chunk_size=None, input_axes=0, output_axes=None, stop_gradients=False, device=None)[source]#
Call a function by splitting its inputs along a given axis, and calling the function in chunks, rather than feeding the entire input array at once. This can be useful to reduce memory usage of the device the arrays are on.
Callable) – The function to be called.
NativeArray]) – A list of inputs to pass into the function.
str) – The mode by which to unify the return values, must be one of [ concat | mean | sum ]
int]) – The maximum size of each of the chunks to be fed into the function. (default:
int]) – The size of each of the chunks to be fed into the function. Specifying this arg (default:
None) overwrites the global split factor. Default is
int]]) – The axes along which to split each of the inputs, before passing to the (default:
0) function. Default is
int]]]) – The axes along which to concat each of the returned outputs. Default is same as (default:
None) fist input axis.
bool) – Whether to stop the gradients for each computed return. Default is
NativeDevice]]) – The device to set the split factor for. Sets the default device by default. (default:
- Return type:
ret – The return from the function, following input splitting and re-concattenation.