Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ops/registry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createInferenceSession } from "../backends/onnx.js";
import { createInferenceSession, isONNXProxy } from "../backends/onnx.js";
import { Tensor } from "../utils/tensor.js";

/**
Expand All @@ -17,7 +17,8 @@ const wrap = async (session_bytes, session_options, names) => {
new Uint8Array(session_bytes), session_options,
);
return /** @type {any} */(async (/** @type {Record<string, Tensor>} */ inputs) => {
const ortFeed = Object.fromEntries(Object.entries(inputs).map(([k, v]) => [k, v.ort_tensor]));
const proxied = isONNXProxy();
const ortFeed = Object.fromEntries(Object.entries(inputs).map(([k, v]) => [k, (proxied ? v.clone() : v).ort_tensor]));
const outputs = await session.run(ortFeed);

if (Array.isArray(names)) {
Expand Down
Loading