TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py
def _construct_ops_and_products(self,
                                    ir_nodes_list: List[IrNode],
                                    module_tensor_shapes_map: ModuleTensorShapeMapType,
                                    passthrough_types: List[str],
                                    input_types_to_ignore: List[str],
                                    output_map: Dict[torch._C.TensorType, torch._C.TensorType]):
        """
        Create ops and products from nodes and connections.
        :param ir_nodes_list: List of ir_nodes to create ops for
        :param module_tensor_shapes_map: Dictionary mapping modules to input and output tensor shapes obtained from a
            forward pass
        :param passthrough_types: IrNode types to treat as passthrough (ops will not be created for these ir_nodes)
        :param input_types_to_ignore: Input node types to ignore (do not create products for output connections from
            these ir_nodes)
        :param output_map: Mapping between higher level connections with corresponding lower level recursive
            connections. Only the base level connections carry shape information.
        """
        self._handle_ir_nodes_of_interest(ir_nodes_list, passthrough_types, input_types_to_ignore)
        filtered_ir_nodes = [ir_node for ir_node in ir_nodes_list if ir_node.node_type not in ['TupleConstruct',
                                                                                               'TupleUnpack',
                                                                                               'ListUnpack',
                                                                                               'ListConstruct']
                             and ir_node.node_type not in input_types_to_ignore
                             and ir_node.node_type not in passthrough_types]
        connections_to_nodes_dict = self._create_connections_to_ir_nodes_dict(filtered_ir_nodes)
        ir_node_to_op_dict = self._create_ops_from_ir_nodes_list(filtered_ir_nodes, module_tensor_shapes_map)
        self._create_products_from_connections(connections_to_nodes_dict, ir_node_to_op_dict, output_map,
                                               input_types_to_ignore)

        Create ops and products from nodes and connections.
        :param ir_nodes_list: List of ir_nodes to create ops for
        :param module_tensor_shapes_map: Dictionary mapping modules to input and output tensor shapes obtained from a
            forward pass
        :param passthrough_types: IrNode types to treat as passthrough (ops will not be created for these ir_nodes)
        :param input_types_to_ignore: Input node types to ignore (do not create products for output connections from
            these ir_nodes)
        :param output_map: Mapping between higher level connections with corresponding lower level recursive
            connections. Only the base level connections carry shape information.
        
Create ops and products from nodes and connections.
Create ops and products from nodes and connections .
def _construct_ops_and_products(self,
                                    ir_nodes_list: List[IrNode],
                                    module_tensor_shapes_map: ModuleTensorShapeMapType,
                                    passthrough_types: List[str],
                                    input_types_to_ignore: List[str],
                                    output_map: Dict[torch._C.TensorType, torch._C.TensorType]):
        self._handle_ir_nodes_of_interest(ir_nodes_list, passthrough_types, input_types_to_ignore)
        filtered_ir_nodes = [ir_node for ir_node in ir_nodes_list if ir_node.node_type not in ['TupleConstruct',
                                                                                               'TupleUnpack',
                                                                                               'ListUnpack',
                                                                                               'ListConstruct']
                             and ir_node.node_type not in input_types_to_ignore
                             and ir_node.node_type not in passthrough_types]
        connections_to_nodes_dict = self._create_connections_to_ir_nodes_dict(filtered_ir_nodes)
        ir_node_to_op_dict = self._create_ops_from_ir_nodes_list(filtered_ir_nodes, module_tensor_shapes_map)
        self._create_products_from_connections(connections_to_nodes_dict, ir_node_to_op_dict, output_map,
                                               input_types_to_ignore)
def _construct_ops_and_products ( self , ir_nodes_list : List [ IrNode ] , module_tensor_shapes_map : ModuleTensorShapeMapType , passthrough_types : List [ str ] , input_types_to_ignore : List [ str ] , output_map : Dict [ torch . _C . TensorType , torch . _C . TensorType ] ) : self . _handle_ir_nodes_of_interest ( ir_nodes_list , passthrough_types , input_types_to_ignore ) filtered_ir_nodes = [ ir_node for ir_node in ir_nodes_list if ir_node . node_type not in [ 'TupleConstruct' , 'TupleUnpack' , 'ListUnpack' , 'ListConstruct' ] and ir_node . node_type not in input_types_to_ignore and ir_node . node_type not in passthrough_types ] connections_to_nodes_dict = self . _create_connections_to_ir_nodes_dict ( filtered_ir_nodes ) ir_node_to_op_dict = self . _create_ops_from_ir_nodes_list ( filtered_ir_nodes , module_tensor_shapes_map ) self . _create_products_from_connections ( connections_to_nodes_dict , ir_node_to_op_dict , output_map , input_types_to_ignore )
Create ops and products from nodes and connections.
Create ops and products from nodes and connections .
"""
        Create ops and products from nodes and connections.
        :param ir_nodes_list: List of ir_nodes to create ops for
        :param module_tensor_shapes_map: Dictionary mapping modules to input and output tensor shapes obtained from a
            forward pass
        :param passthrough_types: IrNode types to treat as passthrough (ops will not be created for these ir_nodes)
        :param input_types_to_ignore: Input node types to ignore (do not create products for output connections from
            these ir_nodes)
        :param output_map: Mapping between higher level connections with corresponding lower level recursive
            connections. Only the base level connections carry shape information.
        """
self
ir_nodes_list
List[IrNode]
List of ir_nodes to create ops for
List of ir_nodes to create ops for
module_tensor_shapes_map
ModuleTensorShapeMapType
Dictionary mapping modules to input and output tensor shapes obtained from a
forward pass
Dictionary mapping modules to input and output tensor shapes obtained from a forward pass
passthrough_types
List[str]
IrNode types to treat as passthrough (ops will not be created for these ir_nodes)
IrNode types to treat as passthrough ( ops will not be created for these ir_nodes )
input_types_to_ignore
List[str]
Input node types to ignore (do not create products for output connections from
these ir_nodes)
Input node types to ignore ( do not create products for output connections from these ir_nodes )
output_map
Dict[torch._C.TensorType, torch._C.TensorType]
Mapping between higher level connections with corresponding lower level recursive
connections. Only the base level connections carry shape information.
Mapping between higher level connections with corresponding lower level recursive connections . Only the base level connections carry shape information .