def METHOD_NAME(inputs, target_shape, dims):
    """ Crop last dims of a tensor at the center. """
    inputs_shape = np.array(get_shape(inputs))
    to_crop_shape = inputs_shape[-dims:]
    no_crop_shape = inputs_shape[:-dims]
    crop_lefts = (to_crop_shape - target_shape) // 2
    crops_ = [slice(crop_lefts[i], crop_lefts[i] + target_shape[i]) for i in range(dims)]
    crops = [slice(dim) for dim in no_crop_shape] + crops_
    return inputs[crops]