def replace_initializer(self, initializer: TensorProto):
        """Replace an initializer in the graph.

        :param initializer: TensorProto of the initializer.
        """
        name = initializer.name
        if not self.is_initializer(name):
            raise ValueError(f"{name} is not an initializer.")
        proto_list = self.ios[name].proto[:-1] + [initializer]
        self.ios[name].proto = proto_list
Replace an initializer in the graph.

        :param initializer: TensorProto of the initializer.
        
olive/passes/onnx/onnx_dag.py