def align_concat(self):
        """Align concat op's inputs and output pos."""
        for node in self.model.model.graph.node:
            if node.op_type not in ["Concat"]:
                continue
            input_node_num = len(node.input)
            opos_name = self.get_opos_name(node)
            opos, _ = self.get_pos_by_name(opos_name)
            min_pos = opos
            ipos_layers = []

            for input_id in range(input_node_num):
                ipos_name = self.get_ipos_name_by_id(node, input_id)
                ipos_layers.append(ipos_name)
            for name in ipos_layers:
                ipos, _ = self.get_pos_by_name(name)
                if ipos is not None:
                    min_pos = min(ipos, min_pos)
            if opos != min_pos:
                self.set_pos(self.get_node_by_name(self.find_o_name(node.output[0])), min_pos)
                logger.info(
                    (
                        "Output pos of concat node {} is {}, min_pos is {}. Modify opos from {} to {}.".format(
                            node.name, int(opos), int(min_pos), int(opos), int(min_pos)
                        )
                    )
                )
            for name in ipos_layers:
                ipos, ipos_node = self.get_pos_by_name(name)
                if ipos is not None and ipos != min_pos:
                    self.set_pos(ipos_node, min_pos)
                    logger.info(
                        "Input pos of concat node {} is {}, min_pos is {}. Modify ipos from {} to {}.".format(
                            node.name, int(ipos), int(min_pos), int(ipos), int(min_pos)
                        )
                    )
Align concat op's inputs and output pos.
olive/passes/onnx/vitis_ai/refine.py