def METHOD_NAME(model: "NNCFNetwork", graph: NNCFGraph) -> Dict[NNCFNodeName, List[int]]:
    """
    Collects output dimension shapes for convolutions and fully connected layers
    from the connected edges in the NNCFGraph.
    :param graph: NNCFGraph.
    :return: Dictionary of output dimension shapes. E.g {node_name: (height, width)}
    """
    layers_out_shapes = {}
    for node in graph.get_nodes_by_metatypes(GENERAL_CONV_LAYER_METATYPES):
        node_name, node_index = get_original_name_and_instance_idx(node.node_name)
        layer = model.get_layer(node_name)
        layer_ = unwrap_layer(layer)
        channel_axis = get_input_channel_axis(layer)
        dims_slice = (
            slice(channel_axis - layer_.rank, channel_axis)
            if layer.data_format == "channels_last"
            else slice(channel_axis + 1, None)
        )
        in_shape = layer.get_input_shape_at(node_index)[dims_slice]
        out_shape = layer.get_output_shape_at(node_index)[dims_slice]
        if not is_valid_shape(in_shape) or not is_valid_shape(out_shape):
            raise RuntimeError(f"Input/output shape is not defined for layer `{layer.name}` ")
        layers_out_shapes[node.node_name] = out_shape
    for node in graph.get_nodes_by_metatypes(LINEAR_LAYER_METATYPES):
        node_name, node_index = get_original_name_and_instance_idx(node.node_name)
        layer = model.get_layer(node_name)
        in_shape = layer.get_input_shape_at(node_index)[1:]
        out_shape = layer.get_output_shape_at(node_index)[1:]
        if not is_valid_shape(in_shape) or not is_valid_shape(out_shape):
            raise RuntimeError(f"Input/output shape is not defined for layer `{layer.name}` ")
        layers_out_shapes[node.node_name] = out_shape
    return layers_out_shapes