wrap = async (session_bytes, session_options, names) => {
    const session = await createInferenceSession(
        new Uint8Array(session_bytes), session_options,
    );

    /** @type {Promise<any>} */
    let chain = Promise.resolve();

    return /** @type {any} */(async (/** @type {Record<string, Tensor>} */ inputs) => {
        const proxied = isONNXProxy();
        const ortFeed = Object.fromEntries(Object.entries(inputs).map(([k, v]) => [k, (proxied ? v.clone() : v).ort_tensor]));

        // When running in-browser via WASM, we need to chain calls to session.run to avoid "Error: Session already started"
        const outputs = await (chain = IS_WEB_ENV ? chain.then(() => session.run(ortFeed)) : session.run(ortFeed));

        if (Array.isArray(names)) {
            return names.map((n) => new Tensor(outputs[n]));
        } else {
            return new Tensor(outputs[/** @type {string} */(names)]);
        }
    })
}
Asynchronously creates a wrapper function for running an ONNX inference session.

@param {number[]} session_bytes The session data in bytes.
@param {import('onnxruntime-common').InferenceSession.SessionOptions} session_options The options for the ONNX session.
@template {string | [string] | string[]} T
@param {T} names The name(s) of the output tensor(s).

@returns {Promise<function(Record<string, Tensor>): Promise<T extends string ? Tensor : T extends string[] ? { [K in keyof T]: Tensor } : never>>}
The wrapper function for running the ONNX inference session.