TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py
def _determine_split_behavior_for_op_and_insert_split_op_in_connected_graph(self, op: Op):
        """
        Determine if an Op's output is used as an input to more than one Op. If it is, create a Split Op and
        insert it in the connected graph, below this Op.
        Note that the split is done in the forward() function of a model and is NOT a PyTorch OP.
        :param op: Op to check if output is used as an input to more than one op.
        """

        name = op.name
        dotted_name = op.dotted_name

        # Get the output product names.
        output_product_names = self.get_product_names_from_dotted_name(dotted_name)

        name_list = []
        for prod_name in output_product_names:
            to_pos = prod_name.find('to')
            first_name = prod_name[:to_pos]
            name_list.append(first_name)

        # Split ops have 2 or more output products
        if len(output_product_names) > 1:
            name_list = [+1 for prod in name_list if name in prod]
            if len(name_list) > 1:
                logger.debug("%s is a split Op", op.dotted_name)

                # Create a Split Op
                split_op = self._create_split_op(op)

                # Insert the Split Op in the connected graph.
                self._insert_split_op_in_connected_graph(op, split_op)

        Determine if an Op's output is used as an input to more than one Op. If it is, create a Split Op and
        insert it in the connected graph, below this Op.
        Note that the split is done in the forward() function of a model and is NOT a PyTorch OP.
        :param op: Op to check if output is used as an input to more than one op.
        
Determine if an Op's output is used as an input to more than one Op. If it is, create a Split Op and
insert it in the connected graph, below this Op.
Note that the split is done in the forward() function of a model and is NOT a PyTorch OP.
Determine if an Op ' s output is used as an input to more than one Op . If it is create a Split Op and insert it in the connected graph below this Op . Note that the split is done in the forward () function of a model and is NOT a PyTorch OP .
def _determine_split_behavior_for_op_and_insert_split_op_in_connected_graph(self, op: Op):
        name = op.name
        dotted_name = op.dotted_name
        output_product_names = self.get_product_names_from_dotted_name(dotted_name)
        name_list = []
        for prod_name in output_product_names:
            to_pos = prod_name.find('to')
            first_name = prod_name[:to_pos]
            name_list.append(first_name)
        if len(output_product_names) > 1:
            name_list = [+1 for prod in name_list if name in prod]
            if len(name_list) > 1:
                logger.debug("%s is a split Op", op.dotted_name)
                split_op = self._create_split_op(op)
                self._insert_split_op_in_connected_graph(op, split_op)
def _determine_split_behavior_for_op_and_insert_split_op_in_connected_graph ( self , op : Op ) : name = op . name dotted_name = op . dotted_name output_product_names = self . get_product_names_from_dotted_name ( dotted_name ) name_list = [ ] for prod_name in output_product_names : to_pos = prod_name . find ( 'to' ) first_name = prod_name [ : to_pos ] name_list . append ( first_name ) if len ( output_product_names ) > 1 : name_list = [ + 1 for prod in name_list if name in prod ] if len ( name_list ) > 1 : logger . debug ( "%s is a split Op" , op . dotted_name ) split_op = self . _create_split_op ( op ) self . _insert_split_op_in_connected_graph ( op , split_op )
Determine if an Op's output is used as an input to more than one Op.
Determine if an Op ' s output is used as an input to more than one Op .
"""
        Determine if an Op's output is used as an input to more than one Op. If it is, create a Split Op and
        insert it in the connected graph, below this Op.
        Note that the split is done in the forward() function of a model and is NOT a PyTorch OP.
        :param op: Op to check if output is used as an input to more than one op.
        """ # Get the output product names. # Split ops have 2 or more output products # Create a Split Op # Insert the Split Op in the connected graph.
self
op
Op
Op to check if output is used as an input to more than one op.
Op to check if output is used as an input to more than one op .