def get_conv_layer_fanout(weight_shape, conv_mode):
    """
    The the "fan-out" of an input feeding into
    :param weight_shape: A 4-element tuple, identifiying (n_output_maps, n_input_maps, size_y, size_x)
    :param conv_mode: Can be:
        'full': Meaning that the output is (n_samples, n_output_maps, 1, 1)
        'same': Meaning that the output is (n_samples, n_output_maps, input_size_y, input_size_x)
    :return:
    """
    n_output_maps, n_input_maps, size_y, size_x = weight_shape
    assert conv_mode in ('full', 'same')
    if conv_mode=='full':
        return n_output_maps
    elif conv_mode == 'same':
        return n_output_maps*size_y*size_x