def METHOD_NAME(fmaps_in, shape):
    """Crop only the spacial dimensions to match shape.
    Args:
        fmaps_in:
            The input tensor.
        shape:
            A list (not a tensor) with the requested shape [_, _, z, y, x] or
            [_, _, y, x].
    """
    in_shape = fmaps_in.get_shape().as_list()
    offset = [0, 0] + [(in_shape[i] - shape[i]) // 2 for i in range(2, len(shape))]
    size = in_shape[0:2] + shape[2:]
    fmaps = tf.slice(fmaps_in, offset, size)
    return fmaps