TrainingExtensions/tensorflow/src/python/aimet_tensorflow/common/connectedgraph.py
def _reorder_multi_input_op_products(op: Op):
    """
    Ops with multiple input products need to have the input products arranged in the same order as in the tf graph,
    so mask propagation will work correctly.
    """

    if op.type in ['Add', 'AddN', 'ConcatV2', 'Merge', 'Mul']:
        # Create new product list with the same length as the old input products list
        # When looking at inputs to the op in tf graph, there may be inputs that were not seen during DFS.
        # Currently, handle this by first creating a product list with the length of the op inputs, filling in entries
        # corresponding to products which we have seen, then remove all indices that are not filled in.
        old_products = op.get_input_products()
        tf_op_input_list = list(op.get_module().inputs)

        new_product_list = [None] * len(tf_op_input_list)
        for product in old_products:
            index = tf_op_input_list.index(product.tensor_dict[op])
            new_product_list[index] = product
        op.inputs = [i for i in new_product_list if i]

    Ops with multiple input products need to have the input products arranged in the same order as in the tf graph,
    so mask propagation will work correctly.
    
Ops with multiple input products need to have the input products arranged in the same order as in the tf graph,
so mask propagation will work correctly.
Ops with multiple input products need to have the input products arranged in the same order as in the tf graph so mask propagation will work correctly .
def _reorder_multi_input_op_products(op: Op):
    if op.type in ['Add', 'AddN', 'ConcatV2', 'Merge', 'Mul']:
        old_products = op.get_input_products()
        tf_op_input_list = list(op.get_module().inputs)
        new_product_list = [None] * len(tf_op_input_list)
        for product in old_products:
            index = tf_op_input_list.index(product.tensor_dict[op])
            new_product_list[index] = product
        op.inputs = [i for i in new_product_list if i]
def _reorder_multi_input_op_products ( op : Op ) : if op . type in [ 'Add' , 'AddN' , 'ConcatV2' , 'Merge' , 'Mul' ] : old_products = op . get_input_products ( ) tf_op_input_list = list ( op . get_module ( ) . inputs ) new_product_list = [ None ] * len ( tf_op_input_list ) for product in old_products : index = tf_op_input_list . index ( product . tensor_dict [ op ] ) new_product_list [ index ] = product op . inputs = [ i for i in new_product_list if i ]
Ops with multiple input products need to have the input products arranged in the same order as in the tf graph,
so mask propagation will work correctly.
Ops with multiple input products need to have the input products arranged in the same order as in the tf graph so mask propagation will work correctly .
"""
    Ops with multiple input products need to have the input products arranged in the same order as in the tf graph,
    so mask propagation will work correctly.
    """ # Create new product list with the same length as the old input products list # When looking at inputs to the op in tf graph, there may be inputs that were not seen during DFS. # Currently, handle this by first creating a product list with the length of the op inputs, filling in entries # corresponding to products which we have seen, then remove all indices that are not filled in.
op
Op