nncf/torch/pruning/utils.py
def collect_input_shapes(graph: NNCFGraph) -> Dict[NNCFNodeName, List[int]]:
    """
    Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph.

    :param graph: NNCFGraph.
    :return: Dictionary of input dimension shapes. E.g {node_name: (height, width)}
    """
    modules_in_shapes = {}
    for node in graph.get_nodes_by_types([v.op_func_name for v in NNCF_LINEAR_MODULES_DICT]):
        in_edge = graph.get_input_edges(node)[0]
        in_shape = in_edge.tensor_shape
        if len(in_shape) == 1:
            modules_in_shapes[node.node_name] = in_shape[0]
        else:
            modules_in_shapes[node.node_name] = in_shape[1:]
    return modules_in_shapes

    Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph.

    :param graph: NNCFGraph.
    :return: Dictionary of input dimension shapes. E.g {node_name: (height, width)}
    
Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph.
Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph .
def collect_input_shapes(graph: NNCFGraph) -> Dict[NNCFNodeName, List[int]]:
    modules_in_shapes = {}
    for node in graph.get_nodes_by_types([v.op_func_name for v in NNCF_LINEAR_MODULES_DICT]):
        in_edge = graph.get_input_edges(node)[0]
        in_shape = in_edge.tensor_shape
        if len(in_shape) == 1:
            modules_in_shapes[node.node_name] = in_shape[0]
        else:
            modules_in_shapes[node.node_name] = in_shape[1:]
    return modules_in_shapes
def collect_input_shapes ( graph : NNCFGraph ) -> Dict [ NNCFNodeName , List [ int ] ] : modules_in_shapes = { } for node in graph . get_nodes_by_types ( [ v . op_func_name for v in NNCF_LINEAR_MODULES_DICT ] ) : in_edge = graph . get_input_edges ( node ) [ 0 ] in_shape = in_edge . tensor_shape if len ( in_shape ) == 1 : modules_in_shapes [ node . node_name ] = in_shape [ 0 ] else : modules_in_shapes [ node . node_name ] = in_shape [ 1 : ] return modules_in_shapes
Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph.
Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph .
"""
    Collects input dimension shapes for fully connected layers from the connected edges in the NNCFGraph.

    :param graph: NNCFGraph.
    :return: Dictionary of input dimension shapes. E.g {node_name: (height, width)}
    """
Dictionary of input dimension shapes. E.g {node_name: (height, width)}
Dictionary of input dimension shapes . E . g { node_name : ( height width ) }
graph
NNCFGraph
None