cupy.apply_along_axis#
- cupy.apply_along_axis(func1d, axis, arr, *args, **kwargs)[source]#
Apply a function to 1-D slices along the given axis.
- Parameters:
func1d (function (M,) -> (Nj...)) – This function should accept 1-D arrays. It is applied to 1-D slices of
arralong the specified axis. It must return a 1-Dcupy.ndarray.axis (integer) – Axis along which
arris sliced.arr (cupy.ndarray (Ni..., M, Nk...)) – Input array.
args – Additional arguments for
func1d.kwargs – Additional keyword arguments for
func1d.
- Returns:
The output array. The shape of
outis identical to the shape ofarr, except along theaxisdimension. This axis is removed, and replaced with new dimensions equal to the shape of the return value offunc1d. So iffunc1dreturns a scalaroutwill have one fewer dimensions thanarr.- Return type:
See also