def is_constant_input(self, io_name: str, allow_input_initializer: bool = False) -> bool:
        """Check if an input/output comes from an initializer or a constant node.

        :param io_name: name of the input/output.
        :param allow_input_initializer: whether to consider input_initializer as a constant input.
        :return: True if the input/output is a constant input.
        """
        source = self.ios[io_name].source
        if source in self.nodes:
            return self.get_node_op_type(source) == "Constant"

        return (source == SpecialInput.INITIALIZER) or (allow_input_initializer and SpecialInput.is_initializer(source))
Check if an input/output comes from an initializer or a constant node.

        :param io_name: name of the input/output.
        :param allow_input_initializer: whether to consider input_initializer as a constant input.
        :return: True if the input/output is a constant input.
        
olive/passes/onnx/onnx_dag.py