async function sessionRun(session, inputs) {
    const checkedInputs = validateInputs(session, inputs);
    try {
        // pass the original ort tensor
        const ortFeed = Object.fromEntries(Object.entries(checkedInputs).map(([k, v]) => [k, v.ort_tensor]));
        const run = () => session.run(ortFeed);
        const output = await ((apis.IS_BROWSER_ENV || apis.IS_WEBWORKER_ENV)
            ? (webInferenceChain = webInferenceChain.then(run))
            : run());
        return replaceTensors(output);
    } catch (e) {
        // Error messages can be long (nested) and uninformative. For this reason,
        // we apply minor formatting to show the most important information
        const formatted = Object.fromEntries(Object.entries(checkedInputs)
            .map(([k, tensor]) => {
                // Extract these properties from the underlying ORT tensor
                const unpacked = {
                    type: tensor.type,
                    dims: tensor.dims,
                    location: tensor.location,
                }
                if (unpacked.location !== "gpu-buffer") {
                    // Only return the data if it's not a GPU buffer
                    unpacked.data = tensor.data;
                }
                return [k, unpacked];
            }));

        // This usually occurs when the inputs are of the wrong type.
        console.error(`An error occurred during model execution: "${e}".`);
        console.error('Inputs given to model:', formatted);
        throw e;
    }
}
Executes an InferenceSession using the specified inputs.
NOTE: `inputs` must contain at least the input names of the model.
 - If additional inputs are passed, they will be ignored.
 - If inputs are missing, an error will be thrown.

@param {Object} session The InferenceSession object to run.
@param {Object} inputs An object that maps input names to input tensors.
@returns {Promise<Object>} A Promise that resolves to an object that maps output names to output tensors.
@private