centered#

centered(arr, new_shape)[source]#

Extract the centered portion of an array based on a new shape.

Parameters:
arrBackendArray

Input data.

new_shapetuple of ints

Desired shape for the central portion.

Returns:
BackendArray

Central portion of the array with shape new_shape.

References