def get_out_shape(input_shape, operation, n_filters, stride):
    """
    Function to get the output shape of an operation applied to a certain input shape.
    Params:
        - input_shape: Tuple specifying the shape of the input.
        - operation: String specifying the operation to be applied.
        - n_filters: Number of filters that this layer wants to use.
        - stride: Integer identifying the stride value used for convolutional layers.
    Returns:
        - Tuple specifying the shape of the output
    """
    if operation in ['identity', '3xsqueezeexicte']:
        output_shape = (input_shape[0], input_shape[1], input_shape[2], input_shape[3])
    elif operation in ['3xdepthwise', '5xdepthwise', '1xconv', '3xconv', '5xconv', '3xdilated',
                       '3xmax', '3xaverage', '3xshuffle', '3xinvmobile', '5xinvmobile']:
        if stride == 1:
            output_shape = (input_shape[0], input_shape[1], input_shape[2], n_filters)
        elif stride == 2:
            output_shape = (input_shape[0], input_shape[1] // 2, input_shape[2] // 2, n_filters)
        else:
            raise ValueError('Stride value is not 1 nor 2 checks again the implementation of this block!')
    else:
        raise ValueError('Operation you select doesn\'t belong to the search space')
    return output_shape