diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cf8881..369751a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ ## Changelog -### **HEAD -> main** 2021/10/02 mandic00@live.com +### **HEAD -> main** 2021/10/03 mandic00@live.com +- added docker notes - breaking change: new similarity and match methods - release candidate - tweaked default values diff --git a/demo/index.js b/demo/index.js index 97fec5dc..7586a74d 100644 --- a/demo/index.js +++ b/demo/index.js @@ -31,6 +31,13 @@ import jsonView from './helpers/jsonview.js'; let human; let userConfig = { + face: { enabled: false }, + object: { enabled: false }, + gesture: { enabled: true }, + hand: { enabled: false }, + body: { enabled: true, modelPath: 'https://vladmandic.github.io/human-models/models/blazepose-lite.json' }, + segmentation: { enabled: false }, + /* warmup: 'none', backend: 'humangl', @@ -108,7 +115,7 @@ const ui = { lastFrame: 0, // time of last frame processing viewportSet: false, // internal, has custom viewport been set background: null, // holds instance of segmentation background image - exceptionHandler: true, // should capture all unhandled exceptions + exceptionHandler: false, // should capture all unhandled exceptions // webrtc useWebRTC: false, // use webrtc as camera source instead of local webcam diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index 37bb65e4..628fbaff 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -173,7 +173,7 @@ var config = { }, maxDetected: -1, minConfidence: 0.2, - skipFrames: 1 + skipFrames: 5 }, hand: { enabled: true, @@ -1177,6 +1177,8 @@ function process2(input, config3) { tempCanvas.height = targetHeight; const tempCtx = tempCanvas.getContext("2d"); tempCtx == null ? void 0 : tempCtx.drawImage(outCanvas, 0, 0); + console.log("PIXELS", tempCanvas); + pixels = tfjs_esm_exports.browser && env2.browser ? tfjs_esm_exports.browser.fromPixels(tempCanvas) : null; try { pixels = tfjs_esm_exports.browser && env2.browser ? tfjs_esm_exports.browser.fromPixels(tempCanvas) : null; } catch (err) { @@ -8732,11 +8734,11 @@ var HandPipeline = class { const rawCoords = await keypointsReshaped.array(); tfjs_esm_exports.dispose(keypoints3); tfjs_esm_exports.dispose(keypointsReshaped); - const coords4 = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix); - const nextBoundingBox = this.getBoxForHandLandmarks(coords4); + const coords7 = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix); + const nextBoundingBox = this.getBoxForHandLandmarks(coords7); this.storedBoxes[i] = { ...nextBoundingBox, confidence }; const result = { - landmarks: coords4, + landmarks: coords7, confidence, boxConfidence: currentBox.confidence, fingerConfidence: confidence, @@ -9163,10 +9165,10 @@ async function predict5(input, config3) { return []; const hands = []; for (let i = 0; i < predictions.length; i++) { - const annotations3 = {}; + const annotations2 = {}; if (predictions[i].landmarks) { for (const key of Object.keys(meshAnnotations2)) { - annotations3[key] = meshAnnotations2[key].map((index) => predictions[i].landmarks[index]); + annotations2[key] = meshAnnotations2[key].map((index) => predictions[i].landmarks[index]); } } const keypoints3 = predictions[i].landmarks; @@ -9210,7 +9212,7 @@ async function predict5(input, config3) { box: box4, boxRaw: boxRaw2, keypoints: keypoints3, - annotations: annotations3, + annotations: annotations2, landmarks }); } @@ -9249,9 +9251,9 @@ async function load7(config3) { } // src/util/box.ts -function scale(keypoints3, boxScaleFact2, outputSize3) { - const coords4 = [keypoints3.map((pt) => pt[0]), keypoints3.map((pt) => pt[1])]; - const maxmin = [Math.max(...coords4[0]), Math.min(...coords4[0]), Math.max(...coords4[1]), Math.min(...coords4[1])]; +function scale(keypoints3, boxScaleFact2, outputSize2) { + const coords7 = [keypoints3.map((pt) => pt[0]), keypoints3.map((pt) => pt[1])]; + const maxmin = [Math.max(...coords7[0]), Math.min(...coords7[0]), Math.max(...coords7[1]), Math.min(...coords7[1])]; const center = [(maxmin[0] + maxmin[1]) / 2, (maxmin[2] + maxmin[3]) / 2]; const diff = Math.max(center[0] - maxmin[1], center[1] - maxmin[3], -center[0] + maxmin[0], -center[1] + maxmin[2]) * boxScaleFact2; const box4 = [ @@ -9261,10 +9263,10 @@ function scale(keypoints3, boxScaleFact2, outputSize3) { Math.trunc(2 * diff) ]; const boxRaw2 = [ - box4[0] / outputSize3[0], - box4[1] / outputSize3[1], - box4[2] / outputSize3[0], - box4[3] / outputSize3[1] + box4[0] / outputSize2[0], + box4[1] / outputSize2[1], + box4[2] / outputSize2[0], + box4[3] / outputSize2[1] ]; const yxBox = [ boxRaw2[1], @@ -9452,8 +9454,17 @@ async function predict6(input, config3) { return hands; } -// src/body/annotations.ts -var full = [ +// src/body/blazepose.ts +import { + dispose as dispose12, + div as div8, + image as image13, + loadGraphModel as loadGraphModel9, + pad +} from "@tensorflow/tfjs"; + +// src/body/blazeposecoords.ts +var kpt = [ "nose", "leftEyeInside", "leftEye", @@ -9487,58 +9498,38 @@ var full = [ "rightHeel", "leftFoot", "rightFoot", - "midHip", - "forehead", + "bodyCenter", + "bodyTop", "leftThumb", "leftHand", "rightThumb", "rightHand" ]; -var upper = [ - "nose", - "leftEyeInside", - "leftEye", - "leftEyeOutside", - "rightEyeInside", - "rightEye", - "rightEyeOutside", - "leftEar", - "rightEar", - "leftMouth", - "rightMouth", - "leftShoulder", - "rightShoulder", - "leftElbow", - "rightElbow", - "left:15", - "right:16", - "left:17", - "right:18", - "left:19", - "right:20", - "left:21", - "right:22", - "leftChest", - "rightChest", - "neck", - "forehead", - "left:27", - "right:28", - "left:29", - "right:30" -]; +var connected = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle", "leftHeel", "leftFoot"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle", "rightHeel", "rightFoot"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist", "leftPalm"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist", "rightPalm"], + leftHand: [], + rightHand: [], + head: [] +}; // src/body/blazepose.ts +var env3 = { initial: true }; var models2 = [null, null]; -var outputNodes = ["ld_3d", "activation_segmentation", "activation_heatmap", "world_3d", "output_poseflag"]; var inputSize5 = [[0, 0], [0, 0]]; -var outputSize2 = [0, 0]; +var skipped5 = Number.MAX_SAFE_INTEGER; +var outputNodes; +var cache2 = null; +var padding = [[0, 0], [0, 0], [0, 0], [0, 0]]; async function loadDetect2(config3) { - var _a; - if (env2.initial) + var _a, _b; + if (env3.initial) models2[0] = null; - if (!models2[0]) { - models2[0] = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, ((_a = config3.body.detector) == null ? void 0 : _a.modelPath) || "")); + if (!models2[0] && ((_a = config3.body.detector) == null ? void 0 : _a.modelPath) || "") { + models2[0] = await loadGraphModel9(join(config3.modelBasePath, ((_b = config3.body.detector) == null ? void 0 : _b.modelPath) || "")); const inputs = Object.values(models2[0].modelSignature["inputs"]); inputSize5[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize5[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; @@ -9546,18 +9537,23 @@ async function loadDetect2(config3) { log("load model failed:", config3.object.modelPath); else if (config3.debug) log("load model:", models2[0]["modelUrl"]); - } else if (config3.debug) + } else if (config3.debug && models2[0]) log("cached model:", models2[0]["modelUrl"]); return models2[0]; } async function loadPose(config3) { - if (env2.initial) + var _a; + if (env3.initial) models2[1] = null; if (!models2[1]) { - models2[1] = await tfjs_esm_exports.loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); + models2[1] = await loadGraphModel9(join(config3.modelBasePath, config3.body.modelPath || "")); const inputs = Object.values(models2[1].modelSignature["inputs"]); inputSize5[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize5[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; + if ((_a = config3.body.modelPath) == null ? void 0 : _a.includes("lite")) + outputNodes = ["ld_3d", "output_segmentation", "output_heatmap", "world_3d", "output_poseflag"]; + else + outputNodes = ["Identity", "Identity_2", "Identity_3", "Identity_4", "Identity_1"]; if (!models2[1] || !models2[1]["modelUrl"]) log("load model failed:", config3.object.modelPath); else if (config3.debug) @@ -9566,63 +9562,125 @@ async function loadPose(config3) { log("cached model:", models2[1]["modelUrl"]); return models2[1]; } -async function detectParts(input, config3) { - var _a; - const t = {}; - t.resize = tfjs_esm_exports.image.resizeBilinear(input, [inputSize5[1][0], inputSize5[1][1]]); - [t.ld, t.segmentation, t.heatmap, t.world, t.poseflag] = await ((_a = models2[1]) == null ? void 0 : _a.execute(t.resize, outputNodes)); - const points = await t.ld.data(); - const keypoints3 = []; - const labels2 = (points == null ? void 0 : points.length) === 195 ? full : upper; - const depth = 5; - for (let i = 0; i < points.length / depth; i++) { - const score3 = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; - if (score3 > (config3.body.minConfidence || 0)) { - keypoints3.push({ - part: labels2[i], - position: [ - Math.trunc(outputSize2[0] * points[depth * i + 0] / 255), - Math.trunc(outputSize2[1] * points[depth * i + 1] / 255), - Math.trunc(points[depth * i + 2]) + 0 - ], - positionRaw: [ - points[depth * i + 0] / 255, - points[depth * i + 1] / 255, - points[depth * i + 2] + 0 - ], - score: score3 - }); - } - } +function calculateBoxes(keypoints3, outputSize2) { const x = keypoints3.map((a) => a.position[0]); const y = keypoints3.map((a) => a.position[1]); - const box4 = [ - Math.min(...x), - Math.min(...y), - Math.max(...x) - Math.min(...x), - Math.max(...y) - Math.min(...x) + const keypointsBox = [Math.min(...x), Math.min(...y), Math.max(...x) - Math.min(...x), Math.max(...y) - Math.min(...y)]; + const keypointsBoxRaw = [keypointsBox[0] / outputSize2[0], keypointsBox[1] / outputSize2[1], keypointsBox[2] / outputSize2[0], keypointsBox[3] / outputSize2[1]]; + return { keypointsBox, keypointsBoxRaw }; +} +async function prepareImage(input) { + const t = {}; + if (!input.shape || !input.shape[1] || !input.shape[2]) + return input; + padding = [ + [0, 0], + [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], + [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], + [0, 0] ]; - const boxRaw2 = [0, 0, 0, 0]; - const score2 = keypoints3.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); - Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); - return { id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints3 }; + t.pad = pad(input, padding); + t.resize = image13.resizeBilinear(t.pad, [inputSize5[1][0], inputSize5[1][1]]); + const final = div8(t.resize, 255); + Object.keys(t).forEach((tensor3) => dispose12(t[tensor3])); + return final; +} +function rescaleKeypoints(keypoints3, outputSize2) { + for (const kpt4 of keypoints3) { + kpt4.position = [ + kpt4.position[0] * (outputSize2[0] + padding[2][0] + padding[2][1]) / outputSize2[0] - padding[2][0], + kpt4.position[1] * (outputSize2[1] + padding[1][0] + padding[1][1]) / outputSize2[1] - padding[1][0], + kpt4.position[2] + ]; + kpt4.positionRaw = [ + kpt4.position[0] / outputSize2[0], + kpt4.position[1] / outputSize2[1], + kpt4.position[2] + ]; + } + return keypoints3; +} +async function detectParts(input, config3, outputSize2) { + var _a; + const t = {}; + t.input = await prepareImage(input); + [t.ld, t.segmentation, t.heatmap, t.world, t.poseflag] = await ((_a = models2[1]) == null ? void 0 : _a.execute(t.input, outputNodes)); + const points = await t.ld.data(); + const keypointsRelative = []; + const depth = 5; + for (let i = 0; i < points.length / depth; i++) { + const score2 = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; + const positionRaw = [points[depth * i + 0] / inputSize5[1][0], points[depth * i + 1] / inputSize5[1][1], points[depth * i + 2] + 0]; + const position = [Math.trunc(outputSize2[0] * positionRaw[0]), Math.trunc(outputSize2[1] * positionRaw[1]), positionRaw[2]]; + keypointsRelative.push({ part: kpt[i], positionRaw, position, score: score2 }); + } + const avgScore = Math.round(100 * keypointsRelative.reduce((prev, curr) => prev += curr.score, 0) / keypointsRelative.length) / 100; + if (avgScore < (config3.body.minConfidence || 0)) + return null; + const keypoints3 = rescaleKeypoints(keypointsRelative, outputSize2); + const boxes = calculateBoxes(keypoints3, [outputSize2[0], outputSize2[1]]); + Object.keys(t).forEach((tensor3) => dispose12(t[tensor3])); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints3.find((kpt4) => kpt4.part === indexes[i]); + const pt1 = keypoints3.find((kpt4) => kpt4.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + return { id: 0, score: avgScore, box: boxes.keypointsBox, boxRaw: boxes.keypointsBoxRaw, keypoints: keypoints3, annotations: annotations2 }; } async function predict7(input, config3) { - outputSize2 = [input.shape[2] || 0, input.shape[1] || 0]; - const bodies = []; - const body4 = await detectParts(input, config3); - bodies.push(body4); - return bodies; + const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0]; + if (skipped5 < (config3.body.skipFrames || 0) && config3.skipFrame) { + skipped5++; + } else { + cache2 = await detectParts(input, config3, outputSize2); + skipped5 = 0; + } + if (cache2) + return [cache2]; + return []; } +// src/body/efficientposecoords.ts +var kpt2 = [ + "head", + "neck", + "rightShoulder", + "rightElbow", + "rightWrist", + "chest", + "leftShoulder", + "leftElbow", + "leftWrist", + "bodyCenter", + "rightHip", + "rightKnee", + "rightAnkle", + "leftHip", + "leftKnee", + "leftAnkle" +]; +var connected2 = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist"], + head: [] +}; + // src/body/efficientpose.ts var model7; var keypoints = []; var box3 = [0, 0, 0, 0]; var boxRaw = [0, 0, 0, 0]; var score = 0; -var skipped5 = Number.MAX_SAFE_INTEGER; -var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"]; +var skipped6 = Number.MAX_SAFE_INTEGER; async function load8(config3) { if (env2.initial) model7 = null; @@ -9643,9 +9701,9 @@ function max2d(inputs, minScore) { const reshaped = tfjs_esm_exports.reshape(inputs, [height * width]); const newScore = tfjs_esm_exports.max(reshaped, 0).dataSync()[0]; if (newScore > minScore) { - const coords4 = tfjs_esm_exports.argMax(reshaped, 0); - const x = mod(coords4, width).dataSync()[0]; - const y = tfjs_esm_exports.div(coords4, tfjs_esm_exports.scalar(width, "int32")).dataSync()[0]; + const coordinates = tfjs_esm_exports.argMax(reshaped, 0); + const x = mod(coordinates, width).dataSync()[0]; + const y = tfjs_esm_exports.div(coordinates, tfjs_esm_exports.scalar(width, "int32")).dataSync()[0]; return [x, y, newScore]; } return [0, 0, newScore]; @@ -9653,11 +9711,11 @@ function max2d(inputs, minScore) { } async function predict8(image24, config3) { var _a; - if (skipped5 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) { - skipped5++; - return [{ id: 0, score, box: box3, boxRaw, keypoints }]; + if (skipped6 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) { + skipped6++; + return [{ id: 0, score, box: box3, boxRaw, keypoints, annotations: {} }]; } - skipped5 = 0; + skipped6 = 0; return new Promise(async (resolve) => { var _a2; const tensor3 = tfjs_esm_exports.tidy(() => { @@ -9683,7 +9741,7 @@ async function predict8(image24, config3) { if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) { keypoints.push({ score: Math.round(100 * partScore) / 100, - part: bodyParts[id], + part: kpt2[id], positionRaw: [ x2 / model7.inputs[0].shape[2], y2 / model7.inputs[0].shape[1] @@ -9714,17 +9772,56 @@ async function predict8(image24, config3) { Math.max(...xRaw) - Math.min(...xRaw), Math.max(...yRaw) - Math.min(...yRaw) ]; - resolve([{ id: 0, score, box: box3, boxRaw, keypoints }]); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected2)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints.find((kpt4) => kpt4.part === indexes[i]); + const pt1 = keypoints.find((kpt4) => kpt4.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + resolve([{ id: 0, score, box: box3, boxRaw, keypoints, annotations: annotations2 }]); }); } +// src/body/movenetcoords.ts +var kpt3 = [ + "nose", + "leftEye", + "rightEye", + "leftEar", + "rightEar", + "leftShoulder", + "rightShoulder", + "leftElbow", + "rightElbow", + "leftWrist", + "rightWrist", + "leftHip", + "rightHip", + "leftKnee", + "rightKnee", + "leftAnkle", + "rightAnkle" +]; +var connected3 = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist"], + head: [] +}; + // src/body/movenet.ts var model8; var inputSize6 = 0; var cachedBoxes = []; -var skipped6 = Number.MAX_SAFE_INTEGER; +var skipped7 = Number.MAX_SAFE_INTEGER; var keypoints2 = []; -var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"]; async function load9(config3) { if (env2.initial) model8 = null; @@ -9762,19 +9859,19 @@ function createBox2(points) { return [box4, boxRaw2]; } async function parseSinglePose(res, config3, image24, inputBox) { - const kpt = res[0][0]; + const kpt4 = res[0][0]; keypoints2.length = 0; let score2 = 0; - for (let id = 0; id < kpt.length; id++) { - score2 = kpt[id][2]; + for (let id = 0; id < kpt4.length; id++) { + score2 = kpt4[id][2]; if (score2 > config3.body.minConfidence) { const positionRaw = [ - (inputBox[3] - inputBox[1]) * kpt[id][1] + inputBox[1], - (inputBox[2] - inputBox[0]) * kpt[id][0] + inputBox[0] + (inputBox[3] - inputBox[1]) * kpt4[id][1] + inputBox[1], + (inputBox[2] - inputBox[0]) * kpt4[id][0] + inputBox[0] ]; keypoints2.push({ score: Math.round(100 * score2) / 100, - part: bodyParts2[id], + part: kpt3[id], positionRaw, position: [ Math.round((image24.shape[2] || 0) * positionRaw[0]), @@ -9786,25 +9883,36 @@ async function parseSinglePose(res, config3, image24, inputBox) { score2 = keypoints2.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); const bodies = []; const [box4, boxRaw2] = createBox2(keypoints2); - bodies.push({ id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints2 }); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected3)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints2.find((kp) => kp.part === indexes[i]); + const pt1 = keypoints2.find((kp) => kp.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + bodies.push({ id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints2, annotations: annotations2 }); return bodies; } async function parseMultiPose(res, config3, image24, inputBox) { const bodies = []; for (let id = 0; id < res[0].length; id++) { - const kpt = res[0][id]; - const totalScore = Math.round(100 * kpt[51 + 4]) / 100; + const kpt4 = res[0][id]; + const totalScore = Math.round(100 * kpt4[51 + 4]) / 100; if (totalScore > config3.body.minConfidence) { keypoints2.length = 0; for (let i = 0; i < 17; i++) { - const score2 = kpt[3 * i + 2]; + const score2 = kpt4[3 * i + 2]; if (score2 > config3.body.minConfidence) { const positionRaw = [ - (inputBox[3] - inputBox[1]) * kpt[3 * i + 1] + inputBox[1], - (inputBox[2] - inputBox[0]) * kpt[3 * i + 0] + inputBox[0] + (inputBox[3] - inputBox[1]) * kpt4[3 * i + 1] + inputBox[1], + (inputBox[2] - inputBox[0]) * kpt4[3 * i + 0] + inputBox[0] ]; keypoints2.push({ - part: bodyParts2[i], + part: kpt3[i], score: Math.round(100 * score2) / 100, positionRaw, position: [ @@ -9814,9 +9922,19 @@ async function parseMultiPose(res, config3, image24, inputBox) { }); } } - const boxRaw2 = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]]; - const box4 = [Math.trunc(boxRaw2[0] * (image24.shape[2] || 0)), Math.trunc(boxRaw2[1] * (image24.shape[1] || 0)), Math.trunc(boxRaw2[2] * (image24.shape[2] || 0)), Math.trunc(boxRaw2[3] * (image24.shape[1] || 0))]; - bodies.push({ id, score: totalScore, boxRaw: boxRaw2, box: box4, keypoints: [...keypoints2] }); + const [box4, boxRaw2] = createBox2(keypoints2); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected3)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints2.find((kp) => kp.part === indexes[i]); + const pt1 = keypoints2.find((kp) => kp.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + bodies.push({ id, score: totalScore, boxRaw: boxRaw2, box: box4, keypoints: [...keypoints2], annotations: annotations2 }); } } bodies.sort((a, b) => b.score - a.score); @@ -9832,7 +9950,7 @@ async function predict9(input, config3) { let bodies = []; if (!config3.skipFrame) cachedBoxes.length = 0; - skipped6++; + skipped7++; for (let i = 0; i < cachedBoxes.length; i++) { t.crop = tfjs_esm_exports.image.cropAndResize(input, [cachedBoxes[i]], [0], [inputSize6, inputSize6], "bilinear"); t.cast = tfjs_esm_exports.cast(t.crop, "int32"); @@ -9842,7 +9960,7 @@ async function predict9(input, config3) { bodies = bodies.concat(newBodies); Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); } - if (bodies.length !== config3.body.maxDetected && skipped6 > (config3.body.skipFrames || 0)) { + if (bodies.length !== config3.body.maxDetected && skipped7 > (config3.body.skipFrames || 0)) { t.resized = tfjs_esm_exports.image.resizeBilinear(input, [inputSize6, inputSize6], false); t.cast = tfjs_esm_exports.cast(t.resized, "int32"); t.res = await (model8 == null ? void 0 : model8.predict(t.cast)); @@ -9850,13 +9968,13 @@ async function predict9(input, config3) { bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input, [0, 0, 1, 1]) : await parseMultiPose(res, config3, input, [0, 0, 1, 1]); Object.keys(t).forEach((tensor3) => tfjs_esm_exports.dispose(t[tensor3])); cachedBoxes.length = 0; - skipped6 = 0; + skipped7 = 0; } if (config3.skipFrame) { cachedBoxes.length = 0; for (let i = 0; i < bodies.length; i++) { if (bodies[i].keypoints.length > 10) { - const kpts = bodies[i].keypoints.map((kpt) => kpt.position); + const kpts = bodies[i].keypoints.map((kpt4) => kpt4.position); const newBox = scale(kpts, 1.5, [input.shape[2], input.shape[1]]); cachedBoxes.push([...newBox.yxBox]); } @@ -9953,7 +10071,7 @@ var labels = [ // src/object/nanodet.ts var model9; var last3 = []; -var skipped7 = Number.MAX_SAFE_INTEGER; +var skipped8 = Number.MAX_SAFE_INTEGER; var scaleBox = 2.5; async function load10(config3) { if (!model9 || env2.initial) { @@ -10032,15 +10150,15 @@ async function process3(res, inputSize8, outputShape, config3) { return results; } async function predict10(image24, config3) { - if (skipped7 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) { - skipped7++; + if (skipped8 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) { + skipped8++; return last3; } - skipped7 = 0; + skipped8 = 0; if (!env2.kernels.includes("mod") || !env2.kernels.includes("sparsetodense")) return last3; return new Promise(async (resolve) => { - const outputSize3 = [image24.shape[2], image24.shape[1]]; + const outputSize2 = [image24.shape[2], image24.shape[1]]; const resize = tfjs_esm_exports.image.resizeBilinear(image24, [model9.inputSize, model9.inputSize], false); const norm = tfjs_esm_exports.div(resize, 255); const transpose = norm.transpose([0, 3, 1, 2]); @@ -10050,7 +10168,7 @@ async function predict10(image24, config3) { if (config3.object.enabled) objectT = await model9.predict(transpose); tfjs_esm_exports.dispose(transpose); - const obj = await process3(objectT, model9.inputSize, outputSize3, config3); + const obj = await process3(objectT, model9.inputSize, outputSize2, config3); last3 = obj; resolve(obj); }); @@ -10060,7 +10178,7 @@ async function predict10(image24, config3) { var model10; var inputSize7 = 0; var last4 = []; -var skipped8 = Number.MAX_SAFE_INTEGER; +var skipped9 = Number.MAX_SAFE_INTEGER; async function load11(config3) { if (env2.initial) model10 = null; @@ -10124,19 +10242,19 @@ async function process4(res, outputShape, config3) { return results; } async function predict11(input, config3) { - if (skipped8 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) { - skipped8++; + if (skipped9 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) { + skipped9++; return last4; } - skipped8 = 0; + skipped9 = 0; if (!env2.kernels.includes("mod") || !env2.kernels.includes("sparsetodense")) return last4; return new Promise(async (resolve) => { - const outputSize3 = [input.shape[2], input.shape[1]]; + const outputSize2 = [input.shape[2], input.shape[1]]; const resize = tfjs_esm_exports.image.resizeBilinear(input, [inputSize7, inputSize7]); const objectT = config3.object.enabled ? model10 == null ? void 0 : model10.execute(resize, ["tower_0/detections"]) : null; tfjs_esm_exports.dispose(resize); - const obj = await process4(objectT, outputSize3, config3); + const obj = await process4(objectT, outputSize2, config3); last4 = obj; resolve(obj); }); @@ -10227,7 +10345,7 @@ async function process5(input, background, config3) { // src/gear/gear-agegenderrace.ts var model12; -var skipped9 = Number.MAX_SAFE_INTEGER; +var skipped10 = Number.MAX_SAFE_INTEGER; async function load13(config3) { if (env2.initial) model12 = null; @@ -10407,7 +10525,6 @@ async function register(instance) { log("error: humangl:", e.type); log("possible browser memory leak using webgl"); instance.emit("error"); - throw new Error("browser webgl error"); }); config2.canvas.addEventListener("webglcontextrestored", (e) => { log("error: humangl context restored:", e); @@ -10542,10 +10659,8 @@ async function check(instance, force = false) { log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`); } } - if (tfjs_esm_exports.getBackend() === "humangl") { + if (tfjs_esm_exports.getBackend() === "webgpu") { tfjs_esm_exports.ENV.set("WEBGPU_USE_GLSL", true); - tfjs_esm_exports.ENV.set("WEBGL_PACK_DEPTHWISECONV", false); - tfjs_esm_exports.ENV.set("WEBGL_USE_SHAPES_UNIFORMS", true); } tfjs_esm_exports.enableProdMode(); await tfjs_esm_exports.ready(); @@ -10817,109 +10932,24 @@ async function body(inCanvas2, result, drawOptions) { ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]); } } - if (localOptions.drawPoints) { + if (localOptions.drawPoints && result[i].keypoints) { for (let pt = 0; pt < result[i].keypoints.length; pt++) { ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + 2 * (result[i].keypoints[pt].position[2] || 0)}, ${127.5 - 2 * (result[i].keypoints[pt].position[2] || 0)}, 255, 0.5)` : localOptions.color; point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions); } } - if (localOptions.drawLabels) { + if (localOptions.drawLabels && result[i].keypoints) { ctx.font = localOptions.font; - if (result[i].keypoints) { - for (const pt of result[i].keypoints) { - ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + 2 * pt.position[2]}, ${127.5 - 2 * pt.position[2]}, 255, 0.5)` : localOptions.color; - ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4); - } + for (const pt of result[i].keypoints) { + ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + 2 * pt.position[2]}, ${127.5 - 2 * pt.position[2]}, 255, 0.5)` : localOptions.color; + ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4); } } - if (localOptions.drawPolygons && result[i].keypoints) { - let part; - const points = []; - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - if (points.length === 4) - lines(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftKnee"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftAnkle"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftHeel"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftFoot"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightKnee"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightAnkle"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightHeel"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightFoot"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftElbow"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftWrist"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftPalm"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightElbow"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightWrist"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightPalm"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); + if (localOptions.drawPolygons && result[i].keypoints && result[i].annotations) { + for (const part of Object.values(result[i].annotations)) { + for (const connected4 of part) + curves(ctx, connected4, localOptions); + } } } } @@ -11409,15 +11439,15 @@ function calc(newResult) { if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; const keypoints3 = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints.map((landmark, j) => landmark.map((coord, k) => ((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) : []; - const annotations3 = {}; + const annotations2 = {}; if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) bufferedResult.hand[i].annotations = newResult.hand[i].annotations; if (newResult.hand[i].annotations) { for (const key of Object.keys(newResult.hand[i].annotations)) { - annotations3[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0] ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor)) : null; + annotations2[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0] ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor)) : null; } } - bufferedResult.hand[i] = { ...newResult.hand[i], box: box4, boxRaw: boxRaw2, keypoints: keypoints3, annotations: annotations3 }; + bufferedResult.hand[i] = { ...newResult.hand[i], box: box4, boxRaw: boxRaw2, keypoints: keypoints3, annotations: annotations2 }; } } if (!bufferedResult.face || newResult.face.length !== bufferedResult.face.length) { diff --git a/dist/human.esm-nobundle.js.map b/dist/human.esm-nobundle.js.map index 31cbfbd8..ee8a08fa 100644 --- a/dist/human.esm-nobundle.js.map +++ b/dist/human.esm-nobundle.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/util/util.ts", "../src/config.ts", "tfjs.esm.js", "../src/image/imagefx.ts", "../src/util/env.ts", "../src/image/image.ts", "../src/face/facemeshcoords.ts", "../src/face/facemeshutil.ts", "../src/face/blazeface.ts", "../src/face/iris.ts", "../src/face/facemesh.ts", "../src/face/faceres.ts", "../src/gear/emotion.ts", "../src/body/posenetutils.ts", "../src/body/posenet.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/hand/fingerdef.ts", "../src/hand/fingergesture.ts", "../src/hand/fingerpose.ts", "../src/handpose/handpose.ts", "../src/util/box.ts", "../src/hand/handtrack.ts", "../src/body/annotations.ts", "../src/body/blazepose.ts", "../src/body/efficientpose.ts", "../src/body/movenet.ts", "../src/object/labels.ts", "../src/object/nanodet.ts", "../src/object/centernet.ts", "../src/segmentation/segmentation.ts", "../src/gear/gear-agegenderrace.ts", "../src/models.ts", "../src/tfjs/humangl.ts", "../src/tfjs/backend.ts", "../src/util/draw.ts", "../src/face/angles.ts", "../src/face/face.ts", "../src/gesture/gesture.ts", "../src/util/interpolate.ts", "../src/face/match.ts", "../src/util/persons.ts", "../src/sample.ts", "../src/warmup.ts", "../src/human.ts"], - "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`modelpath error: ${path} expecting json file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: checks current config validity\nexport function validate(defaults, config, parent = 'config', msgs: Array<{ reason: string, where: string, expected?: string }> = []) {\n for (const key of Object.keys(config)) {\n if (typeof config[key] === 'object') {\n validate(defaults[key], config[key], key, msgs);\n } else {\n const defined = defaults && (typeof defaults[key] !== 'undefined');\n if (!defined) msgs.push({ reason: 'unknown property', where: `${parent}.${key} = ${config[key]}` });\n const same = defaults && typeof defaults[key] === typeof config[key];\n if (defined && !same) msgs.push({ reason: 'property type mismatch', where: `${parent}.${key} = ${config[key]}`, expected: typeof defaults[key] });\n }\n // ok = ok && defined && same;\n }\n if (config.debug && parent === 'config' && msgs.length > 0) log('invalid configuration', msgs);\n return msgs;\n}\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data: Array) => data.reduce((acc: Array, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n\n// helper function: async wait\nexport async function wait(time) {\n const waiting = new Promise((resolve) => setTimeout(() => resolve(true), time));\n await waiting;\n}\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/** Dectector part of face configuration */\nexport interface FaceDetectorConfig {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n}\n\n/** Mesh part of face configuration */\nexport interface FaceMeshConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Iris part of face configuration */\nexport interface FaceIrisConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Description or face embedding part of face configuration\n * - also used by age and gender detection\n */\nexport interface FaceDescriptionConfig {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n}\n\n/** Emotion part of face configuration */\nexport interface FaceEmotionConfig {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n}\n\n/** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor\n*/\nexport interface FaceConfig {\n enabled: boolean,\n detector: Partial,\n mesh: Partial,\n iris: Partial,\n description: Partial,\n emotion: Partial,\n}\n\n/** Controlls and configures all body detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n * - detector: optional body detector\n *\n * `maxDetected` is valid for `posenet` and `movenet-multipose` as other models are single-pose only\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `posenet.json`, `blazepose.json`, `efficientpose.json`, `movenet-lightning.json`, `movenet-thunder.json`, `movenet-multipose.json`\n*/\nexport interface BodyConfig {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n detector?: {\n modelPath: string\n },\n}\n\n/** Controlls and configures all hand detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n *\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `detector.modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `handdetect.json` and `handtrack.json`\n*/\nexport interface HandConfig {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath?: string,\n },\n skeleton: {\n modelPath?: string,\n },\n}\n\n/** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `mb3-centernet.json` and `nanodet.json`\n*/\nexport interface ObjectConfig {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n}\n\n/** Controlls and configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - blur: blur segmentation output by pixels for more realistic image\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `selfie.json` and `meet.json`\n\n*/\nexport interface SegmentationConfig {\n enabled: boolean,\n modelPath: string,\n blur: number,\n}\n\n/** Run input through image filters before inference\n * - available only in Browser environments\n * - image filters run with near-zero latency as they are executed on the GPU using WebGL\n*/\nexport interface FilterConfig {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n}\n\n/** Controlls gesture detection */\nexport interface GestureConfig {\n enabled: boolean,\n}\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n *\n * Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L292)\n */\nexport interface Config {\n /** Backend used for TFJS operations\n * Valid build-in backends are:\n * - Browser: `cpu`, `wasm`, `webgl`, `humangl`\n * - NodeJS: `cpu`, `wasm`, `tensorflow`\n *\n * Experimental:\n * - Browser: `webgpu` - requires custom build of `tfjs-backend-webgpu`\n *\n * Defaults: `humangl` for browser and `tensorflow` for nodejs\n */\n backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu',\n // backend: string;\n\n /** Path to *.wasm files if backend is set to `wasm`\n * - if not set, auto-detects to link to CDN `jsdelivr` when running in browser\n */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n // warmup: string;\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Internal Variable */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n *\n * {@link FilterConfig}\n */\n filter: Partial,\n\n /** {@link GestureConfig} */\n gesture: Partial;\n\n /** {@link FaceConfig} */\n face: Partial,\n\n /** {@link BodyConfig} */\n body: Partial,\n\n /** {@link HandConfig} */\n hand: Partial,\n\n /** {@link ObjectConfig} */\n object: Partial,\n\n /** {@link SegmentationConfig} */\n segmentation: Partial,\n}\n\n/**\n * [See all default Config values...](https://github.com/vladmandic/human/blob/main/src/config.ts#L244)\n *\n */\nconst config: Config = {\n backend: '', // select tfjs backend to use, leave empty to use default backend\n // for browser environments: 'webgl', 'wasm', 'cpu', or 'humangl' (which is a custom version of webgl)\n // for nodejs environments: 'tensorflow', 'wasm', 'cpu'\n // default set to `humangl` for browsers and `tensorflow` for nodejs\n modelBasePath: '', // base path for all models\n // default set to `../models/` for browsers and `file://models/` for nodejs\n wasmPath: '', // path for wasm binaries, only used for backend: wasm\n // default set to download from jsdeliv during Human class instantiation\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 1, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 11, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head does not move fast\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n // in which case user is reponsible for disposing the tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 12, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 13, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n detector: {\n modelPath: '', // optional body detector\n },\n maxDetected: -1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet and movenet-multipose as other models detects single pose\n // set to -1 to autodetect based on number of detected faces\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 1, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n // only valid for `handdetect` variation\n skipFrames: 14, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.2, // ammount of overlap between two detected objects before one object is removed\n maxDetected: -1, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n // set to -1 to autodetect based on number of detected faces\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handtrack.json', // hand detector model, can be absolute path or relative to modelBasePath\n // can be 'handdetect' or 'handtrack'\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 15, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // controlls and configures all body segmentation module\n // removes background from input containing person\n // if segmentation is enabled it will run as preprocessing task before any other model\n // alternatively leave it disabled and use it on-demand using human.segmentation method which can\n // remove background or replace it with user-provided background\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n blur: 8, // blur segmentation output by n pixels for more realistic image\n },\n};\n\nexport { config as defaults };\n", "/*\n Human\n homepage: \n author: '\n*/\n\n// tfjs/tf-browser.ts\nexport * from \"@tensorflow/tfjs/dist/index.js\";\nexport * from \"@tensorflow/tfjs-backend-webgl/dist/index.js\";\nexport * from \"@tensorflow/tfjs-backend-wasm/dist/index.js\";\n\n// dist/tfjs.version.js\nvar version = \"3.9.0\";\nvar version2 = \"3.9.0\";\nvar version3 = \"3.9.0\";\nvar version4 = \"3.9.0\";\nvar version5 = \"3.9.0\";\nvar version6 = \"3.9.0\";\nvar version7 = \"3.9.0\";\nvar version8 = \"3.9.0\";\nvar version9 = {\n tfjs: version,\n \"tfjs-core\": version2,\n \"tfjs-data\": version3,\n \"tfjs-layers\": version4,\n \"tfjs-converter\": version5,\n \"tfjs-backend-cpu\": version6,\n \"tfjs-backend-webgl\": version7,\n \"tfjs-backend-wasm\": version8\n};\nexport {\n version9 as version\n};\n", "/**\n * Image Filters in WebGL algoritm implementation\n *\n * Based on: [WebGLImageFilter](https://github.com/phoboslab/WebGLImageFilter)\n *\n * This module is written in ES5 JS and does not conform to code and style standards\n */\n\n// @ts-nocheck\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('filter: gl compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('filter: gl link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('filter: context failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport { mergeDeep } from './util';\n\nexport type Env = {\n browser: undefined | boolean,\n node: undefined | boolean,\n worker: undefined | boolean,\n platform: undefined | string,\n agent: undefined | string,\n backends: string[],\n initial: boolean,\n tfjs: {\n version: undefined | string,\n },\n offscreen: undefined | boolean,\n wasm: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n simd: undefined | boolean,\n multithread: undefined | boolean,\n },\n webgl: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n version: undefined | string,\n renderer: undefined | string,\n },\n webgpu: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n adapter: undefined | string,\n },\n kernels: string[],\n Canvas: undefined,\n Image: undefined,\n ImageData: undefined,\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let env: Env = {\n browser: undefined,\n node: undefined,\n worker: undefined,\n platform: undefined,\n agent: undefined,\n initial: true,\n backends: [],\n offscreen: undefined,\n tfjs: {\n version: undefined,\n },\n wasm: {\n supported: undefined,\n backend: undefined,\n simd: undefined,\n multithread: undefined,\n },\n webgl: {\n supported: undefined,\n backend: undefined,\n version: undefined,\n renderer: undefined,\n },\n webgpu: {\n supported: undefined,\n backend: undefined,\n adapter: undefined,\n },\n kernels: [],\n Canvas: undefined,\n Image: undefined,\n ImageData: undefined,\n};\n\nexport async function cpuInfo() {\n const cpu = { model: '', flags: [] };\n if (env.node && env.platform?.startsWith('linux')) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n try {\n const data = fs.readFileSync('/proc/cpuinfo').toString();\n for (const line of data.split('\\n')) {\n if (line.startsWith('model name')) {\n cpu.model = line.match(/:(.*)/g)[0].replace(':', '').trim();\n }\n if (line.startsWith('flags')) {\n cpu.flags = line.match(/:(.*)/g)[0].replace(':', '').trim().split(' ').sort();\n }\n }\n } catch { /**/ }\n }\n if (!env['cpu']) Object.defineProperty(env, 'cpu', { value: cpu });\n else env['cpu'] = cpu;\n}\n\nexport async function backendInfo() {\n // analyze backends\n env.backends = Object.keys(tf.engine().registryFactory);\n env.wasm.supported = typeof WebAssembly !== 'undefined';\n env.wasm.backend = env.backends.includes('wasm');\n if (env.wasm.supported && env.wasm.backend && tf.getBackend() === 'wasm') {\n env.wasm.simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n env.wasm.multithread = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n }\n\n const c = image.canvas(100, 100);\n const ctx = c ? c.getContext('webgl2') : undefined; // causes too many gl contexts\n // const ctx = typeof tf.backend().getGPGPUContext !== undefined ? tf.backend().getGPGPUContext : null;\n env.webgl.supported = typeof ctx !== 'undefined';\n env.webgl.backend = env.backends.includes('webgl');\n if (env.webgl.supported && env.webgl.backend && (tf.getBackend() === 'webgl' || tf.getBackend() === 'humangl')) {\n // @ts-ignore getGPGPUContext only exists on WebGL backend\n const gl = tf.backend().gpgpu !== 'undefined' ? await tf.backend().getGPGPUContext().gl : null;\n if (gl) {\n env.webgl.version = gl.getParameter(gl.VERSION);\n env.webgl.renderer = gl.getParameter(gl.RENDERER);\n }\n }\n\n env.webgpu.supported = env.browser && typeof navigator['gpu'] !== 'undefined';\n env.webgpu.backend = env.backends.includes('webgpu');\n if (env.webgpu.supported) env.webgpu.adapter = (await navigator['gpu'].requestAdapter())?.name;\n\n // enumerate kernels\n env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());\n}\n\nexport async function get() {\n env.browser = typeof navigator !== 'undefined';\n env.node = typeof process !== 'undefined';\n // @ts-ignore WorkerGlobalScope evaluated in browser only\n env.worker = env.browser ? (typeof WorkerGlobalScope !== 'undefined') : undefined;\n env.tfjs.version = tf.version_core;\n\n // offscreencanvas supported?\n env.offscreen = typeof env.offscreen === 'undefined' ? typeof OffscreenCanvas !== 'undefined' : env.offscreen;\n // get platform and agent\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n env.platform = (platformMatch && platformMatch[0]) ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n env.agent = navigator.userAgent.replace(raw[0], '');\n if (env.platform[1]) env.agent = env.agent.replace(raw[1], '');\n env.agent = env.agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n env.platform = `${process.platform} ${process.arch}`;\n env.agent = `NodeJS ${process.version}`;\n }\n await backendInfo();\n\n // get cpu info\n // await cpuInfo();\n}\n\nexport async function set(obj) {\n env = mergeDeep(env, obj);\n}\n", "/**\n * Image Processing algorithm implementation\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport type { Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\n\nexport type Input = Tensor | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | typeof Image | typeof env.Canvas;\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// @ts-ignore // imagefx is js module that should be converted to a class\nlet fx: fxImage.GLImageFilter | null; // instance of imagefx\n\nexport function canvas(width, height): HTMLCanvasElement | OffscreenCanvas {\n let c;\n if (env.browser) {\n if (env.offscreen) {\n c = new OffscreenCanvas(width, height);\n } else {\n c = document.createElement('canvas');\n c.width = width;\n c.height = height;\n }\n } else {\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n }\n // if (!c) throw new Error('cannot create canvas');\n return c;\n}\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input: Input, config: Config): { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null } {\n let tensor;\n if (!input) {\n // throw new Error('input is missing');\n if (config.debug) log('input is missing');\n return { tensor: null, canvas: null }; // video may become temporarily unavailable due to onresize\n }\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof env.Canvas !== 'undefined' && input instanceof env.Canvas)\n && !(typeof globalThis.Canvas !== 'undefined' && input instanceof globalThis.Canvas)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if ((input as Tensor)['isDisposedInternal']) throw new Error('input tensor is disposed');\n if ((input as Tensor).shape && (input as Tensor).shape.length === 4 && (input as unknown as Tensor).shape[0] === 1 && (input as unknown as Tensor).shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${(input as Tensor).shape}`);\n } else {\n // check if resizing will be needed\n if (typeof input['readyState'] !== 'undefined' && input['readyState'] <= 2) {\n if (config.debug) log('input stream is not ready');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) {\n if (config.debug) log('cannot determine input dimensions');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);\n }\n\n // create our canvas and resize it if needed\n if ((config.filter.width || 0) > 0) targetWidth = config.filter.width;\n else if ((config.filter.height || 0) > 0) targetWidth = originalWidth * ((config.filter.height || 0) / originalHeight);\n if ((config.filter.height || 0) > 0) targetHeight = config.filter.height;\n else if ((config.filter.width || 0) > 0) targetHeight = originalHeight * ((config.filter.width || 0) / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) inCanvas = canvas(targetWidth, targetHeight);\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if ((typeof ImageData !== 'undefined') && (input instanceof ImageData)) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n // imagefx transforms using gl\n if (config.filter.enabled && env.webgl.supported) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = canvas(inCanvas?.width, inCanvas?.height);\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = env.browser ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n const shape = [outCanvas.height, outCanvas.width, 3];\n const pixels = tf.tensor3d(outCanvas.data, shape, 'float32');\n tensor = tf.expandDims(pixels, 0);\n tf.dispose(pixels);\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n // create tensor from image if tensor is not already defined\n if (!tensor) {\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'float32');\n } else if ((typeof ImageData !== 'undefined') && (outCanvas instanceof ImageData)) { // if input is imagedata, just use it\n pixels = tf.browser ? tf.browser.fromPixels(outCanvas) : null;\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we cant use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = canvas(targetWidth, targetHeight);\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n try {\n pixels = (tf.browser && env.browser) ? tf.browser.fromPixels(tempCanvas) : null;\n } catch (err) {\n throw new Error('browser webgl error');\n }\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we cant use canvas as-is as it already has a context, so we do a silly one more canvas and do fromPixels on ImageData instead\n const tempCanvas = canvas(targetWidth, targetHeight);\n if (!tempCanvas) return { tensor: null, canvas: inCanvas };\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n if (!tempCtx) return { tensor: null, canvas: inCanvas };\n tempCtx.drawImage(outCanvas, 0, 0);\n const data = tempCtx.getImageData(0, 0, targetWidth, targetHeight);\n if (tf.browser && env.browser) {\n pixels = tf.browser.fromPixels(data);\n } else {\n pixels = tf.tidy(() => {\n const imageData = tf.tensor(Array.from(data.data), [targetWidth, targetHeight, 4]);\n const channels = tf.split(imageData, 4, 2); // split rgba to channels\n const rgb = tf.stack([channels[0], channels[1], channels[2]], 2); // stack channels back to rgb and ignore alpha\n const expand = tf.reshape(rgb, [imageData.shape[0], imageData.shape[1], 3]); // move extra dim from the end of tensor and use it as batch number instead\n return expand;\n });\n }\n }\n if (pixels) {\n const casted = tf.cast(pixels, 'float32');\n tensor = tf.expandDims(casted, 0);\n tf.dispose(pixels);\n tf.dispose(casted);\n } else {\n tensor = tf.zeros([1, targetWidth, targetHeight, 3]);\n throw new Error('cannot create tensor from input');\n }\n }\n }\n return { tensor, canvas: (config.filter.return ? outCanvas : null) };\n}\n\nlet lastInputSum = 0;\nlet lastCacheDiff = 1;\nexport async function skip(config, input: Tensor) {\n if (config.cacheSensitivity === 0) return false;\n const resizeFact = 32;\n if (!input.shape[1] || !input.shape[2]) return false;\n const reduced: Tensor = tf.image.resizeBilinear(input, [Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);\n\n // use tensor sum\n /*\n const sumT = this.tf.sum(reduced);\n const sum = await sumT.data()[0] as number;\n sumT.dispose();\n */\n // use js loop sum, faster than uploading tensor to gpu calculating and downloading back\n const reducedData = await reduced.data(); // raw image rgb array\n tf.dispose(reduced);\n let sum = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum += reducedData[3 * i + 2]; // look only at green value of each pixel\n\n const diff = 100 * (Math.max(sum, lastInputSum) / Math.min(sum, lastInputSum) - 1);\n lastInputSum = sum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n const skipFrame = diff < Math.max(config.cacheSensitivity, lastCacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n lastCacheDiff = diff > 10 * config.cacheSensitivity ? 0 : diff;\n // console.log('skipFrame', skipFrame, this.config.cacheSensitivity, diff);\n return skipFrame;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nexport const meshAnnotations = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, meshAnnotations['midwayBetweenEyes'][0]],\n};\n\nexport const blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121, 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92, 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4, 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244, 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26, 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53, 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153, 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202, 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149, 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102, 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195, 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108, 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7, 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2, 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209, 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86, 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239, 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226, 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238, 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220, 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357, 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304, 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364, 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17, 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261, 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363, 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293, 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287, 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271, 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351, 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15, 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311, 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454, 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370, 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379, 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446, 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414, 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291, 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433, 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341, 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290, 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420, 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398, 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39, 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74, 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129, 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148, 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126, 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91, 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51, 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210, 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210, 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16, 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218, 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66, 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65, 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2, 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209, 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194, 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4, 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230, 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213, 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215, 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297, 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410, 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4, 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269, 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438, 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349, 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281, 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257, 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304, 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404, 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351, 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276, 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265, 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251, 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374, 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459, 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306, 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358, 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256, 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305, 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360, 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport type { Box, Point } from '../result';\n\nexport const createBox = (startEndTensor) => ({ startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]), endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]) });\n\nexport const disposeBox = (t) => tf.dispose([t.startPoint, t.endPoint]);\n\nexport const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])];\n\nexport const getBoxCenter = (box): [number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2];\n\nexport const getClampedBox = (box, input): Box => (box ? [\n Math.trunc(Math.max(0, box.startPoint[0])),\n Math.trunc(Math.max(0, box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), box.endPoint[1]) - Math.max(0, box.startPoint[1])),\n] : [0, 0, 0, 0]);\n\nexport const getRawBox = (box, input): Box => (box ? [\n box.startPoint[0] / (input.shape[2] || 0),\n box.startPoint[1] / (input.shape[1] || 0),\n (box.endPoint[0] - box.startPoint[0]) / (input.shape[2] || 0),\n (box.endPoint[1] - box.startPoint[1]) / (input.shape[1] || 0),\n] : [0, 0, 0, 0]);\n\nexport const scaleBoxCoordinates = (box, factor) => {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n};\n\nexport const cutBoxFromImageAndResize = (box, image, cropSize) => {\n const h = image.shape[1];\n const w = image.shape[2];\n return tf.image.cropAndResize(image, [[box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w]], [0], cropSize);\n};\n\nexport const enlargeBox = (box, factor = 1.5) => {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize: [number, number] = [factor * size[0] / 2, factor * size[1] / 2];\n return { startPoint: [center[0] - halfSize[0], center[1] - halfSize[1]] as Point, endPoint: [center[0] + halfSize[0], center[1] + halfSize[1]] as Point, landmarks: box.landmarks };\n};\n\nexport const squarifyBox = (box) => {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize = Math.max(...size) / 2;\n return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)] as Point, endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)] as Point, landmarks: box.landmarks };\n};\n\nexport const calculateLandmarksBoundingBox = (landmarks) => {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks };\n};\n\nexport const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n\nexport const normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n\nexport const computeRotation = (point1, point2) => normalizeRadians(Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]));\n\nexport const radToDegrees = (rad) => rad * 180 / Math.PI;\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport const dot = (v1, v2) => {\n let product = 0;\n for (let i = 0; i < v1.length; i++) product += v1[i] * v2[i];\n return product;\n};\n\nexport const getColumnFrom2DArr = (arr, columnIndex) => {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) column.push(arr[i][columnIndex]);\n return column;\n};\n\nexport const multiplyTransformMatrices = (mat1, mat2) => {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n return product;\n};\n\nexport const buildRotationMatrix = (rotation, center) => {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n};\n\nexport const invertTransformMatrix = (matrix) => {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [-dot(rotationComponent[0], translationComponent), -dot(rotationComponent[1], translationComponent)];\n return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];\n};\n\nexport const rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];\n\nexport const xyDistanceBetweenPoints = (a, b) => Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n\nexport function generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) anchors.push([anchorX, anchorY]);\n }\n }\n }\n return anchors;\n}\n\nexport function transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize) {\n const boxSize = getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / inputSize * (coord[0] - inputSize / 2),\n boxSize[1] / inputSize * (coord[1] - inputSize / 2),\n coord[2] || 0,\n ]));\n const coordsRotationMatrix = (angle !== 0) ? buildRotationMatrix(angle, [0, 0]) : IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? invertTransformMatrix(rotationMatrix) : IDENTITY_MATRIX;\n const boxCenter = [...getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])),\n Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])),\n Math.round(coord[2] || 0),\n ]));\n}\n\nexport function correctFaceRotation(box, input, inputSize) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= coords.meshLandmarks.count) ? coords.meshLandmarks.symmetryLine : coords.blazeFaceLandmarks.symmetryLine;\n const angle: number = computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter: Point = getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized: Point = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotated = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n const rotationMatrix = buildRotationMatrix(-angle, faceCenter);\n const cut = cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotated, [inputSize, inputSize]);\n const face = tf.div(cut, 255);\n tf.dispose(cut);\n tf.dispose(rotated);\n return [angle, rotationMatrix, face];\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as util from './facemeshutil';\nimport type { Config } from '../config';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\n\nconst keypointsCount = 6;\nlet model: GraphModel | null;\nlet anchorsData: [number, number][] = [];\nlet anchors: Tensor | null = null;\nlet inputSize = 0;\n\n// export const size = () => (model && model.inputs[0].shape ? model.inputs[0].shape[2] : 0);\nexport const size = () => inputSize;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n anchorsData = util.generateAnchors(inputSize);\n anchors = tf.tensor2d(anchorsData);\n return model;\n}\n\nfunction decodeBounds(boxOutputs) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport async function getBoxes(inputImage: Tensor, config: Config) {\n // sanity check on input\n if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return { boxes: [] };\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]);\n const normalizedImage = tf.sub(tf.div(resizedImage, 127.5), 0.5);\n const res = model?.execute(normalizedImage);\n let batchOut;\n if (Array.isArray(res)) { // are we using tfhub or pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = tf.squeeze(concat, 0);\n } else {\n batchOut = tf.squeeze(res); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.squeeze(tf.sigmoid(logits)); // inside tf.tidy\n return [batchOut, boxesOut, scoresOut];\n });\n\n const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, (config.face.detector?.maxDetected || 0), (config.face.detector?.iouThreshold || 0), (config.face.detector?.minConfidence || 0));\n const nms = await nmsTensor.array();\n tf.dispose(nmsTensor);\n const annotatedBoxes: Array<{ box: { startPoint: Tensor, endPoint: Tensor }, landmarks: Tensor, anchor: [number, number] | undefined, confidence: number }> = [];\n const scoresData = await scores.data();\n for (let i = 0; i < nms.length; i++) {\n const confidence = scoresData[nms[i]];\n if (confidence > (config.face.detector?.minConfidence || 0)) {\n const boundingBox = tf.slice(boxes, [nms[i], 0], [1, -1]);\n const landmarks = tf.tidy(() => tf.reshape(tf.squeeze(tf.slice(batch, [nms[i], keypointsCount - 1], [1, -1])), [keypointsCount, -1]));\n annotatedBoxes.push({ box: util.createBox(boundingBox), landmarks, anchor: anchorsData[nms[i]], confidence });\n tf.dispose(boundingBox);\n }\n }\n tf.dispose(batch);\n tf.dispose(boxes);\n tf.dispose(scores);\n\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize],\n };\n}\n", "import * as coords from './facemeshcoords';\nimport * as util from './facemeshutil';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log, join } from '../util/util';\nimport type { Config } from '../config';\nimport type { Point } from '../result';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\n\nconst irisEnlarge = 2.3;\n\nconst leftOutline = coords.meshAnnotations['leftEyeLower0'];\nconst rightOutline = coords.meshAnnotations['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.iris?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.meshAnnotations[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n\n// eslint-disable-next-line class-methods-use-this\nexport const getLeftToRightEyeDepthDifference = (rawCoords) => {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n};\n\n// Returns a box describing a cropped region around the eye fit for passing to the iris model.\nexport const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false, meshSize) => {\n const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), irisEnlarge));\n const boxSize = util.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / meshSize,\n box.startPoint[0] / meshSize, box.endPoint[1] / meshSize,\n box.endPoint[0] / meshSize,\n ]], [0], [inputSize, inputSize]);\n if (flip && env.kernels.includes('flipleftright')) {\n const flipped = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n tf.dispose(crop);\n crop = flipped;\n }\n return { box, boxSize, crop };\n};\n\n// Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\nexport const getEyeCoords = (eyeData, eyeBox, eyeBoxSize, flip = false) => {\n const eyeRawCoords: Array = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / inputSize)) : (x / inputSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / inputSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n};\n\n// The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n// eslint-disable-next-line class-methods-use-this\nexport const getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => {\n const upperCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n};\n\nexport async function augmentIris(rawCoords, face, config, meshSize) {\n if (!model) {\n if (config.debug) log('face mesh iris detection requested, but model is not loaded');\n return rawCoords;\n }\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true, meshSize);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], true, meshSize);\n const combined = tf.concat([leftEyeCrop, rightEyeCrop]);\n tf.dispose(leftEyeCrop);\n tf.dispose(rightEyeCrop);\n const eyePredictions = model.predict(combined) as Tensor;\n tf.dispose(combined);\n const eyePredictionsData = await eyePredictions.data(); // inside tf.tidy\n tf.dispose(eyePredictions);\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n const newCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n return newCoords;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n *\n * Based on:\n * - [**MediaPipe BlazeFace**](https://drive.google.com/file/d/1f39lSzU5Oq-j_OXgS67KfN5wNsoeAZ4V/view)\n * - Facial Spacial Geometry: [**MediaPipe FaceMesh**](https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view)\n * - Eye Iris Details: [**MediaPipe Iris**](https://drive.google.com/file/d/1bsWbokp9AklH2ANjCfmjqEzzxO1CNbMu/view)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as util from './facemeshutil';\nimport * as coords from './facemeshcoords';\nimport * as iris from './iris';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { FaceResult, Point } from '../result';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\ntype BoxCache = { startPoint: Point, endPoint: Point, landmarks: Array, confidence: number, faceConfidence?: number | undefined };\nlet boxCache: Array = [];\nlet model: GraphModel | null = null;\nlet inputSize = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet detectedFaces = 0;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!config.skipFrame || (((detectedFaces !== config.face.detector?.maxDetected) || !config.face.mesh?.enabled)) && (skipped > (config.face.detector?.skipFrames || 0))) { // reset cached boxes\n const newBoxes = await blazeface.getBoxes(input, config); // get results from blazeface detector\n boxCache = []; // empty cache\n for (const possible of newBoxes.boxes) { // extract data from detector\n const startPoint = await possible.box.startPoint.data() as unknown as Point;\n const endPoint = await possible.box.endPoint.data() as unknown as Point;\n const landmarks = await possible.landmarks.array() as Array;\n boxCache.push({ startPoint, endPoint, landmarks, confidence: possible.confidence });\n }\n newBoxes.boxes.forEach((prediction) => tf.dispose([prediction.box.startPoint, prediction.box.endPoint, prediction.landmarks]));\n for (let i = 0; i < boxCache.length; i++) { // enlarge and squarify detected boxes\n const scaledBox = util.scaleBoxCoordinates({ startPoint: boxCache[i].startPoint, endPoint: boxCache[i].endPoint }, newBoxes.scaleFactor);\n const enlargedBox = util.enlargeBox(scaledBox);\n const squarifiedBox = util.squarifyBox(enlargedBox);\n boxCache[i] = { ...squarifiedBox, confidence: boxCache[i].confidence, landmarks: boxCache[i].landmarks };\n }\n skipped = 0;\n } else {\n skipped++;\n }\n\n const faces: Array = [];\n const newBoxes: Array = [];\n let id = 0;\n for (let box of boxCache) {\n let angle = 0;\n let rotationMatrix;\n const face: FaceResult = {\n id: id++,\n mesh: [],\n meshRaw: [],\n box: [0, 0, 0, 0],\n boxRaw: [0, 0, 0, 0],\n score: 0,\n boxScore: 0,\n faceScore: 0,\n annotations: {},\n };\n\n if (config.face.detector?.rotation && config.face.mesh?.enabled && env.kernels.includes('rotatewithoffset')) {\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(box, input, inputSize);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const cut = util.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, input, config.face.mesh?.enabled ? [inputSize, inputSize] : [blazeface.size(), blazeface.size()]);\n face.tensor = tf.div(cut, 255);\n tf.dispose(cut);\n }\n face.boxScore = Math.round(100 * box.confidence) / 100;\n if (!config.face.mesh?.enabled) { // mesh not enabled, return resuts from detector only\n face.box = util.getClampedBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.score = Math.round(100 * box.confidence || 0) / 100;\n face.mesh = box.landmarks.map((pt) => [\n ((box.startPoint[0] + box.endPoint[0])) / 2 + ((box.endPoint[0] + box.startPoint[0]) * pt[0] / blazeface.size()),\n ((box.startPoint[1] + box.endPoint[1])) / 2 + ((box.endPoint[1] + box.startPoint[1]) * pt[1] / blazeface.size()),\n ]);\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key]]]; // add annotations\n } else if (!model) { // mesh enabled, but not loaded\n if (config.debug) log('face mesh detection requested, but model is not loaded');\n } else { // mesh enabled\n const [contours, confidence, contourCoords] = model.execute(face.tensor as Tensor) as Array; // first returned tensor represents facial contours which are already included in the coordinates.\n tf.dispose(contours);\n const faceConfidence = (await confidence.data())[0] as number;\n tf.dispose(confidence);\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = await coordsReshaped.array();\n tf.dispose(contourCoords);\n tf.dispose(coordsReshaped);\n if (faceConfidence < (config.face.detector?.minConfidence || 1)) {\n box.confidence = faceConfidence; // reset confidence of cached box\n } else {\n if (config.face.iris?.enabled) rawCoords = await iris.augmentIris(rawCoords, face.tensor, config, inputSize); // augment results with iris\n face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]);\n box = { ...util.enlargeBox(util.calculateLandmarksBoundingBox(face.mesh), 1.5), confidence: box.confidence }; // redefine box with mesh calculated one\n for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations\n if (config.face.detector?.rotation && config.face.mesh.enabled && config.face.description?.enabled && env.kernels.includes('rotatewithoffset')) { // do rotation one more time with mesh keypoints if we want to return perfect image\n tf.dispose(face.tensor); // dispose so we can overwrite original face\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(box, input, inputSize);\n }\n face.box = util.getClampedBox(box, input); // update detected box with box around the face mesh\n face.boxRaw = util.getRawBox(box, input);\n face.score = Math.round(100 * faceConfidence || 100 * box.confidence || 0) / 100;\n face.faceScore = Math.round(100 * faceConfidence) / 100;\n box = { ...util.squarifyBox(box), confidence: box.confidence, faceConfidence }; // updated stored cache values\n }\n }\n faces.push(face);\n newBoxes.push(box);\n }\n if (config.face.mesh?.enabled) boxCache = newBoxes.filter((a) => a.confidence > (config.face.detector?.minConfidence || 0)); // remove cache entries for detected boxes on low confidence\n detectedFaces = faces.length;\n return faces;\n}\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.mesh?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * FaceRes model implementation\n *\n * Returns Age, Gender, Descriptor\n * Implements Face simmilarity function\n *\n * Based on: [**HSE-FaceRes**](https://github.com/HSE-asavchenko/HSE_FaceRec_tf)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: Array<{\n age: number,\n gender: string,\n genderScore: number,\n descriptor: number[],\n}> = [];\n\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n const modelUrl = join(config.modelBasePath, config.face.description?.modelPath || '');\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(modelUrl) as unknown as GraphModel;\n if (!model) log('load model failed:', config.face.description?.modelPath || '');\n else if (config.debug) log('load model:', modelUrl);\n } else if (config.debug) log('cached model:', modelUrl);\n return model;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n if (!model?.inputs[0].shape) return null; // model has no shape so no point continuing\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n /*\n // just resize to fit the embedding model instead of cropping\n const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n */\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // increase image pseudo-contrast 100%\n // (or do it per-channel so mean is done on each channel)\n // (or calculate histogram and do it based on histogram)\n const mean = merge.mean();\n const factor = 2;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n // silly way of creating pseudo-hdr of image\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = tf.mul(crop, 255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < (config.face.description?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderScore: 0,\n descriptor: [],\n };\n\n if (config.face.description?.enabled) resT = await model?.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n const gender = await resT.find((t) => t.shape[1] === 1).data();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > (config.face.description?.minConfidence || 0)) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const argmax = tf.argMax(resT.find((t) => t.shape[1] === 100), 1);\n const age = (await argmax.data())[0];\n tf.dispose(argmax);\n const all = await resT.find((t) => t.shape[1] === 100).data();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n\n const descriptor = await desc.data();\n obj.descriptor = [...descriptor];\n resT.forEach((t) => tf.dispose(t));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * Emotion model implementation\n *\n * [**Oarriaga**](https://github.com/oarriaga/face_classification)\n */\n\nimport { log, join } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { env } from '../util/env';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model: GraphModel | null;\n// let last: Array<{ score: number, emotion: string }> = [];\nconst last: Array> = [];\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < (config.face.emotion?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n tf.dispose(resize);\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n tf.dispose(red);\n tf.dispose(green);\n tf.dispose(blue);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n tf.dispose(redNorm);\n tf.dispose(greenNorm);\n tf.dispose(blueNorm);\n const normalize = tf.tidy(() => tf.mul(tf.sub(grayscale, 0.5), 2));\n tf.dispose(grayscale);\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion?.enabled) {\n const emotionT = await model?.predict(normalize) as Tensor; // result is already in range 0..1, no need for additional activation\n const data = await emotionT.data();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > (config.face.emotion?.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n tf.dispose(normalize);\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * PoseNet body detection model implementation constants\n * See `posenet.ts` for entry point\n */\n\nimport type { BodyResult } from '../result';\n\nexport const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n\nexport function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence: number) {\n return connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints): [number, number, number, number] {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i) => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)],\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight],\n })),\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: Array; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n // @ts-ignore getter is of unknown type\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "/**\n * PoseNet body detection model implementation\n *\n * Based on: [**PoseNet**](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { BodyResult, Box } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as utils from './posenetutils';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId, sourceKeypoint, targetId, scores, offsets, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scores.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: utils.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = utils.poseChain.map(([parentJoinName, childJoinName]) => ([utils.partIds[parentJoinName], utils.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: utils.partNames[root.part.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId]?.position;\n if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: Array<{ keypoints, box: Box, score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = tf.sub(tf.div(tf.cast(resized, 'float32'), 127.5), 1.0);\n const results: Array = model.execute(normalized, poseNetOutputs) as Array;\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor: Tensor) => tensor.buffer()));\n for (const t of res) tf.dispose(t);\n\n const decoded = await decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = utils.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as BodyResult[];\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "/**\n * HandPose model implementation constants\n * See `handpose.ts` for entry point\n */\n\nexport const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as anchors from './anchors';\nimport type { Tensor, GraphModel } from '../tfjs/types';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model) {\n this.model = model;\n this.anchors = anchors.anchors.map((anchor) => [anchor.x, anchor.y]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSize = (this.model && this.model.inputs && this.model.inputs[0].shape) ? this.model.inputs[0].shape[2] : 0;\n this.inputSizeTensor = tf.tensor1d([this.inputSize, this.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([this.inputSize * 2, this.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(tf.reshape(rawPalmLandmarks, [-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const t: Record = {};\n t.batched = this.model.predict(input) as Tensor;\n t.predictions = tf.squeeze(t.batched);\n t.scores = tf.tidy(() => tf.squeeze(tf.sigmoid(tf.slice(t.predictions, [0, 0], [-1, 1]))));\n const scores = await t.scores.data();\n t.boxes = tf.slice(t.predictions, [0, 1], [-1, 4]);\n t.norm = this.normalizeBoxes(t.boxes);\n // box detection is flaky so we look for 3x boxes than we need results\n t.nms = await tf.image.nonMaxSuppressionAsync(t.norm, t.scores, 3 * config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.array() as Array;\n const hands: Array<{ box: Tensor, palmLandmarks: Tensor, confidence: number }> = [];\n for (const index of nms) {\n const palmBox = tf.slice(t.norm, [index, 0], [1, -1]);\n const palmLandmarks = tf.tidy(() => tf.reshape(this.normalizeLandmarks(tf.slice(t.predictions, [index, 5], [1, 14]), index), [-1, 2]));\n hands.push({ box: palmBox, palmLandmarks, confidence: scores[index] });\n // console.log('handdetector:getBoxes', nms.length, index, scores[index], config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence, palmBox.dataSync());\n }\n for (const tensor of Object.keys(t)) tf.dispose(t[tensor]); // dispose all\n return hands;\n }\n\n async estimateHandBounds(input, config): Promise<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }[]> {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => tf.sub(tf.div(tf.image.resizeBilinear(input, [this.inputSize, this.inputSize]), 127.5), 1));\n const predictions = await this.getBoxes(image, config);\n tf.dispose(image);\n const hands: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = await prediction.box.data();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n tf.dispose(prediction.box);\n tf.dispose(prediction.palmLandmarks);\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport type * as detector from './handdetector';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number } | null>;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n this.inputSize = this.handPoseModel && this.handPoseModel.inputs[0].shape ? this.handPoseModel.inputs[0].shape[2] : 0;\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n\n // console.log('handpipeline:estimateHands:skip criteria', this.skipped, config.hand.skipFrames, !config.hand.landmarks, !config.skipFrame); // should skip hand detector?\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.skipFrame) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{ landmarks: number[], confidence: number, boxConfidence: number, fingerConfidence: number, box: { topLeft: number[], bottomRight: number[] } }> = [];\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && env.kernels.includes('rotatewithoffset') ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = tf.div(croppedInput, 255);\n tf.dispose(croppedInput);\n tf.dispose(rotatedImage);\n const [confidenceT, keypoints] = await this.handPoseModel.predict(handImage) as Array;\n tf.dispose(handImage);\n const confidence = (await confidenceT.data())[0];\n tf.dispose(confidenceT);\n if (confidence >= config.hand.minConfidence / 4) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n tf.dispose(keypoints);\n tf.dispose(keypointsReshaped);\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n // console.log('handpipeline:estimateHands low', confidence);\n this.storedBoxes[i] = null;\n }\n tf.dispose(keypoints);\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: 0,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n landmarks: [],\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n if (hands.length > config.hand.maxDetected) hands.length = config.hand.maxDetected;\n return hands;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nexport const Finger = {\n thumb: 0,\n index: 1,\n middle: 2,\n ring: 3,\n pinky: 4,\n all: [0, 1, 2, 3, 4], // just for convenience\n nameMapping: { 0: 'thumb', 1: 'index', 2: 'middle', 3: 'ring', 4: 'pinky' },\n // Describes mapping of joints based on the 21 points returned by handpose.\n // [0] Palm\n // [1-4] Thumb\n // [5-8] Index\n // [9-12] Middle\n // [13-16] Ring\n // [17-20] Pinky\n pointsMapping: {\n 0: [[0, 1], [1, 2], [2, 3], [3, 4]],\n 1: [[0, 5], [5, 6], [6, 7], [7, 8]],\n 2: [[0, 9], [9, 10], [10, 11], [11, 12]],\n 3: [[0, 13], [13, 14], [14, 15], [15, 16]],\n 4: [[0, 17], [17, 18], [18, 19], [19, 20]],\n },\n getName: (value) => Finger.nameMapping[value],\n getPoints: (value) => Finger.pointsMapping[value],\n};\n\nexport const FingerCurl = {\n none: 0,\n half: 1,\n full: 2,\n nameMapping: { 0: 'none', 1: 'half', 2: 'full' },\n getName: (value) => FingerCurl.nameMapping[value],\n};\n\nexport const FingerDirection = {\n verticalUp: 0,\n verticalDown: 1,\n horizontalLeft: 2,\n horizontalRight: 3,\n diagonalUpRight: 4,\n diagonalUpLeft: 5,\n diagonalDownRight: 6,\n diagonalDownLeft: 7,\n nameMapping: { 0: 'verticalUp', 1: 'verticalDown', 2: 'horizontalLeft', 3: 'horizontalRight', 4: 'diagonalUpRight', 5: 'diagonalUpLeft', 6: 'diagonalDownRight', 7: 'diagonalDownLeft' },\n getName: (value) => FingerDirection.nameMapping[value],\n};\n\nexport class FingerGesture {\n name;\n curls;\n directions;\n weights;\n weightsRelative;\n\n constructor(name) {\n // name (should be unique)\n this.name = name;\n this.curls = {};\n this.directions = {};\n this.weights = [1.0, 1.0, 1.0, 1.0, 1.0];\n this.weightsRelative = [1.0, 1.0, 1.0, 1.0, 1.0];\n }\n\n addCurl(finger, curl, confidence) {\n if (typeof this.curls[finger] === 'undefined') this.curls[finger] = [];\n this.curls[finger].push([curl, confidence]);\n }\n\n addDirection(finger, position, confidence) {\n if (!this.directions[finger]) this.directions[finger] = [];\n this.directions[finger].push([position, confidence]);\n }\n\n setWeight(finger, weight) {\n this.weights[finger] = weight;\n // recalculate relative weights\n const total = this.weights.reduce((a, b) => a + b, 0);\n this.weightsRelative = this.weights.map((el) => el * 5 / total);\n }\n\n matchAgainst(detectedCurls, detectedDirections) {\n let confidence = 0.0;\n // look at the detected curl of each finger and compare with\n // the expected curl of this finger inside current gesture\n for (const fingerIdx in detectedCurls) {\n const detectedCurl = detectedCurls[fingerIdx];\n const expectedCurls = this.curls[fingerIdx];\n if (typeof expectedCurls === 'undefined') {\n // no curl description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible curl of this specific finger\n for (const [expectedCurl, score] of expectedCurls) {\n if (detectedCurl === expectedCurl) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n // same for detected direction of each finger\n for (const fingerIdx in detectedDirections) {\n const detectedDirection = detectedDirections[fingerIdx];\n const expectedDirections = this.directions[fingerIdx];\n if (typeof expectedDirections === 'undefined') {\n // no direction description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible direction of this specific finger\n for (const [expectedDirection, score] of expectedDirections) {\n if (detectedDirection === expectedDirection) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n return confidence / 10;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nimport { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef';\n\n// describe thumbs up gesture \uD83D\uDC4D\nconst ThumbsUp = new FingerGesture('thumbs up');\nThumbsUp.addCurl(Finger.thumb, FingerCurl.none, 1.0);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.verticalUp, 1.0);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.diagonalUpLeft, 0.25);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.diagonalUpRight, 0.25);\nfor (const finger of [Finger.index, Finger.middle, Finger.ring, Finger.pinky]) {\n ThumbsUp.addCurl(finger, FingerCurl.full, 1.0);\n ThumbsUp.addDirection(finger, FingerDirection.horizontalLeft, 1.0);\n ThumbsUp.addDirection(finger, FingerDirection.horizontalRight, 1.0);\n}\n\n// describe Victory gesture \u270C\uFE0F\nconst Victory = new FingerGesture('victory');\nVictory.addCurl(Finger.thumb, FingerCurl.half, 0.5);\nVictory.addCurl(Finger.thumb, FingerCurl.none, 0.5);\nVictory.addDirection(Finger.thumb, FingerDirection.verticalUp, 1.0);\nVictory.addDirection(Finger.thumb, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addCurl(Finger.index, FingerCurl.none, 1.0);\nVictory.addDirection(Finger.index, FingerDirection.verticalUp, 0.75);\nVictory.addDirection(Finger.index, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addCurl(Finger.middle, FingerCurl.none, 1.0);\nVictory.addDirection(Finger.middle, FingerDirection.verticalUp, 1.0);\nVictory.addDirection(Finger.middle, FingerDirection.diagonalUpLeft, 0.75);\nVictory.addCurl(Finger.ring, FingerCurl.full, 1.0);\nVictory.addDirection(Finger.ring, FingerDirection.verticalUp, 0.2);\nVictory.addDirection(Finger.ring, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addDirection(Finger.ring, FingerDirection.horizontalLeft, 0.2);\nVictory.addCurl(Finger.pinky, FingerCurl.full, 1.0);\nVictory.addDirection(Finger.pinky, FingerDirection.verticalUp, 0.2);\nVictory.addDirection(Finger.pinky, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addDirection(Finger.pinky, FingerDirection.horizontalLeft, 0.2);\nVictory.setWeight(Finger.index, 2);\nVictory.setWeight(Finger.middle, 2);\n\nexport default [ThumbsUp, Victory];\n", "/**\n * FingerPose algorithm implementation constants\n *\n * Based on: [**FingerPose***](https://github.com/andypotato/fingerpose)\n */\n\nimport { Finger, FingerCurl, FingerDirection } from './fingerdef';\nimport Gestures from '../hand/fingergesture';\n\nconst minConfidence = 0.7;\nconst options = {\n // curl estimation\n HALF_CURL_START_LIMIT: 60.0,\n NO_CURL_START_LIMIT: 130.0,\n // direction estimation\n DISTANCE_VOTE_POWER: 1.1,\n SINGLE_ANGLE_VOTE_POWER: 0.9,\n TOTAL_ANGLE_VOTE_POWER: 1.6,\n};\n\nfunction calculateSlope(point1x, point1y, point2x, point2y) {\n const value = (point1y - point2y) / (point1x - point2x);\n let slope = Math.atan(value) * 180 / Math.PI;\n if (slope <= 0) slope = -slope;\n else if (slope > 0) slope = 180 - slope;\n return slope;\n}\n\n// point1, point2 are 2d or 3d point arrays (xy[z])\n// returns either a single scalar (2d) or array of two slopes (3d)\nfunction getSlopes(point1, point2) {\n if (!point1 || !point2) return [0, 0];\n const slopeXY = calculateSlope(point1[0], point1[1], point2[0], point2[1]);\n if (point1.length === 2) return slopeXY;\n const slopeYZ = calculateSlope(point1[1], point1[2], point2[1], point2[2]);\n return [slopeXY, slopeYZ];\n}\n\nfunction angleOrientationAt(angle, weightageAt = 1.0) {\n let isVertical = 0;\n let isDiagonal = 0;\n let isHorizontal = 0;\n if (angle >= 75.0 && angle <= 105.0) isVertical = 1 * weightageAt;\n else if (angle >= 25.0 && angle <= 155.0) isDiagonal = 1 * weightageAt;\n else isHorizontal = 1 * weightageAt;\n return [isVertical, isDiagonal, isHorizontal];\n}\n\nfunction estimateFingerCurl(startPoint, midPoint, endPoint) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const start_mid_z_dist = startPoint[2] - midPoint[2];\n const start_end_z_dist = startPoint[2] - endPoint[2];\n const mid_end_z_dist = midPoint[2] - endPoint[2];\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist + start_mid_z_dist * start_mid_z_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist + start_end_z_dist * start_end_z_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist + mid_end_z_dist * mid_end_z_dist);\n let cos_in = (mid_end_dist * mid_end_dist + start_mid_dist * start_mid_dist - start_end_dist * start_end_dist) / (2 * mid_end_dist * start_mid_dist);\n if (cos_in > 1.0) cos_in = 1.0;\n else if (cos_in < -1.0) cos_in = -1.0;\n let angleOfCurve = Math.acos(cos_in);\n angleOfCurve = (57.2958 * angleOfCurve) % 180;\n let fingerCurl;\n if (angleOfCurve > options.NO_CURL_START_LIMIT) fingerCurl = FingerCurl.none;\n else if (angleOfCurve > options.HALF_CURL_START_LIMIT) fingerCurl = FingerCurl.half;\n else fingerCurl = FingerCurl.full;\n return fingerCurl;\n}\n\nfunction estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n if (max_dist_x === Math.abs(start_end_x_dist)) {\n if (start_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else if (max_dist_x === Math.abs(start_mid_x_dist)) {\n if (start_mid_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else {\n if (mid_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n }\n return estimatedDirection;\n}\n\nfunction estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y) {\n let estimatedDirection;\n if (max_dist_y === Math.abs(start_end_y_dist)) {\n if (start_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else if (max_dist_y === Math.abs(start_mid_y_dist)) {\n if (start_mid_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else {\n if (mid_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n }\n return estimatedDirection;\n}\n\nfunction estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n const reqd_vertical_direction = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n const reqd_horizontal_direction = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n if (reqd_vertical_direction === FingerDirection.verticalUp) {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalUpLeft;\n else estimatedDirection = FingerDirection.diagonalUpRight;\n } else {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalDownLeft;\n else estimatedDirection = FingerDirection.diagonalDownRight;\n }\n return estimatedDirection;\n}\n\nfunction calculateFingerDirection(startPoint, midPoint, endPoint, fingerSlopes) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const max_dist_x = Math.max(Math.abs(start_mid_x_dist), Math.abs(start_end_x_dist), Math.abs(mid_end_x_dist));\n const max_dist_y = Math.max(Math.abs(start_mid_y_dist), Math.abs(start_end_y_dist), Math.abs(mid_end_y_dist));\n let voteVertical = 0.0;\n let voteDiagonal = 0.0;\n let voteHorizontal = 0.0;\n const start_end_x_y_dist_ratio = max_dist_y / (max_dist_x + 0.00001);\n if (start_end_x_y_dist_ratio > 1.5) voteVertical += options.DISTANCE_VOTE_POWER;\n else if (start_end_x_y_dist_ratio > 0.66) voteDiagonal += options.DISTANCE_VOTE_POWER;\n else voteHorizontal += options.DISTANCE_VOTE_POWER;\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist);\n const max_dist = Math.max(start_mid_dist, start_end_dist, mid_end_dist);\n let calc_start_point_x = startPoint[0];\n let calc_start_point_y = startPoint[1];\n let calc_end_point_x = endPoint[0];\n let calc_end_point_y = endPoint[1];\n if (max_dist === start_mid_dist) {\n calc_end_point_x = endPoint[0];\n calc_end_point_y = endPoint[1];\n } else if (max_dist === mid_end_dist) {\n calc_start_point_x = midPoint[0];\n calc_start_point_y = midPoint[1];\n }\n const calcStartPoint = [calc_start_point_x, calc_start_point_y];\n const calcEndPoint = [calc_end_point_x, calc_end_point_y];\n const totalAngle = getSlopes(calcStartPoint, calcEndPoint);\n const votes = angleOrientationAt(totalAngle, options.TOTAL_ANGLE_VOTE_POWER);\n voteVertical += votes[0];\n voteDiagonal += votes[1];\n voteHorizontal += votes[2];\n for (const fingerSlope of fingerSlopes) {\n const fingerVotes = angleOrientationAt(fingerSlope, options.SINGLE_ANGLE_VOTE_POWER);\n voteVertical += fingerVotes[0];\n voteDiagonal += fingerVotes[1];\n voteHorizontal += fingerVotes[2];\n }\n // in case of tie, highest preference goes to Vertical,\n // followed by horizontal and then diagonal\n let estimatedDirection;\n if (voteVertical === Math.max(voteVertical, voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n } else if (voteHorizontal === Math.max(voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n } else {\n estimatedDirection = estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n }\n return estimatedDirection;\n}\n\nfunction estimate(landmarks) {\n // step 1: calculate slopes\n const slopesXY: Array = [];\n const slopesYZ: Array = [];\n const fingerCurls: Array = [];\n const fingerDirections: Array = [];\n if (!landmarks) return { curls: fingerCurls, directions: fingerDirections };\n\n // step 1: calculate slopes\n for (const finger of Finger.all) {\n const points = Finger.getPoints(finger);\n const slopeAtXY: Array = [];\n const slopeAtYZ: Array = [];\n for (const point of points) {\n const point1 = landmarks[point[0]];\n const point2 = landmarks[point[1]];\n // calculate single slope\n const slopes = getSlopes(point1, point2);\n const slopeXY = slopes[0];\n const slopeYZ = slopes[1];\n slopeAtXY.push(slopeXY);\n slopeAtYZ.push(slopeYZ);\n }\n slopesXY.push(slopeAtXY);\n slopesYZ.push(slopeAtYZ);\n }\n\n // step 2: calculate orientations\n for (const finger of Finger.all) {\n // start finger predictions from palm - except for thumb\n const pointIndexAt = (finger === Finger.thumb) ? 1 : 0;\n const fingerPointsAt = Finger.getPoints(finger);\n const startPoint = landmarks[fingerPointsAt[pointIndexAt][0]];\n const midPoint = landmarks[fingerPointsAt[pointIndexAt + 1][1]];\n const endPoint = landmarks[fingerPointsAt[3][1]];\n // check if finger is curled\n const fingerCurled = estimateFingerCurl(startPoint, midPoint, endPoint);\n const fingerPosition = calculateFingerDirection(startPoint, midPoint, endPoint, slopesXY[finger].slice(pointIndexAt));\n fingerCurls[finger] = fingerCurled;\n fingerDirections[finger] = fingerPosition;\n }\n return { curls: fingerCurls, directions: fingerDirections };\n}\n\nexport function analyze(keypoints) { // get estimations of curl / direction for each finger\n if (!keypoints || keypoints.length === 0) return null;\n const estimatorRes = estimate(keypoints);\n const landmarks = {};\n for (const fingerIdx of Finger.all) {\n landmarks[Finger.getName(fingerIdx)] = {\n curl: FingerCurl.getName(estimatorRes.curls[fingerIdx]),\n direction: FingerDirection.getName(estimatorRes.directions[fingerIdx]),\n };\n }\n // console.log('finger landmarks', landmarks);\n return landmarks;\n}\n\nexport function match(keypoints) { // compare gesture description to each known gesture\n const poses: Array<{ name: string, confidence: number }> = [];\n if (!keypoints || keypoints.length === 0) return poses;\n const estimatorRes = estimate(keypoints);\n for (const gesture of Gestures) {\n const confidence = gesture.matchAgainst(estimatorRes.curls, estimatorRes.directions);\n if (confidence >= minConfidence) poses.push({ name: gesture.name, confidence });\n }\n // console.log('finger poses', poses);\n return poses;\n}\n", "/**\n * HandPose model implementation\n *\n * Based on: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\nimport * as fingerPose from '../hand/fingerpose';\nimport type { HandResult, Box, Point } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n\n const keypoints = predictions[i].landmarks as unknown as Array;\n\n let box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: Box = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n const landmarks = fingerPose.analyze(keypoints);\n hands.push({\n id: i,\n score: Math.round(100 * predictions[i].confidence) / 100,\n boxScore: Math.round(100 * predictions[i].boxConfidence) / 100,\n fingerScore: Math.round(100 * predictions[i].fingerConfidence) / 100,\n label: 'hand',\n box,\n boxRaw,\n keypoints,\n annotations: annotations as HandResult['annotations'],\n landmarks: landmarks as HandResult['landmarks'],\n });\n }\n return hands;\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (env.initial) {\n handDetectorModel = null;\n handPoseModel = null;\n }\n if (!handDetectorModel || !handPoseModel) {\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector?.modelPath || ''), { fromTFHub: (config.hand.detector?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton?.modelPath || ''), { fromTFHub: (config.hand.skeleton?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector?.modelPath || '');\n else if (config.debug) log('load model:', handDetectorModel['modelUrl']);\n if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton?.modelPath || '');\n else if (config.debug) log('load model:', handPoseModel['modelUrl']);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel);\n handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n return [handDetectorModel, handPoseModel];\n}\n", "import type { Box } from '../result';\n\n// helper function: find box around keypoints, square it and scale it\nexport function scale(keypoints, boxScaleFact, outputSize) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const maxmin = [Math.max(...coords[0]), Math.min(...coords[0]), Math.max(...coords[1]), Math.min(...coords[1])]; // find min/max x/y coordinates\n const center = [(maxmin[0] + maxmin[1]) / 2, (maxmin[2] + maxmin[3]) / 2]; // find center x and y coord of all fingers\n const diff = Math.max(center[0] - maxmin[1], center[1] - maxmin[3], -center[0] + maxmin[0], -center[1] + maxmin[2]) * boxScaleFact; // largest distance from center in any direction\n const box = [\n Math.trunc(center[0] - diff),\n Math.trunc(center[1] - diff),\n Math.trunc(2 * diff),\n Math.trunc(2 * diff),\n ] as Box;\n const boxRaw = [ // work backwards\n box[0] / outputSize[0],\n box[1] / outputSize[1],\n box[2] / outputSize[0],\n box[3] / outputSize[1],\n ] as Box;\n const yxBox = [ // work backwards\n boxRaw[1],\n boxRaw[0],\n boxRaw[3] + boxRaw[1],\n boxRaw[2] + boxRaw[0],\n ] as Box;\n return { box, boxRaw, yxBox };\n}\n", "/**\n * HandTrack model implementation\n *\n * Based on:\n * - Hand Detection & Skeleton: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n * - Hand Tracking: [**HandTracking**](https://github.com/victordibia/handtracking)\n */\n\nimport { log, join } from '../util/util';\nimport { scale } from '../util/box';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { HandResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as fingerPose from './fingerpose';\nimport { fakeOps } from '../tfjs/backend';\n\nconst boxScaleFact = 1.5; // hand finger model prefers slighly larger box\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst modelOutputNodes = ['StatefulPartitionedCall/Postprocessor/Slice', 'StatefulPartitionedCall/Postprocessor/ExpandDims_1'];\n\nconst inputSize = [[0, 0], [0, 0]];\n\nconst classes = ['hand', 'fist', 'pinch', 'point', 'face', 'tip', 'pinchtip'];\n\nlet skipped = 0;\nlet outputSize: Point = [0, 0];\n\ntype HandDetectResult = {\n id: number,\n score: number,\n box: Box,\n boxRaw: Box,\n label: string,\n yxBox: Box,\n}\n\nconst cache: {\n handBoxes: Array,\n fingerBoxes: Array\n tmpBoxes: Array\n} = {\n handBoxes: [],\n fingerBoxes: [],\n tmpBoxes: [],\n};\n\nconst fingerMap = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nexport async function loadDetect(config: Config): Promise {\n // HandTrack Model: Original: TFJS Port: \n if (env.initial) models[0] = null;\n if (!models[0]) {\n // handtrack model has some kernel ops defined in model but those are never referenced and non-existent in tfjs\n // ideally need to prune the model itself\n fakeOps(['tensorlistreserve', 'enter', 'tensorlistfromtensor', 'merge', 'loopcond', 'switch', 'exit', 'tensorliststack', 'nextiteration', 'tensorlistsetitem', 'tensorlistgetitem', 'reciprocal', 'shape', 'split', 'where'], config);\n models[0] = await tf.loadGraphModel(join(config.modelBasePath, config.hand.detector?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[0].modelSignature['inputs']);\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[0] || !models[0]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[0]['modelUrl']);\n } else if (config.debug) log('cached model:', models[0]['modelUrl']);\n return models[0];\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[1].modelSignature['inputs']);\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[1] || !models[1]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[1]['modelUrl']);\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadSkeleton(config);\n return models;\n}\n\nasync function detectHands(input: Tensor, config: Config): Promise {\n const hands: HandDetectResult[] = [];\n if (!input || !models[0]) return hands;\n const t: Record = {};\n const ratio = (input.shape[2] || 1) / (input.shape[1] || 1);\n const height = Math.min(Math.round((input.shape[1] || 0) / 8) * 8, 512); // use dynamic input size but cap at 512\n const width = Math.round(height * ratio / 8) * 8;\n t.resize = tf.image.resizeBilinear(input, [height, width]); // todo: resize with padding\n t.cast = tf.cast(t.resize, 'int32');\n [t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes) as Tensor[];\n t.boxes = tf.squeeze(t.rawBoxes, [0, 2]);\n t.scores = tf.squeeze(t.rawScores, [0]);\n const classScores = tf.unstack(t.scores, 1);\n let id = 0;\n for (let i = 0; i < classScores.length; i++) {\n if (i === 4) continue; // skip faces\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes, classScores[i], config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.data();\n tf.dispose(t.nms);\n for (const res of Array.from(nms)) { // generates results for each class\n const boxSlice = tf.slice(t.boxes, res, 1);\n let yxBox: Box = [0, 0, 0, 0];\n if (config.hand.landmarks) { // scale box\n const detectedBox: Box = await boxSlice.data();\n const boxCenter: Point = [(detectedBox[0] + detectedBox[2]) / 2, (detectedBox[1] + detectedBox[3]) / 2];\n const boxDiff: Box = [+boxCenter[0] - detectedBox[0], +boxCenter[1] - detectedBox[1], -boxCenter[0] + detectedBox[2], -boxCenter[1] + detectedBox[3]];\n yxBox = [boxCenter[0] - boxScaleFact * boxDiff[0], boxCenter[1] - boxScaleFact * boxDiff[1], boxCenter[0] + boxScaleFact * boxDiff[2], boxCenter[1] + boxScaleFact * boxDiff[3]];\n } else { // use box as-is\n yxBox = await boxSlice.data();\n }\n const boxRaw: Box = [yxBox[1], yxBox[0], yxBox[3] - yxBox[1], yxBox[2] - yxBox[0]];\n const box: Box = [Math.trunc(boxRaw[0] * outputSize[0]), Math.trunc(boxRaw[1] * outputSize[1]), Math.trunc(boxRaw[2] * outputSize[0]), Math.trunc(boxRaw[3] * outputSize[1])];\n tf.dispose(boxSlice);\n const scoreSlice = tf.slice(classScores[i], res, 1);\n const score = (await scoreSlice.data())[0];\n tf.dispose(scoreSlice);\n const hand: HandDetectResult = { id: id++, score, box, boxRaw, label: classes[i], yxBox };\n hands.push(hand);\n }\n }\n classScores.forEach((tensor) => tf.dispose(tensor));\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n hands.sort((a, b) => b.score - a.score);\n if (hands.length > (config.hand.maxDetected || 1)) hands.length = (config.hand.maxDetected || 1);\n return hands;\n}\n\nasync function detectFingers(input: Tensor, h: HandDetectResult, config: Config): Promise {\n const hand: HandResult = {\n id: h.id,\n score: Math.round(100 * h.score) / 100,\n boxScore: Math.round(100 * h.score) / 100,\n fingerScore: 0,\n box: h.box,\n boxRaw: h.boxRaw,\n label: h.label,\n keypoints: [],\n landmarks: {} as HandResult['landmarks'],\n annotations: {} as HandResult['annotations'],\n };\n if (input && models[1] && config.hand.landmarks) {\n const t: Record = {};\n if (!h.yxBox) return hand;\n t.crop = tf.image.cropAndResize(input, [h.yxBox], [0], [inputSize[1][0], inputSize[1][1]], 'bilinear');\n t.cast = tf.cast(t.crop, 'float32');\n t.div = tf.div(t.cast, 255);\n [t.score, t.keypoints] = models[1].execute(t.div) as Tensor[];\n // const score = Math.round(100 * (await t.score.data())[0] / 100);\n const rawScore = (await t.score.data())[0];\n const score = (100 - Math.trunc(100 / (1 + Math.exp(rawScore)))) / 100; // reverse sigmoid value\n if (score >= (config.hand.minConfidence || 0)) {\n hand.fingerScore = score;\n t.reshaped = tf.reshape(t.keypoints, [-1, 3]);\n const rawCoords = await t.reshaped.array() as Point[];\n hand.keypoints = (rawCoords as Point[]).map((coord) => [\n (h.box[2] * coord[0] / inputSize[1][0]) + h.box[0],\n (h.box[3] * coord[1] / inputSize[1][1]) + h.box[1],\n (h.box[2] + h.box[3]) / 2 / inputSize[1][0] * (coord[2] || 0),\n ]);\n const updatedBox = scale(hand.keypoints, boxScaleFact, outputSize); // replace detected box with box calculated around keypoints\n h.box = updatedBox.box;\n h.boxRaw = updatedBox.boxRaw;\n h.yxBox = updatedBox.yxBox;\n hand.box = h.box;\n hand.landmarks = fingerPose.analyze(hand.keypoints) as HandResult['landmarks']; // calculate finger landmarks\n for (const key of Object.keys(fingerMap)) { // map keypoints to per-finger annotations\n hand.annotations[key] = fingerMap[key].map((index) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));\n }\n const ratioBoxFrame = Math.min(h.box[2] / (input.shape[2] || 1), h.box[3] / (input.shape[1] || 1));\n if (ratioBoxFrame > 0.05) cache.tmpBoxes.push(h); // if finger detection is enabled, only update cache if fingers are detected and box is big enough\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n return hand;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n outputSize = [input.shape[2] || 0, input.shape[1] || 0];\n let hands: Array = [];\n cache.tmpBoxes = []; // clear temp cache\n if (!config.hand.landmarks) cache.fingerBoxes = cache.handBoxes; // if hand detection only reset finger boxes cache\n if (!config.skipFrame) cache.fingerBoxes = [];\n if ((skipped < (config.hand.skipFrames || 0)) && config.skipFrame) { // just run finger detection while reusing cached boxes\n skipped++;\n hands = await Promise.all(cache.fingerBoxes.map((hand) => detectFingers(input, hand, config))); // run from finger box cache\n } else { // calculate new boxes and run finger detection\n skipped = 0;\n hands = await Promise.all(cache.fingerBoxes.map((hand) => detectFingers(input, hand, config))); // run from finger box cache\n if (hands.length !== config.hand.maxDetected) { // re-run with hand detection only if we dont have enough hands in cache\n cache.handBoxes = await detectHands(input, config);\n hands = await Promise.all(cache.handBoxes.map((hand) => detectFingers(input, hand, config)));\n }\n }\n cache.fingerBoxes = [...cache.tmpBoxes]; // repopulate cache with validated hands\n return hands as HandResult[];\n}\n", "/**\n * BlazePose model implemenation constants\n * See `blazepose.ts` for entry point\n */\n\nexport const full = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftPalm',\n 'rightPalm',\n 'leftIndex',\n 'rightIndex',\n 'leftPinky',\n 'rightPinky',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n 'leftHeel',\n 'rightHeel',\n 'leftFoot',\n 'rightFoot',\n 'midHip',\n 'forehead',\n 'leftThumb',\n 'leftHand',\n 'rightThumb',\n 'rightHand',\n];\n\nexport const upper = [\n 'nose',\n 'leftEyeInside',\n 'leftEye',\n 'leftEyeOutside',\n 'rightEyeInside',\n 'rightEye',\n 'rightEyeOutside',\n 'leftEar',\n 'rightEar',\n 'leftMouth',\n 'rightMouth',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'left:15',\n 'right:16',\n 'left:17',\n 'right:18',\n 'left:19',\n 'right:20',\n 'left:21',\n 'right:22',\n 'leftChest',\n 'rightChest',\n 'neck',\n 'forehead',\n 'left:27',\n 'right:28',\n 'left:29',\n 'right:30',\n];\n", "/**\n * BlazePose model implementation\n *\n * Based on : [**BlazePose**](https://github.com/google/mediapipe/blob/master/mediapipe/modules/pose_detection)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as annotations from './annotations';\n\n// const boxScaleFact = 1.5; // hand finger model prefers slighly larger box\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst outputNodes = ['ld_3d', 'activation_segmentation', 'activation_heatmap', 'world_3d', 'output_poseflag'];\n\nconst inputSize = [[0, 0], [0, 0]];\n\n// let skipped = 0;\nlet outputSize: [number, number] = [0, 0];\n\ntype Keypoints = { score: number, part: string, position: Point, positionRaw: Point };\n\n/*\ntype BodyDetectResult = {\n id: number,\n score: number,\n box: Box,\n boxRaw: Box,\n label: string,\n yxBox: Box,\n}\n\nconst cache: {\n bodyBoxes: Array,\n partBoxes: Array\n tmpBoxes: Array\n} = {\n bodyBoxes: [],\n partBoxes: [],\n tmpBoxes: [],\n};\n*/\n\nexport async function loadDetect(config: Config): Promise {\n if (env.initial) models[0] = null;\n if (!models[0]) {\n models[0] = await tf.loadGraphModel(join(config.modelBasePath, config.body.detector?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[0].modelSignature['inputs']);\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[0] || !models[0]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[0]['modelUrl']);\n } else if (config.debug) log('cached model:', models[0]['modelUrl']);\n return models[0];\n}\n\nexport async function loadPose(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[1].modelSignature['inputs']);\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[1] || !models[1]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[1]['modelUrl']);\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadPose(config);\n return models;\n}\n\n/*\nasync function detectBody(input: Tensor, config: Config): Promise {\n if ((config.body.detector?.modelPath.length || 0) > 0 && models[0]) {\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [inputSize[0][0], inputSize[0][1]]);\n t.res = await models[0]?.predict(t.resize) as Tensor; // [1,2254,13]\n t.logits = tf.slice(t.res, [0, 0, 0], [1, -1, 1]);\n t.sigmoid = tf.sigmoid(t.logits);\n t.rawBoxes = tf.slice(t.res, [0, 0, 1], [1, -1, -1]);\n t.packedBoxes = tf.squeeze(t.rawBoxes); // [2254,12]\n t.scores = tf.squeeze(t.sigmoid); // [2254,1]\n // boxes need to be decoded based on anchors\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n return [];\n}\n*/\n\nasync function detectParts(input: Tensor, config: Config): Promise {\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [inputSize[1][0], inputSize[1][1]]);\n [t.ld/* 1,195 */, t.segmentation/* 1,256,256,1 */, t.heatmap/* 1,64,64,39 */, t.world/* 1,117 */, t.poseflag/* 1,1 */] = await models[1]?.execute(t.resize, outputNodes) as Tensor[]; // [1,2254,13]\n const points = await t.ld.data();\n const keypoints: Array = [];\n const labels = points?.length === 195 ? annotations.full : annotations.upper; // full model has 39 keypoints, upper has 31 keypoints\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n const score = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; // reverse sigmoid value\n // const presence = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100; // reverse sigmoid value\n if (score > (config.body.minConfidence || 0)) {\n keypoints.push({\n part: labels[i],\n position: [\n Math.trunc(outputSize[0] * points[depth * i + 0] / 255), // return normalized x value istead of 0..255\n Math.trunc(outputSize[1] * points[depth * i + 1] / 255), // return normalized y value istead of 0..255\n Math.trunc(points[depth * i + 2]) + 0, // fix negative zero\n ],\n positionRaw: [\n points[depth * i + 0] / 255, // return x value normalized to 0..1\n points[depth * i + 1] / 255, // return y value normalized to 0..1\n points[depth * i + 2] + 0, // fix negative zero\n ],\n score,\n });\n }\n }\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n const box: Box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...x),\n ];\n const boxRaw: Box = [0, 0, 0, 0]; // not yet implemented\n const score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return { id: 0, score, box, boxRaw, keypoints };\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n outputSize = [input.shape[2] || 0, input.shape[1] || 0];\n const bodies: Array = [];\n const body = await detectParts(input, config);\n bodies.push(body);\n /*\n cache.tmpBoxes = []; // clear temp cache\n if ((skipped < (config.body.skipFrames || 0)) && config.skipFrame) { // just run part detection while reusing cached boxes\n skipped++;\n bodies = await Promise.all(cache.partBoxes.map((body) => detectParts(input, body, config))); // run from parts box cache\n } else { // calculate new boxes and run part detection\n skipped = 0;\n bodies = await Promise.all(cache.partBoxes.map((body) => detectParts(input, body, config))); // run from part box cache\n if (bodies.length !== config.body.maxDetected) { // run body detection only if we dont have enough bodies in cache\n cache.bodyBoxes = await detectBody(input, config);\n const newBodies = await Promise.all(cache.bodyBoxes.map((body) => detectParts(input, body, config)));\n bodies = bodies.concat(newBodies);\n }\n }\n cache.partBoxes = [...cache.tmpBoxes]; // repopulate cache with validated bodies\n */\n return bodies as BodyResult[];\n}\n", "/**\n * EfficientPose model implementation\n *\n * Based on: [**EfficientPose**](https://github.com/daniegr/EfficientPose)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\n\ntype Keypoints = { score: number, part: string, position: Point, positionRaw: Point };\n\nconst keypoints: Array = [];\nlet box: Box = [0, 0, 0, 0];\nlet boxRaw: Box = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst bodyParts = ['head', 'neck', 'rightShoulder', 'rightElbow', 'rightWrist', 'chest', 'leftShoulder', 'leftElbow', 'leftWrist', 'pelvis', 'rightHip', 'rightKnee', 'rightAnkle', 'leftHip', 'leftKnee', 'leftAnkle'];\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nfunction max2d(inputs, minScore) {\n const [width, height] = inputs.shape;\n return tf.tidy(() => {\n const mod = (a, b) => tf.sub(a, tf.mul(tf.div(a, tf.scalar(b, 'int32')), tf.scalar(b, 'int32'))); // modulus op implemented in tf\n const reshaped = tf.reshape(inputs, [height * width]); // combine all data\n const newScore = tf.max(reshaped, 0).dataSync()[0]; // get highest score // inside tf.tidy\n if (newScore > minScore) { // skip coordinate calculation is score is too low\n const coords = tf.argMax(reshaped, 0);\n const x = mod(coords, width).dataSync()[0]; // inside tf.tidy\n const y = tf.div(coords, tf.scalar(width, 'int32')).dataSync()[0]; // inside tf.tidy\n return [x, y, newScore];\n }\n return [0, 0, newScore];\n });\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < (config.body?.skipFrames || 0)) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model?.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const enhance = tf.mul(resize, 2);\n const norm = enhance.sub(1);\n return norm;\n });\n\n let resT;\n if (config.body.enabled) resT = await model?.predict(tensor);\n tf.dispose(tensor);\n\n if (resT) {\n keypoints.length = 0;\n const squeeze = resT.squeeze();\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = squeeze.unstack(2);\n tf.dispose(squeeze);\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = max2d(stack[id], config.body.minConfidence);\n if (score > (config.body?.minConfidence || 0)) {\n keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: bodyParts[id],\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n resolve([{ id: 0, score, box, boxRaw, keypoints }]);\n });\n}\n", "/**\n * MoveNet model implementation\n *\n * Based on: [**MoveNet**](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)\n */\n\nimport { log, join } from '../util/util';\nimport { scale } from '../util/box';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { fakeOps } from '../tfjs/backend';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nconst cachedBoxes: Array = [];\n\ntype Keypoints = { score: number, part: string, position: Point, positionRaw: Point };\ntype Body = { id: number, score: number, box: Box, boxRaw: Box, keypoints: Array }\n\nlet skipped = Number.MAX_SAFE_INTEGER;\nconst keypoints: Array = [];\n\nconst bodyParts = ['nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder', 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist', 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle'];\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['size'], config);\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 256;\n return model;\n}\n\nfunction createBox(points): [Box, Box] {\n const x = points.map((a) => a.position[0]);\n const y = points.map((a) => a.position[1]);\n const box: Box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = points.map((a) => a.positionRaw[0]);\n const yRaw = points.map((a) => a.positionRaw[1]);\n const boxRaw: Box = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n return [box, boxRaw];\n}\n\nasync function parseSinglePose(res, config, image, inputBox) {\n const kpt = res[0][0];\n keypoints.length = 0;\n let score = 0;\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [\n (inputBox[3] - inputBox[1]) * kpt[id][1] + inputBox[1],\n (inputBox[2] - inputBox[0]) * kpt[id][0] + inputBox[0],\n ];\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: bodyParts[id],\n positionRaw,\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const bodies: Array = [];\n const [box, boxRaw] = createBox(keypoints);\n bodies.push({ id: 0, score, box, boxRaw, keypoints });\n return bodies;\n}\n\nasync function parseMultiPose(res, config, image, inputBox) {\n const bodies: Array = [];\n for (let id = 0; id < res[0].length; id++) {\n const kpt = res[0][id];\n const totalScore = Math.round(100 * kpt[51 + 4]) / 100;\n if (totalScore > config.body.minConfidence) {\n keypoints.length = 0;\n for (let i = 0; i < 17; i++) {\n const score = kpt[3 * i + 2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [\n (inputBox[3] - inputBox[1]) * kpt[3 * i + 1] + inputBox[1],\n (inputBox[2] - inputBox[0]) * kpt[3 * i + 0] + inputBox[0],\n ];\n keypoints.push({\n part: bodyParts[i],\n score: Math.round(100 * score) / 100,\n positionRaw,\n position: [\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n // const [box, boxRaw] = createBox(keypoints);\n // movenet-multipose has built-in box details\n const boxRaw: Box = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]];\n const box: Box = [Math.trunc(boxRaw[0] * (image.shape[2] || 0)), Math.trunc(boxRaw[1] * (image.shape[1] || 0)), Math.trunc(boxRaw[2] * (image.shape[2] || 0)), Math.trunc(boxRaw[3] * (image.shape[1] || 0))];\n bodies.push({ id, score: totalScore, boxRaw, box, keypoints: [...keypoints] });\n }\n }\n bodies.sort((a, b) => b.score - a.score);\n if (bodies.length > config.body.maxDetected) bodies.length = config.body.maxDetected;\n return bodies;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!model || !model?.inputs[0].shape) return [];\n return new Promise(async (resolve) => {\n const t: Record = {};\n\n let bodies: Array = [];\n\n if (!config.skipFrame) cachedBoxes.length = 0; // allowed to use cache or not\n skipped++;\n\n for (let i = 0; i < cachedBoxes.length; i++) { // run detection based on cached boxes\n t.crop = tf.image.cropAndResize(input, [cachedBoxes[i]], [0], [inputSize, inputSize], 'bilinear');\n t.cast = tf.cast(t.crop, 'int32');\n t.res = await model?.predict(t.cast) as Tensor;\n const res = await t.res.array();\n const newBodies = (t.res.shape[2] === 17) ? await parseSinglePose(res, config, input, cachedBoxes[i]) : await parseMultiPose(res, config, input, cachedBoxes[i]);\n bodies = bodies.concat(newBodies);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n\n if ((bodies.length !== config.body.maxDetected) && (skipped > (config.body.skipFrames || 0))) { // run detection on full frame\n t.resized = tf.image.resizeBilinear(input, [inputSize, inputSize], false);\n t.cast = tf.cast(t.resized, 'int32');\n t.res = await model?.predict(t.cast) as Tensor;\n const res = await t.res.array();\n bodies = (t.res.shape[2] === 17) ? await parseSinglePose(res, config, input, [0, 0, 1, 1]) : await parseMultiPose(res, config, input, [0, 0, 1, 1]);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n cachedBoxes.length = 0; // reset cache\n skipped = 0;\n }\n\n if (config.skipFrame) { // create box cache based on last detections\n cachedBoxes.length = 0;\n for (let i = 0; i < bodies.length; i++) {\n if (bodies[i].keypoints.length > 10) { // only update cache if we detected sufficient number of keypoints\n const kpts = bodies[i].keypoints.map((kpt) => kpt.position);\n const newBox = scale(kpts, 1.5, [input.shape[2], input.shape[1]]);\n cachedBoxes.push([...newBox.yxBox]);\n }\n }\n }\n resolve(bodies);\n });\n}\n", "/**\n * CoCo Labels used by object detection implementations\n */\nexport const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "/**\n * NanoDet object detection model implementation\n *\n * Based on: [**MB3-CenterNet**](https://github.com/610265158/mobilenetv3_centernet)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport type { ObjectResult, Box } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model;\nlet last: Array = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || ''));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(async () => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = await boxesMax.argMax(2).array(); // what we need is indexes of features with highest scores, not values itself\n const scores = await scoresT.array(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw: Box = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))) as Box; // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n // strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)) as Box,\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => [a.boxRaw[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: Array = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = await nms.data();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((_val, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = tf.div(resize, 255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n tf.dispose(norm);\n tf.dispose(resize);\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n tf.dispose(transpose);\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * CenterNet object detection model implementation\n *\n * Based on: [**NanoDet**](https://github.com/RangiLyu/nanodet)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport type { ObjectResult, Box } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport { fakeOps } from '../tfjs/backend';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet last: ObjectResult[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['floormod'], config);\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(model.modelSignature['inputs']);\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!model || !model['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor | null, outputShape, config: Config) {\n if (!res) return [];\n const results: Array = [];\n const detections = await res.array();\n const squeezeT = tf.squeeze(res);\n tf.dispose(res);\n const arr = tf.split(squeezeT, 6, 1); // x1, y1, x2, y2, score, class\n tf.dispose(squeezeT);\n const stackT = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n const boxesT = tf.squeeze(stackT);\n tf.dispose(stackT);\n const scoresT = tf.squeeze(arr[4]);\n const classesT = tf.squeeze(arr[5]);\n arr.forEach((t) => tf.dispose(t));\n const nmsT = await tf.image.nonMaxSuppressionAsync(boxesT, scoresT, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n tf.dispose(boxesT);\n tf.dispose(scoresT);\n tf.dispose(classesT);\n const nms = await nmsT.data();\n tf.dispose(nmsT);\n let i = 0;\n for (const id of nms) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n const label = labels[classVal].label;\n const [x, y] = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n ];\n const boxRaw: Box = [\n x,\n y,\n detections[0][id][2] / inputSize - x,\n detections[0][id][3] / inputSize - y,\n ];\n const box: Box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n return results;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2], input.shape[1]];\n const resize = tf.image.resizeBilinear(input, [inputSize, inputSize]);\n const objectT = config.object.enabled ? model?.execute(resize, ['tower_0/detections']) as Tensor : null;\n tf.dispose(resize);\n\n const obj = await process(objectT, outputSize, config);\n last = obj;\n\n resolve(obj);\n });\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Meet**](https://drive.google.com/file/d/1lnP1bRi9CSqQQXUHa13159vLELYDgDu0/preview)\n * - [**MediaPipe Selfie**](https://drive.google.com/file/d/1dCfozqknMa068vVsO2j_1FgZkW_e3VWv/preview)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport type { Input } from '../image/image';\n\nlet model: GraphModel;\nlet busy = false;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.segmentation.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function process(input: Input, background: Input | undefined, config: Config)\n: Promise<{ data: Array, canvas: HTMLCanvasElement | OffscreenCanvas | null, alpha: HTMLCanvasElement | OffscreenCanvas | null }> {\n if (busy) return { data: [], canvas: null, alpha: null };\n busy = true;\n if (!model) await load(config);\n const inputImage = image.process(input, config);\n const width = inputImage.canvas?.width || 0;\n const height = inputImage.canvas?.height || 0;\n if (!inputImage.tensor) return { data: [], canvas: null, alpha: null };\n const t: Record = {};\n\n t.resize = tf.image.resizeBilinear(inputImage.tensor, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n tf.dispose(inputImage.tensor);\n t.norm = tf.div(t.resize, 255);\n t.res = model.predict(t.norm) as Tensor;\n\n t.squeeze = tf.squeeze(t.res, 0); // meet.shape:[1,256,256,1], selfie.shape:[1,144,256,2]\n if (t.squeeze.shape[2] === 2) {\n t.softmax = tf.softmax(t.squeeze); // model meet has two channels for fg and bg\n [t.bg, t.fg] = tf.unstack(t.softmax, 2);\n t.expand = tf.expandDims(t.fg, 2);\n t.pad = tf.expandDims(t.expand, 0);\n t.crop = tf.image.cropAndResize(t.pad, [[0, 0, 0.5, 0.5]], [0], [width, height]);\n // running sofmax before unstack creates 2x2 matrix so we only take upper-left quadrant\n // otherwise run softmax after unstack and use standard resize\n // resizeOutput = tf.image.resizeBilinear(expand, [input.tensor?.shape[1], input.tensor?.shape[2]]);\n t.data = tf.squeeze(t.crop, 0);\n } else {\n t.data = tf.image.resizeBilinear(t.squeeze, [height, width]); // model selfie has a single channel that we can use directly\n }\n const data = Array.from(await t.data.data());\n\n if (env.node && !env.Canvas && (typeof ImageData === 'undefined')) {\n if (config.debug) log('canvas support missing');\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return { data, canvas: null, alpha: null }; // running in nodejs so return alpha array as-is\n }\n\n const alphaCanvas = image.canvas(width, height);\n await tf.browser.toPixels(t.data, alphaCanvas);\n const alphaCtx = alphaCanvas.getContext('2d') as CanvasRenderingContext2D;\n if (config.segmentation.blur && config.segmentation.blur > 0) alphaCtx.filter = `blur(${config.segmentation.blur}px)`; // use css filter for bluring, can be done with gaussian blur manually instead\n const alphaData = alphaCtx.getImageData(0, 0, width, height);\n\n const compositeCanvas = image.canvas(width, height);\n const compositeCtx = compositeCanvas.getContext('2d') as CanvasRenderingContext2D;\n if (inputImage.canvas) compositeCtx.drawImage(inputImage.canvas, 0, 0);\n compositeCtx.globalCompositeOperation = 'darken'; // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation // best options are: darken, color-burn, multiply\n if (config.segmentation.blur && config.segmentation.blur > 0) compositeCtx.filter = `blur(${config.segmentation.blur}px)`; // use css filter for bluring, can be done with gaussian blur manually instead\n compositeCtx.drawImage(alphaCanvas, 0, 0);\n compositeCtx.globalCompositeOperation = 'source-over'; // reset composite operation\n compositeCtx.filter = 'none'; // reset css filter\n const compositeData = compositeCtx.getImageData(0, 0, width, height);\n for (let i = 0; i < width * height; i++) compositeData.data[4 * i + 3] = alphaData.data[4 * i + 0]; // copy original alpha value to new composite canvas\n compositeCtx.putImageData(compositeData, 0, 0);\n\n let mergedCanvas: HTMLCanvasElement | OffscreenCanvas | null = null;\n if (background && compositeCanvas) { // draw background with segmentation as overlay if background is present\n mergedCanvas = image.canvas(width, height);\n const bgImage = image.process(background, config);\n tf.dispose(bgImage.tensor);\n const ctxMerge = mergedCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctxMerge.drawImage(bgImage.canvas as HTMLCanvasElement, 0, 0, mergedCanvas.width, mergedCanvas.height);\n ctxMerge.drawImage(compositeCanvas, 0, 0);\n }\n\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n busy = false;\n\n return { data, canvas: mergedCanvas || compositeCanvas, alpha: alphaCanvas };\n}\n", "/**\n * GEAR [gender/emotion/age/race] model implementation\n *\n * Based on: [**GEAR Predictor**](https://github.com/Udolf15/GEAR-Predictor)\n *\n * Obsolete and replaced by `faceres` that performs age/gender/descriptor analysis\n * Config placeholder: agegenderrace: { enabled: true, modelPath: 'gear.json' },\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\n\nlet last = { age: 0 };\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function load(config: Config | any) {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.agegenderrace.modelPath)) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.face.agegenderrace.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function predict(image: Tensor, config: Config) {\n if (!model) return null;\n // @ts-ignore config disabled\n if ((skipped < config.face.agegenderrace.skipFrames) && config.skipFrame && last.age && (last.age > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape[2], model?.inputs[0].shape[1]], false);\n // const enhance = tf.mul(resize, [255.0]);\n\n let ageT;\n let genderT;\n let raceT;\n const obj = { age: 0 };\n\n // @ts-ignore array definition unavailable at compile time\n if (config.face.agegenderrace.enabled) [ageT, genderT, raceT] = await model.execute(resize, ['age_output', 'gender_output', 'race_output']);\n tf.dispose(resize);\n // tf.dispose(enhance);\n\n if (ageT) {\n // const data = await ageT.data();\n // {0: 'below_20', 1: '21-25', 2: '26-30', 3: '31-40',4: '41-50', 5: '51-60', 6: 'Above60'}\n }\n if (genderT) {\n // const data = await genderT.data();\n }\n if (raceT) {\n // const data = await raceT.data();\n // {0: 'white', 1: 'black', 2: 'asian', 3: 'indian', 4: 'others'}\n }\n\n tf.dispose(ageT);\n tf.dispose(genderT);\n tf.dispose(raceT);\n\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * Loader and Validator for all models used by Human\n */\n\nimport { log } from './util/util';\nimport type { GraphModel } from './tfjs/types';\nimport * as blazeface from './face/blazeface';\nimport * as facemesh from './face/facemesh';\nimport * as iris from './face/iris';\nimport * as faceres from './face/faceres';\nimport * as emotion from './gear/emotion';\nimport * as posenet from './body/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as blazepose from './body/blazepose';\nimport * as efficientpose from './body/efficientpose';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as centernet from './object/centernet';\nimport * as segmentation from './segmentation/segmentation';\nimport type { Human } from './human';\nimport { env } from './util/env';\nimport * as agegenderrace from './gear/gear-agegenderrace';\n\n/** Instances of all possible TFJS Graph Models used by Human\n * - loaded as needed based on configuration\n * - initialized explictly with `human.load()` method\n * - initialized implicity on first call to `human.detect()`\n * - each model can be `null` if not loaded, instance of `GraphModel` if loaded or `Promise` if loading\n */\nexport class Models {\n age: null | GraphModel | Promise = null;\n agegenderrace: null | GraphModel | Promise = null;\n blazeposedetect: null | GraphModel | Promise = null;\n blazepose: null | GraphModel | Promise = null;\n centernet: null | GraphModel | Promise = null;\n efficientpose: null | GraphModel | Promise = null;\n embedding: null | GraphModel | Promise = null;\n emotion: null | GraphModel | Promise = null;\n facedetect: null | GraphModel | Promise = null;\n faceiris: null | GraphModel | Promise = null;\n facemesh: null | GraphModel | Promise = null;\n faceres: null | GraphModel | Promise = null;\n gender: null | GraphModel | Promise = null;\n handpose: null | GraphModel | Promise = null;\n handskeleton: null | GraphModel | Promise = null;\n handtrack: null | GraphModel | Promise = null;\n movenet: null | GraphModel | Promise = null;\n nanodet: null | GraphModel | Promise = null;\n posenet: null | GraphModel | Promise = null;\n segmentation: null | GraphModel | Promise = null;\n}\n\nexport function reset(instance: Human): void {\n // if (instance.config.debug) log('resetting loaded models');\n for (const model of Object.keys(instance.models)) instance.models[model] = null;\n}\n\n/** Load method preloads all instance.configured models on-demand */\nexport async function load(instance: Human): Promise {\n if (env.initial) reset(instance);\n if (instance.config.hand.enabled) { // handpose model is a combo that must be loaded as a whole\n if (!instance.models.handpose && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config);\n if (!instance.models.handskeleton && instance.config.hand.landmarks && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config);\n }\n if (instance.config.face.enabled && !instance.models.facedetect) instance.models.facedetect = blazeface.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.mesh?.enabled && !instance.models.facemesh) instance.models.facemesh = facemesh.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.iris?.enabled && !instance.models.faceiris) instance.models.faceiris = iris.load(instance.config);\n if (instance.config.hand.enabled && !instance.models.handtrack && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handtrack = handtrack.loadDetect(instance.config);\n if (instance.config.hand.enabled && instance.config.hand.landmarks && !instance.models.handskeleton && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handskeleton = handtrack.loadSkeleton(instance.config);\n if (instance.config.body.enabled && !instance.models.posenet && instance.config.body?.modelPath?.includes('posenet')) instance.models.posenet = posenet.load(instance.config);\n if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config);\n if (instance.config.body.enabled && !instance.models.blazepose && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazepose = blazepose.loadPose(instance.config);\n if (instance.config.body.enabled && !instance.models.blazeposedetect && instance.config.body.detector?.modelPath && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazeposedetect = blazepose.loadDetect(instance.config);\n if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config);\n if (instance.config.body.enabled && !instance.models.movenet && instance.config.body?.modelPath?.includes('movenet')) instance.models.movenet = movenet.load(instance.config);\n if (instance.config.object.enabled && !instance.models.nanodet && instance.config.object?.modelPath?.includes('nanodet')) instance.models.nanodet = nanodet.load(instance.config);\n if (instance.config.object.enabled && !instance.models.centernet && instance.config.object?.modelPath?.includes('centernet')) instance.models.centernet = centernet.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.emotion?.enabled && !instance.models.emotion) instance.models.emotion = emotion.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.description?.enabled && !instance.models.faceres) instance.models.faceres = faceres.load(instance.config);\n if (instance.config.segmentation.enabled && !instance.models.segmentation) instance.models.segmentation = segmentation.load(instance.config);\n if (instance.config.face.enabled && instance.config.face['agegenderrace']?.enabled && !instance.models.agegenderrace) instance.models.agegenderrace = agegenderrace.load(instance.config);\n\n // models are loaded in parallel asynchronously so lets wait until they are actually loaded\n for await (const model of Object.keys(instance.models)) {\n if (instance.models[model] && typeof instance.models[model] !== 'undefined') instance.models[model] = await instance.models[model];\n }\n}\n\nexport async function validate(instance: Human): Promise {\n interface Op { name: string, category: string, op: string }\n const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div'];\n for (const defined of Object.keys(instance.models)) {\n if (instance.models[defined]) { // check if model is loaded\n let models: GraphModel[] = [];\n if (Array.isArray(instance.models[defined])) {\n models = instance.models[defined]\n .filter((model) => (model !== null))\n .map((model) => ((model && model.executor) ? model : model.model));\n } else {\n models = [instance.models[defined]];\n }\n for (const model of models) {\n if (!model) {\n if (instance.config.debug) log('model marked as loaded but not defined:', defined);\n continue;\n }\n const ops: string[] = [];\n // @ts-ignore // executor is a private method\n const executor = model?.executor;\n if (executor && executor.graph.nodes) {\n for (const kernel of Object.values(executor.graph.nodes)) {\n const op = (kernel as Op).op.toLowerCase();\n if (!ops.includes(op)) ops.push(op);\n }\n } else {\n if (!executor && instance.config.debug) log('model signature not determined:', defined);\n }\n const missing: string[] = [];\n for (const op of ops) {\n if (!simpleOps.includes(op) // exclude simple ops\n && !instance.env.kernels.includes(op) // check actual kernel ops\n && !instance.env.kernels.includes(op.replace('_', '')) // check variation without _\n && !instance.env.kernels.includes(op.replace('native', '')) // check standard variation\n && !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation\n missing.push(op);\n }\n }\n // log('model validation ops:', defined, ops);\n if (missing.length > 0 && instance.config.debug) log('model validation:', defined, missing);\n }\n }\n }\n}\n", "/** TFJS custom backend registration */\n\nimport { log } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport * as models from '../models';\n// import { env } from '../env';\n\nexport const config = {\n name: 'humangl',\n priority: 999,\n canvas: null,\n gl: null,\n extensions: [],\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nfunction extensions(): void {\n /*\n https://www.khronos.org/registry/webgl/extensions/\n https://webglreport.com/?v=2\n */\n const gl = config.gl;\n if (!gl) return;\n config.extensions = gl.getSupportedExtensions() as string[];\n // gl.getExtension('KHR_parallel_shader_compile');\n}\n\n/**\n * Registers custom WebGL2 backend to be used by Human library\n *\n * @returns void\n */\nexport async function register(instance): Promise {\n // force backend reload if gl context is not valid\n if (instance.config.backend !== 'humangl') return;\n if ((config.name in tf.engine().registry) && (!config.gl || !config.gl.getParameter(config.gl.VERSION))) {\n log('error: humangl backend invalid context');\n models.reset(instance);\n /*\n log('resetting humangl backend');\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n }\n if (!tf.findBackend(config.name)) {\n try {\n config.canvas = await image.canvas(100, 100);\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas?.getContext('webgl2', config.webGLattr) as WebGL2RenderingContext;\n if (config.canvas) {\n config.canvas.addEventListener('webglcontextlost', async (e) => {\n log('error: humangl:', e.type);\n // log('gpu memory usage:', instance.tf.engine().backendInstance.numBytesInGPU);\n log('possible browser memory leak using webgl');\n instance.emit('error');\n throw new Error('browser webgl error');\n /*\n log('resetting humangl backend');\n env.initial = true;\n models.reset(instance);\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n });\n config.canvas.addEventListener('webglcontextrestored', (e) => {\n log('error: humangl context restored:', e);\n });\n config.canvas.addEventListener('webglcontextcreationerror', (e) => {\n log('error: humangl context create:', e);\n });\n }\n } catch (err) {\n log('error: cannot get WebGL context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n const current = tf.backend().getGPGPUContext ? tf.backend().getGPGPUContext().gl : null;\n if (current) {\n log(`humangl webgl version:${current.getParameter(current.VERSION)} renderer:${current.getParameter(current.RENDERER)}`);\n } else {\n log('error: no current gl context:', current, config.gl);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n extensions();\n log('backend registered:', config.name);\n }\n}\n", "/** TFJS backend initialization and customization */\n\nimport { log, now } from '../util/util';\nimport * as humangl from './humangl';\nimport * as env from '../util/env';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport async function check(instance, force = false) {\n instance.state = 'backend';\n if (force || env.env.initial || (instance.config.backend && (instance.config.backend.length > 0) && (tf.getBackend() !== instance.config.backend))) {\n const timeStamp = now();\n\n if (instance.config.backend && instance.config.backend.length > 0) {\n // detect web worker\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && instance.config.debug) {\n if (instance.config.debug) log('running inside web worker');\n }\n\n // force browser vs node backend\n if (env.env.browser && instance.config.backend === 'tensorflow') {\n if (instance.config.debug) log('override: backend set to tensorflow while running in browser');\n instance.config.backend = 'humangl';\n }\n if (env.env.node && (instance.config.backend === 'webgl' || instance.config.backend === 'humangl')) {\n if (instance.config.debug) log(`override: backend set to ${instance.config.backend} while running in nodejs`);\n instance.config.backend = 'tensorflow';\n }\n\n // handle webgpu\n if (env.env.browser && instance.config.backend === 'webgpu') {\n if (typeof navigator === 'undefined' || typeof navigator['gpu'] === 'undefined') {\n log('override: backend set to webgpu but browser does not support webgpu');\n instance.config.backend = 'humangl';\n } else {\n const adapter = await navigator['gpu'].requestAdapter();\n if (instance.config.debug) log('enumerated webgpu adapter:', adapter);\n }\n }\n\n // check available backends\n if (instance.config.backend === 'humangl') await humangl.register(instance);\n const available = Object.keys(tf.engine().registryFactory);\n if (instance.config.debug) log('available backends:', available);\n\n if (!available.includes(instance.config.backend)) {\n log(`error: backend ${instance.config.backend} not found in registry`);\n instance.config.backend = env.env.node ? 'tensorflow' : 'webgl';\n if (instance.config.debug) log(`override: setting backend ${instance.config.backend}`);\n }\n\n if (instance.config.debug) log('setting backend:', instance.config.backend);\n\n // handle wasm\n if (instance.config.backend === 'wasm') {\n if (instance.config.debug) log('wasm path:', instance.config.wasmPath);\n if (typeof tf?.setWasmPaths !== 'undefined') await tf.setWasmPaths(instance.config.wasmPath);\n else throw new Error('wasm backend is not loaded');\n const simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (instance.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (instance.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n try {\n await tf.setBackend(instance.config.backend);\n await tf.ready();\n } catch (err) {\n log('error: cannot set backend:', instance.config.backend, err);\n return false;\n }\n }\n\n // handle webgl & humangl\n if (tf.getBackend() === 'humangl') {\n tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n tf.ENV.set('WEBGL_CPU_FORWARD', true);\n tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', false);\n tf.ENV.set('WEBGL_USE_SHAPES_UNIFORMS', true);\n tf.ENV.set('CPU_HANDOFF_SIZE_THRESHOLD', 128);\n // if (!instance.config.object.enabled) tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (typeof instance.config['deallocate'] !== 'undefined' && instance.config['deallocate']) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n if (tf.backend().getGPGPUContext) {\n const gl = await tf.backend().getGPGPUContext().gl;\n if (instance.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n }\n\n // handle webgpu\n if (tf.getBackend() === 'humangl') {\n tf.ENV.set('WEBGPU_USE_GLSL', true);\n tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', false);\n tf.ENV.set('WEBGL_USE_SHAPES_UNIFORMS', true);\n }\n\n // wait for ready\n tf.enableProdMode();\n await tf.ready();\n instance.performance.backend = Math.trunc(now() - timeStamp);\n instance.config.backend = tf.getBackend();\n\n env.get(); // update env on backend init\n instance.env = env.env;\n }\n return true;\n}\n\n// register fake missing tfjs ops\nexport function fakeOps(kernelNames: Array, config) {\n // if (config.debug) log('registerKernel:', kernelNames);\n for (const kernelName of kernelNames) {\n const kernelConfig = {\n kernelName,\n backendName: config.backend,\n kernelFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // setupFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // disposeFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n };\n tf.registerKernel(kernelConfig);\n }\n env.env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase()); // re-scan registered ops\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { TRI468 as triangulation } from '../face/facemeshcoords';\nimport { mergeDeep, now } from './util';\nimport type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult } from '../result';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: boolean,\n drawLabels: boolean,\n drawBoxes: boolean,\n drawPolygons: boolean,\n drawGaze: boolean,\n fillPolygons: boolean,\n useDepth: boolean,\n useCurves: boolean,\n bufferedOutput: boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 14px \"Segoe UI\"',\n lineHeight: 18,\n lineWidth: 4,\n pointSize: 2,\n roundRect: 8,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: true,\n drawPolygons: true,\n drawGaze: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: true,\n};\n\nconst getCanvasContext = (input) => {\n if (input && input.getContext) return input.getContext('2d');\n throw new Error('invalid canvas');\n};\n\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n const z = pt[2] || 0;\n ctx.strokeStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], Math.round(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: [number, number, number?][] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where: unknown[] = []; // what&where is a record\n let what: unknown[] = []; // what&where is a record\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${who}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face: ${Math.trunc(100 * f.score)}%`);\n if (f.genderScore) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderScore)}%`);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.gaze) {\n if (f.rotation.angle.roll) labels.push(`roll: ${rad2deg(f.rotation.angle.roll)}\u00B0 yaw:${rad2deg(f.rotation.angle.yaw)}\u00B0 pitch:${rad2deg(f.rotation.angle.pitch)}\u00B0`);\n if (f.rotation.gaze.bearing) labels.push(`gaze: ${rad2deg(f.rotation.gaze.bearing)}\u00B0`);\n }\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n if (f.mesh.length > 450) {\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations['leftEyeIris'] && f.annotations['leftEyeIris'][0]) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['leftEyeIris'][3][0] - f.annotations['leftEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['leftEyeIris'][4][1] - f.annotations['leftEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations['rightEyeIris'] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['rightEyeIris'][3][0] - f.annotations['rightEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['rightEyeIris'][4][1] - f.annotations['rightEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (localOptions.drawGaze && f.rotation?.gaze?.strength && f.rotation?.gaze?.bearing && f.annotations['leftEyeIris'] && f.annotations['rightEyeIris'] && f.annotations['leftEyeIris'][0] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = 'pink';\n ctx.beginPath();\n\n const leftGaze = [\n f.annotations['leftEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['leftEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1]);\n ctx.lineTo(leftGaze[0], leftGaze[1]);\n\n const rightGaze = [\n f.annotations['rightEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['rightEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1]);\n ctx.lineTo(rightGaze[0], rightGaze[1]);\n\n ctx.stroke();\n }\n }\n }\n }\n}\n\nexport async function body(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes && result[i].box && result[i].box?.length === 4) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + (2 * (result[i].keypoints[pt].position[2] || 0))}, ${127.5 - (2 * (result[i].keypoints[pt].position[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels) {\n ctx.font = localOptions.font;\n if (result[i].keypoints) {\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + (2 * pt.position[2])}, ${127.5 - (2 * pt.position[2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4);\n }\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints) {\n let part;\n const points: [number, number, number?][] = [];\n // shoulder line\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // torso main\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n if (points.length === 4) lines(ctx, points, localOptions); // only draw if we have complete torso\n // leg left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // leg right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightHip');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightKnee');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightAnkle');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightHeel');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightFoot');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm left\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'leftShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'leftPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // arm right\n points.length = 0;\n part = result[i].keypoints.find((a) => a.part === 'rightShoulder');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightElbow');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightWrist');\n if (part) points.push([part.position[0], part.position[1]]);\n part = result[i].keypoints.find((a) => a.part === 'rightPalm');\n if (part) points.push([part.position[0], part.position[1]]);\n curves(ctx, points, localOptions);\n // draw all\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`hand:${Math.trunc(100 * h.score)}%`, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]); // can use h.label\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`hand:${Math.trunc(100 * h.score)}%`, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]); // can use h.label\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * (pt[2] || 0))}, ${127.5 - (2 * (pt[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels && h.annotations) {\n const addHandLabel = (part, title) => {\n if (!part || part.length === 0 || !part[0]) return;\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[part.length - 1][2])}, ${127.5 - (2 * part[part.length - 1][2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);\n };\n ctx.font = localOptions.font;\n addHandLabel(h.annotations['index'], 'index');\n addHandLabel(h.annotations['middle'], 'middle');\n addHandLabel(h.annotations['ring'], 'ring');\n addHandLabel(h.annotations['pinky'], 'pinky');\n addHandLabel(h.annotations['thumb'], 'thumb');\n addHandLabel(h.annotations['palm'], 'palm');\n }\n if (localOptions.drawPolygons && h.annotations) {\n const addHandLine = (part) => {\n if (!part || part.length === 0 || !part[0]) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations['index']);\n addHandLine(h.annotations['middle']);\n addHandLine(h.annotations['ring']);\n addHandLine(h.annotations['pinky']);\n addHandLine(h.annotations['thumb']);\n // addPart(h.annotations.palm);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${h.label} ${Math.round(100 * h.score)}%`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function person(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(input: HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) {\n if (!input || !output) return;\n const ctx = getCanvasContext(output);\n ctx.drawImage(input, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Result, drawOptions?: Partial) {\n if (!result || !result.performance || !result || !inCanvas) return null;\n const timestamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n const promise = Promise.all([\n face(inCanvas, result.face, localOptions),\n body(inCanvas, result.body, localOptions),\n hand(inCanvas, result.hand, localOptions),\n object(inCanvas, result.object, localOptions),\n gesture(inCanvas, result.gesture, localOptions), // gestures do not have buffering\n // person(inCanvas, result.persons, localOptions); // already included above\n ]);\n result.performance.draw = Math.trunc(now() - timestamp);\n return promise;\n}\n", "// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nconst calculateGaze = (face): { bearing: number, strength: number } => {\n const radians = (pt1, pt2) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = face.mesh[33][2] > face.mesh[263][2]; // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n\n const eyeDiff = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n\n return { bearing, strength };\n};\n\nexport const calculateFaceAngle = (face, imageSize): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX: number;\n let thetaY: number;\n let thetaZ: number;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n if (isNaN(thetaX)) thetaX = 0;\n if (isNaN(thetaY)) thetaY = 0;\n if (isNaN(thetaZ)) thetaZ = 0;\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n // initialize gaze and mesh\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * imageSize[0] / size,\n pt[1] * imageSize[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n", "/**\n * Face algorithm implementation\n * Uses FaceMesh, Emotion and FaceRes models to create a unified pipeline\n */\n\nimport { log, now } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as facemesh from './facemesh';\nimport * as emotion from '../gear/emotion';\nimport * as faceres from './faceres';\nimport type { FaceResult } from '../result';\nimport type { Tensor } from '../tfjs/types';\nimport { calculateFaceAngle } from './angles';\n\nexport const detectFace = async (parent /* instance of human */, input: Tensor): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let gearRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array = [];\n parent.state = 'run:face';\n timeStamp = now();\n\n const faces = await facemesh.predict(input, parent.config);\n parent.performance.face = Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefied\n if (!faces[i].tensor || faces[i].tensor['isDisposedInternal']) {\n log('Face object is disposed:', faces[i].tensor);\n continue;\n }\n\n const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run gear, inherits face from blazeface\n /*\n parent.analyze('Start GEAR:');\n if (parent.config.async) {\n gearRes = parent.config.face.agegenderrace.enabled ? agegenderrace.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:gear';\n timeStamp = now();\n gearRes = parent.config.face.agegenderrace.enabled ? await agegenderrace.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End GEAR:');\n */\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];\n parent.performance.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes, gearRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes, gearRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {\n delete faces[i].annotations.leftEyeIris;\n delete faces[i].annotations.rightEyeIris;\n }\n const irisSize = (faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0]\n && (faces[i].annotations.leftEyeIris.length > 0) && (faces[i].annotations.rightEyeIris.length > 0)\n && (faces[i].annotations.leftEyeIris[0] !== null) && (faces[i].annotations.rightEyeIris[0] !== null))\n ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2]\n : 0; // note: average human iris size is 11.7mm\n\n // optionally return tensor\n const tensor = parent.config.face.detector.return ? tf.squeeze(faces[i].tensor) : null;\n // dispose original face tensor\n tf.dispose(faces[i].tensor);\n // delete temp face image\n if (faces[i].tensor) delete faces[i].tensor;\n // combine results\n faceRes.push({\n ...faces[i],\n id: i,\n age: descRes.age,\n gender: descRes.gender,\n genderScore: descRes.genderScore,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,\n rotation,\n tensor,\n });\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.performance.face) delete parent.performance.face;\n if (parent.performance.age) delete parent.performance.age;\n if (parent.performance.gender) delete parent.performance.gender;\n if (parent.performance.emotion) delete parent.performance.emotion;\n }\n return faceRes;\n};\n", "/**\n * Gesture detection algorithm\n */\n\nimport type { GestureResult } from '../result';\nimport * as fingerPose from '../hand/fingerpose';\n\n/**\n * @typedef FaceGesture\n */\nexport type FaceGesture =\n `facing ${'left' | 'center' | 'right'}`\n | `blink ${'left' | 'right'} eye`\n | `mouth ${number}% open`\n | `head ${'up' | 'down'}`;\n\n/**\n * @typedef IrisGesture\n */\nexport type IrisGesture =\n 'facing center'\n | `looking ${'left' | 'right' | 'up' | 'down'}`\n | 'looking center';\n\n/**\n * @typedef BodyGesture\n */\nexport type BodyGesture =\n `leaning ${'left' | 'right'}`\n | `raise ${'left' | 'right'} hand`\n | 'i give up';\n\n/**\n * @typedef BodyGesture\n */\nexport type HandGesture =\n `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} forward`\n | `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} up`\n | 'victory'\n | 'thumbs up';\n\nexport const body = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: BodyGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: FaceGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 450) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: IrisGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.leftEyeIris[0] || !res[i].annotations.rightEyeIris || !res[i].annotations.rightEyeIris[0]) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: HandGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n if (res[i]['annotations']) {\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos) && pos[0]) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward` as HandGesture });\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${highest.name} up` as HandGesture });\n }\n if (res[i]['keypoints']) {\n const poses = fingerPose.match(res[i]['keypoints']);\n for (const pose of poses) gestures.push({ hand: i, gesture: pose.name as HandGesture });\n }\n }\n return gestures;\n};\n", "/**\n * Results interpolation for smoothening of video detection results inbetween detected frames\n */\n\nimport type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult, Box, Point } from '../result';\n\nconst bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n\nexport function calc(newResult: Result): Result {\n if (!newResult) return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n // curve fitted: buffer = 8 - ln(delay)\n // interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n // - at 50ms delay buffer = ~4.1 => 28% towards live data\n // - at 250ms delay buffer = ~2.5 => 40% towards live data\n // - at 500ms delay buffer = ~1.8 => 55% towards live data\n // - at 750ms delay buffer = ~1.4 => 71% towards live data\n // - at 1sec delay buffer = 1 which means live data is used\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;\n\n bufferedResult.canvas = newResult.canvas;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as BodyResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + b) / bufferedFactor) as Box;\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + b) / bufferedFactor) as Box;\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((keypoint, j) => ({\n score: keypoint.score,\n part: keypoint.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[0] + keypoint.position[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[1] + keypoint.position[1]) / bufferedFactor : keypoint.position[1],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[0] + keypoint.positionRaw[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[1] + keypoint.positionRaw[1]) / bufferedFactor : keypoint.position[1],\n ],\n }))) as Array<{ score: number, part: string, position: [number, number, number?], positionRaw: [number, number, number?] }>;\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as HandResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; // reset keypoints as previous frame did not have them\n const keypoints = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) as Point)\n : [];\n const annotations = {};\n if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) bufferedResult.hand[i].annotations = newResult.hand[i].annotations; // reset annotations as previous frame did not have them\n if (newResult.hand[i].annotations) {\n for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations\n annotations[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0]\n ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as HandResult['annotations'] }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as FaceResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.bearing || 0) + (newResult.face[i].rotation?.gaze?.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.strength || 0) + (newResult.face[i].rotation?.gaze?.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as ObjectResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n if (newResult.persons) {\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as PersonResult[]));\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as Box;\n }\n }\n }\n\n // just copy latest gestures without interpolation\n if (newResult.gesture) bufferedResult.gesture = newResult.gesture as GestureResult[];\n if (newResult.performance) bufferedResult.performance = newResult.performance;\n\n return bufferedResult;\n}\n", "/** Defines Descriptor type */\nexport type Descriptor = Array\n\n/** Calculates distance between two descriptors\n * - Minkowski distance algorithm of nth order if `order` is different than 2\n * - Euclidean distance if `order` is 2 (default)\n *\n * Options:\n * - `order`\n *\n * Note: No checks are performed for performance reasons so make sure to pass valid number arrays of equal length\n */\nexport function distance(descriptor1: Descriptor, descriptor2: Descriptor, options = { order: 2 }) {\n // general minkowski distance, euclidean distance is limited case where order is 2\n let sum = 0;\n for (let i = 0; i < descriptor1.length; i++) {\n const diff = (options.order === 2) ? (descriptor1[i] - descriptor2[i]) : (Math.abs(descriptor1[i] - descriptor2[i]));\n sum += (options.order === 2) ? (diff * diff) : (diff ** options.order);\n }\n return sum;\n}\n\n/** Calculates normalized similarity between two descriptors based on their `distance`\n */\nexport function similarity(descriptor1: Descriptor, descriptor2: Descriptor, options = { order: 2 }) {\n const dist = distance(descriptor1, descriptor2, options);\n const invert = (options.order === 2) ? Math.sqrt(dist) : dist ** (1 / options.order);\n return Math.max(0, 100 - invert) / 100.0;\n}\n\n/** Matches given descriptor to a closest entry in array of descriptors\n * @param descriptor face descriptor\n * @param descriptors array of face descriptors to commpare given descriptor to\n *\n * Options:\n * - `order` see {@link distance} method\n * - `threshold` match will return result first result for which {@link distance} is below `threshold` even if there may be better results\n *\n * @returns object with index, distance and similarity\n * - `index` index array index where best match was found or -1 if no matches\n * - {@link distance} calculated `distance` of given descriptor to the best match\n * - {@link similarity} calculated normalized `similarity` of given descriptor to the best match\n*/\nexport function match(descriptor: Descriptor, descriptors: Array, options = { order: 2, threshold: 0 }) {\n if (!Array.isArray(descriptor) || !Array.isArray(descriptors) || descriptor.length < 64 || descriptors.length === 0 || descriptor.length !== descriptors[0].length) { // validate input\n return { index: -1, distance: Number.POSITIVE_INFINITY, similarity: 0 };\n }\n let best = Number.MAX_SAFE_INTEGER;\n let index = -1;\n for (let i = 0; i < descriptors.length; i++) {\n const res = distance(descriptor, descriptors[i], { order: options.order });\n if (res < best) {\n best = res;\n index = i;\n }\n if (best < options.threshold) break;\n }\n best = (options.order === 2) ? Math.sqrt(best) : best ** (1 / options.order);\n return { index, distance: best, similarity: Math.max(0, 100 - best) / 100.0 };\n}\n", "/**\n * Analyze detection Results and sort&combine them into per-person view\n */\n\nimport type { FaceResult, BodyResult, HandResult, GestureResult, PersonResult, Box } from '../result';\n\nexport function join(faces: Array, bodies: Array, hands: Array, gestures: Array, shape: Array | undefined): Array {\n let id = 0;\n const persons: Array = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: PersonResult = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures?.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures?.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.left?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);\n }\n\n // create new overarching box from all boxes beloning to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face?.box);\n extractXY(person.body?.box);\n extractXY(person.hands?.left?.box);\n extractXY(person.hands?.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape && shape[1] && shape[2]) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */\n\n// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8ME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mxxlx2paN4mNng+K4+I8Hy2yaTfl37TXetoCPfRxfp1qi3F48ofKMvtvxak8s6LDv61\nrZji9rPaLUf5PC+bfttS0q8q3p9W/wBrRMdpUZuKdN99nzvFqPbTVz7nD8OKs+do2/mW3h4D7Xaq\nZnPrtNpqz35aRaYOHY9Zk4pNt9rR+rl6zi+OnS+WN57Rv1lXp/YrNaYtruL6zNPnGO3hxP6O5w/2\nf0HDuun09Yv55Le9afznqcOvO4tBreMTHu30unnva0bWt8on+70nDuE4OHYYx4Kbesz3tPrMuhGO\nIjpDOKrK9YVpsyiGUQnYGOyUgI2SlAIEmwMWMs9kTAMJYzDOYRMArmGErZhhMArlHmzmGMwDE3Ts\nbAbs4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "/**\n * Warmup algorithm that uses embedded images to excercise loaded models for faster future inference\n */\n\nimport { log, now, mergeDeep } from './util/util';\nimport * as sample from './sample';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as image from './image/image';\nimport type { Config } from './config';\nimport type { Result } from './result';\nimport { env } from './util/env';\n\nasync function warmupBitmap(instance) {\n const b64toBlob = (base64: string, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (instance.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'body':\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await instance.detect(bitmap, instance.config);\n bitmap.close();\n }\n return res;\n}\n\nasync function warmupCanvas(instance) {\n return new Promise((resolve) => {\n let src;\n // let size = 0;\n switch (instance.config.warmup) {\n case 'face':\n // size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n // size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n let img;\n if (typeof Image !== 'undefined') img = new Image();\n // @ts-ignore env.image is an external monkey-patch\n else if (env.Image) img = new env.Image();\n img.onload = async () => {\n const canvas = image.canvas(img.naturalWidth, img.naturalHeight);\n if (!canvas) {\n log('Warmup: Canvas not found');\n resolve({});\n } else {\n const ctx = canvas.getContext('2d');\n if (ctx) ctx.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const tensor = await instance.image(canvas);\n const res = await instance.detect(tensor.tensor, instance.config);\n resolve(res);\n }\n };\n if (src) img.src = src;\n else resolve(null);\n });\n}\n\nasync function warmupNode(instance) {\n const atob = (str: string) => Buffer.from(str, 'base64');\n let img;\n if (instance.config.warmup === 'face') img = atob(sample.face);\n if (instance.config.warmup === 'body' || instance.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n instance.tf.dispose(data);\n // log('Input:', expanded);\n res = await instance.detect(expanded, instance.config);\n instance.tf.dispose(expanded);\n } else {\n if (instance.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await instance.detect(input, instance.config);\n */\n }\n return res;\n}\n\n/** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: Config\n*/\nexport async function warmup(instance, userConfig?: Partial): Promise {\n const t0 = now();\n instance.state = 'warmup';\n if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;\n if (!instance.config.warmup || instance.config.warmup === 'none') return { error: 'null' };\n let res;\n return new Promise(async (resolve) => {\n if (typeof createImageBitmap === 'function') res = await warmupBitmap(instance);\n else if (typeof Image !== 'undefined' || env.Canvas !== undefined) res = await warmupCanvas(instance);\n else res = await warmupNode(instance);\n const t1 = now();\n if (instance.config.debug) log('Warmup', instance.config.warmup, Math.round(t1 - t0), 'ms');\n instance.emit('warmup');\n resolve(res);\n });\n}\n", "/**\n * Human main module\n */\n\n// module imports\nimport { log, now, mergeDeep, validate } from './util/util';\nimport { defaults } from './config';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as app from '../package.json';\nimport * as backend from './tfjs/backend';\n// import * as blazepose from './body/blazepose-v1';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as draw from './util/draw';\nimport * as efficientpose from './body/efficientpose';\nimport * as env from './util/env';\nimport * as face from './face/face';\nimport * as facemesh from './face/facemesh';\nimport * as faceres from './face/faceres';\nimport * as gesture from './gesture/gesture';\nimport * as handpose from './handpose/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as humangl from './tfjs/humangl';\nimport * as image from './image/image';\nimport * as interpolate from './util/interpolate';\nimport * as match from './face/match';\nimport * as models from './models';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as persons from './util/persons';\nimport * as posenet from './body/posenet';\nimport * as segmentation from './segmentation/segmentation';\nimport * as warmups from './warmup';\n\n// type definitions\nimport type { Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, PersonResult } from './result';\nimport type { Tensor } from './tfjs/types';\nimport type { DrawOptions } from './util/draw';\nimport type { Input } from './image/image';\nimport type { Config } from './config';\n\n/** Defines configuration options used by all **Human** methods */\nexport * from './config';\n\n/** Defines result types returned by all **Human** methods */\nexport * from './result';\n\n/** Defines DrawOptions used by `human.draw.*` methods */\nexport type { DrawOptions } from './util/draw';\nexport { env, Env } from './util/env';\n\n/** Face descriptor type as number array */\nexport type { Descriptor } from './face/match';\n\n/** Box and Point primitives */\nexport { Box, Point } from './result';\n\n/** Defines all possible models used by **Human** library */\nexport { Models } from './models';\n\n/** Defines all possible input types for **Human** detection */\nexport { Input } from './image/image';\n\n/** Events dispatched by `human.events`\n *\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n */\nexport type Events = 'create' | 'load' | 'image' | 'result' | 'warmup' | 'error';\n\n/** Error message\n * @typedef Error Type\n */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS\n * @external\n */\nexport type TensorFlow = typeof tf;\n\n/** **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n *\n * @param userConfig: {@link Config}\n * @return instance\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n\n /** Current configuration\n * - Definition: {@link Config}\n * - Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L292)\n */\n config: Config;\n\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n * - Definition: {@link Result}\n */\n result: Result;\n\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n\n /** currenty processed image tensor and canvas */\n process: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n\n /** Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n * @internal\n *\n * [TFJS API]\n */\n tf: TensorFlow;\n\n /** Object containing environment information used for diagnostics */\n env: env.Env;\n\n /** Draw helper classes that can draw detected objects on canvas using specified draw\n * - options: {@link DrawOptions} global settings for all draw operations, can be overriden for each draw method\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: { canvas, face, body, hand, gesture, object, person, all, options: DrawOptions };\n\n /** Currently loaded models\n * @internal\n * {@link Models}\n */\n models: models.Models;\n\n /** Container for events dispatched by Human\n *\n * Possible events:\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n * - `error`: triggered on some errors\n */\n events: EventTarget | undefined;\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n /** WebGL debug info */\n gl: Record;\n // definition end\n\n /** Constructor for **Human** library that is futher used for all operations\n *\n * @param userConfig: {@link Config}\n *\n * @return instance: {@link Human}\n */\n constructor(userConfig?: Partial) {\n env.get();\n this.env = env.env;\n defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`;\n defaults.modelBasePath = this.env.browser ? '../models/' : 'file://models/';\n defaults.backend = this.env.browser ? 'humangl' : 'tensorflow';\n this.version = app.version; // expose version property on instance of class\n Object.defineProperty(this, 'version', { value: app.version }); // expose version property directly on class itself\n this.config = JSON.parse(JSON.stringify(defaults));\n Object.seal(this.config);\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n this.tf = tf;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.performance = { backend: 0, load: 0, image: 0, frames: 0, cached: 0, changed: 0, total: 0, draw: 0 };\n this.events = (typeof EventTarget !== 'undefined') ? new EventTarget() : undefined;\n // object that contains all initialized models\n this.models = new models.Models();\n // reexport draw methods\n this.draw = {\n options: draw.options as DrawOptions,\n canvas: (input: HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) => draw.canvas(input, output),\n face: (output: HTMLCanvasElement | OffscreenCanvas, result: FaceResult[], options?: Partial) => draw.face(output, result, options),\n body: (output: HTMLCanvasElement | OffscreenCanvas, result: BodyResult[], options?: Partial) => draw.body(output, result, options),\n hand: (output: HTMLCanvasElement | OffscreenCanvas, result: HandResult[], options?: Partial) => draw.hand(output, result, options),\n gesture: (output: HTMLCanvasElement | OffscreenCanvas, result: GestureResult[], options?: Partial) => draw.gesture(output, result, options),\n object: (output: HTMLCanvasElement | OffscreenCanvas, result: ObjectResult[], options?: Partial) => draw.object(output, result, options),\n person: (output: HTMLCanvasElement | OffscreenCanvas, result: PersonResult[], options?: Partial) => draw.person(output, result, options),\n all: (output: HTMLCanvasElement | OffscreenCanvas, result: Result, options?: Partial) => draw.all(output, result, options),\n };\n this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.process = { tensor: null, canvas: null };\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // set gl info\n this.gl = humangl.config;\n // include platform info\n this.emit('create');\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg: string[]) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input: Input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.env.node && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Reset configuration to default values */\n reset(): void {\n const currentBackend = this.config.backend; // save backend;\n this.config = JSON.parse(JSON.stringify(defaults));\n this.config.backend = currentBackend;\n }\n\n /** Validate current configuration schema */\n public validate(userConfig?: Partial) {\n return validate(defaults, userConfig || this.config);\n }\n\n /** Exports face matching methods */\n public similarity = match.similarity;\n public distance = match.distance;\n public match = match.match;\n\n /** Process input as return canvas and tensor\n *\n * @param input: {@link Input}\n * @returns { tensor, canvas }\n */\n image(input: Input) {\n return image.process(input, this.config);\n }\n\n /** Segmentation method takes any input and returns processed canvas with body segmentation\n * - Optional parameter background is used to fill the background with specific input\n * - Segmentation is not triggered as part of detect process\n *\n * Returns:\n * - `data` as raw data array with per-pixel segmentation values\n * - `canvas` as canvas which is input image filtered with segementation data and optionally merged with background image. canvas alpha values are set to segmentation values for easy merging\n * - `alpha` as grayscale canvas that represents segmentation alpha values\n *\n * @param input: {@link Input}\n * @param background?: {@link Input}\n * @returns { data, canvas, alpha }\n */\n async segmentation(input: Input, background?: Input): Promise<{ data: number[], canvas: HTMLCanvasElement | OffscreenCanvas | null, alpha: HTMLCanvasElement | OffscreenCanvas | null }> {\n return segmentation.process(input, background, this.config);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n *\n * @param input: Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n return faceres.enhance(input);\n }\n\n /** Explicit backend initialization\n * - Normally done implicitly during initial load phase\n * - Call to explictly register and initialize TFJS backend without any other operations\n * - Use when changing backend during runtime\n *\n * @return Promise\n */\n async init(): Promise {\n await backend.check(this, true);\n await this.tf.ready();\n env.set(this.env);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n *\n * @param userConfig?: {@link Config}\n * @return Promise\n */\n async load(userConfig?: Partial): Promise {\n this.state = 'load';\n const timeStamp = now();\n const count = Object.values(this.models).filter((model) => model).length;\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n\n if (env.env.initial) { // print version info on first run and check for correct backend setup\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (!await backend.check(this)) log('error: backend check failed');\n await tf.ready();\n if (this.env.browser) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n\n await models.load(this); // actually loads models\n if (env.env.initial && this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors'); // print memory stats on first run\n env.env.initial = false;\n\n const loaded = Object.values(this.models).filter((model) => model).length;\n if (loaded !== count) { // number of loaded models changed\n await models.validate(this); // validate kernel ops used by model against current backend\n this.emit('load');\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.load as number || 0)) this.performance.load = current;\n }\n\n // emit event\n /** @hidden */\n emit = (event: string) => {\n if (this.events && this.events.dispatchEvent) this.events?.dispatchEvent(new Event(event));\n }\n\n /** Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result?: {@link Result} optional use specific result set to run interpolation on\n * @returns result: {@link Result}\n */\n next(result: Result = this.result): Result {\n return interpolate.calc(result) as Result;\n }\n\n /** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async warmup(userConfig?: Partial): Promise {\n return warmups.warmup(this, userConfig) as Promise;\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n *\n * @param input: {@link Input}\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async detect(input: Input, userConfig?: Partial): Promise {\n // detection happens inside a promise\n this.state = 'detect';\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n let elapsedTime;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend if needed\n await backend.check(this);\n\n // load models if enabled\n await this.load();\n\n timeStamp = now();\n this.state = 'image';\n const img = image.process(input, this.config) as { canvas: HTMLCanvasElement | OffscreenCanvas, tensor: Tensor };\n this.process = img;\n this.performance.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n if (!img.tensor) {\n if (this.config.debug) log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.emit('image');\n\n timeStamp = now();\n this.config.skipFrame = await image.skip(this.config, img.tensor);\n if (!this.performance.frames) this.performance.frames = 0;\n if (!this.performance.cached) this.performance.cached = 0;\n (this.performance.frames as number)++;\n if (this.config.skipFrame) this.performance.cached++;\n this.performance.changed = Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes: FaceResult[] | Promise | never[] = [];\n let bodyRes: BodyResult[] | Promise | never[] = [];\n let handRes: HandResult[] | Promise | never[] = [];\n let objectRes: ObjectResult[] | Promise | never[] = [];\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n this.state = 'detect:face';\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, img.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, img.tensor) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.face = elapsedTime;\n }\n\n if (this.config.async && (this.config.body.maxDetected === -1 || this.config.hand.maxDetected === -1)) faceRes = await faceRes; // need face result for auto-detect number of hands or bodies\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n this.state = 'detect:body';\n const bodyConfig = this.config.body.maxDetected === -1 ? mergeDeep(this.config, { body: { maxDetected: this.config.face.enabled ? 1 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of bodies\n if (this.config.async) {\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(img.tensor, bodyConfig) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n timeStamp = now();\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(img.tensor, bodyConfig) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.body = elapsedTime;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n this.state = 'detect:hand';\n const handConfig = this.config.hand.maxDetected === -1 ? mergeDeep(this.config, { hand: { maxDetected: this.config.face.enabled ? 2 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of hands\n if (this.config.async) {\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? handtrack.predict(img.tensor, handConfig) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n timeStamp = now();\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? await handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? await handtrack.predict(img.tensor, handConfig) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.hand = elapsedTime;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n this.state = 'detect:object';\n if (this.config.async) {\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(img.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n timeStamp = now();\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(img.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.object = elapsedTime;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n this.state = 'detect:await';\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n this.state = 'detect:gesture';\n let gestureRes: GestureResult[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.performance.gesture = Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n this.performance.total = Math.trunc(now() - timeStart);\n const shape = this.process?.tensor?.shape || [];\n this.result = {\n face: faceRes as FaceResult[],\n body: bodyRes as BodyResult[],\n hand: handRes as HandResult[],\n gesture: gestureRes,\n object: objectRes as ObjectResult[],\n performance: this.performance,\n canvas: this.process.canvas,\n timestamp: Date.now(),\n get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(img.tensor);\n\n // log('Result:', result);\n this.emit('detect');\n this.state = 'idle';\n resolve(this.result);\n });\n }\n}\n\n/** Class Human as default export */\nexport { Human as default };\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,cAAc,QAAgB,MAAsB;AACzD,QAAM,YAAY,OAAO,SAAS,OAAO,KAAK;AAC9C,QAAM,WAAW,KAAK,WAAW,QAAQ,KAAK,WAAW,QAAQ,KAAK,WAAW,YAAY,KAAK,WAAW,aAAa,KAAK,WAAW;AAC1I,QAAM,OAAO,WAAW,GAAG,SAAS,GAAG,SAAS,YAAY;AAC5D,MAAI,CAAC,KAAK,oBAAoB,SAAS;AAAU,UAAM,IAAI,MAAM,oBAAoB;AACrF,SAAO;AAAA;AAIF,gBAAgB,KAAW;AAChC,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,GAAG,GAAG,WAAW,WAAW,SAAS,GAAG,QAAQ,GAAG,aAAa,WAAW,SAAS,GAAG,QAAQ,GAAG,aAAa,WAAW,SAAS,GAAG,QAAQ,GAAG,kBAAkB,WAAW,SAAS,GAAG;AAErM,MAAI;AAAK,YAAQ,IAAI,IAAI,UAAU,GAAG;AAAA;AAIjC,IAAM,MAAM,MAAM;AACvB,MAAI,OAAO,gBAAgB;AAAa,WAAO,YAAY;AAC3D,SAAO,SAAU,QAAO,QAAQ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aAAa,MAAM,QAAQ,IAAI,CAAC,SAAS,SAAS,SAAS;AAG9G,WAAK,QAAQ;AACb,UAAI,aAA8B;AAClC,UAAI,KAAK,OAAO,QAAQ,SAAS;AAC/B,oBAAY;AACZ,qBAAa,CAAC,GAAG,AAAQ,MAAK,UAAU,GAAG,AAAQ,MAAK,UAAU,GAAG,AAAQ,MAAK,UAAU,GAAG,AAAQ,MAAK;AAC5G,YAAI,CAAC,KAAK,OAAO;AAAO,eAAK,YAAY,UAAU,KAAK,MAAM,QAAQ;AAAA,iBAC7D,KAAK,YAAY;AAAS,iBAAO,KAAK,YAAY;AAAA;AAG7D,WAAK,YAAY,QAAQ,KAAK,MAAM,QAAQ;AAC5C,YAAM,QAAQ,kBAAK,YAAL,mBAAc,WAAd,mBAAsB,UAAS;AAC7C,WAAK,SAAS;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,aAAa,KAAK;AAAA,QAClB,QAAQ,KAAK,QAAQ;AAAA,QACrB,WAAW,KAAK;AAAA,YACZ,UAAU;AAAE,iBAAO,AAAQ,MAAK,SAAyB,SAAyB,SAAyB,YAAY;AAAA;AAAA;AAI7H,MAAG,yBAAQ,IAAI;AAGf,WAAK,KAAK;AACV,WAAK,QAAQ;AACb,cAAQ,KAAK;AAAA;AAAA;AAAA;AA7XjB;AACA;AACA;AAqEA;", + "sources": ["../src/util/util.ts", "../src/config.ts", "tfjs.esm.js", "../src/image/imagefx.ts", "../src/util/env.ts", "../src/image/image.ts", "../src/face/facemeshcoords.ts", "../src/face/facemeshutil.ts", "../src/face/blazeface.ts", "../src/face/iris.ts", "../src/face/facemesh.ts", "../src/face/faceres.ts", "../src/gear/emotion.ts", "../src/body/posenetutils.ts", "../src/body/posenet.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/hand/fingerdef.ts", "../src/hand/fingergesture.ts", "../src/hand/fingerpose.ts", "../src/handpose/handpose.ts", "../src/util/box.ts", "../src/hand/handtrack.ts", "../src/body/blazepose.ts", "../src/body/blazeposecoords.ts", "../src/body/efficientposecoords.ts", "../src/body/efficientpose.ts", "../src/body/movenetcoords.ts", "../src/body/movenet.ts", "../src/object/labels.ts", "../src/object/nanodet.ts", "../src/object/centernet.ts", "../src/segmentation/segmentation.ts", "../src/gear/gear-agegenderrace.ts", "../src/models.ts", "../src/tfjs/humangl.ts", "../src/tfjs/backend.ts", "../src/util/draw.ts", "../src/face/angles.ts", "../src/face/face.ts", "../src/gesture/gesture.ts", "../src/util/interpolate.ts", "../src/face/match.ts", "../src/util/persons.ts", "../src/sample.ts", "../src/warmup.ts", "../src/human.ts"], + "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`modelpath error: ${path} expecting json file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: checks current config validity\nexport function validate(defaults, config, parent = 'config', msgs: Array<{ reason: string, where: string, expected?: string }> = []) {\n for (const key of Object.keys(config)) {\n if (typeof config[key] === 'object') {\n validate(defaults[key], config[key], key, msgs);\n } else {\n const defined = defaults && (typeof defaults[key] !== 'undefined');\n if (!defined) msgs.push({ reason: 'unknown property', where: `${parent}.${key} = ${config[key]}` });\n const same = defaults && typeof defaults[key] === typeof config[key];\n if (defined && !same) msgs.push({ reason: 'property type mismatch', where: `${parent}.${key} = ${config[key]}`, expected: typeof defaults[key] });\n }\n // ok = ok && defined && same;\n }\n if (config.debug && parent === 'config' && msgs.length > 0) log('invalid configuration', msgs);\n return msgs;\n}\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data: Array) => data.reduce((acc: Array, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n\n// helper function: async wait\nexport async function wait(time) {\n const waiting = new Promise((resolve) => setTimeout(() => resolve(true), time));\n await waiting;\n}\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/** Dectector part of face configuration */\nexport interface FaceDetectorConfig {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n}\n\n/** Mesh part of face configuration */\nexport interface FaceMeshConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Iris part of face configuration */\nexport interface FaceIrisConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Description or face embedding part of face configuration\n * - also used by age and gender detection\n */\nexport interface FaceDescriptionConfig {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n}\n\n/** Emotion part of face configuration */\nexport interface FaceEmotionConfig {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n}\n\n/** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor\n*/\nexport interface FaceConfig {\n enabled: boolean,\n detector: Partial,\n mesh: Partial,\n iris: Partial,\n description: Partial,\n emotion: Partial,\n}\n\n/** Controlls and configures all body detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n * - detector: optional body detector\n *\n * `maxDetected` is valid for `posenet` and `movenet-multipose` as other models are single-pose only\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `posenet.json`, `blazepose.json`, `efficientpose.json`, `movenet-lightning.json`, `movenet-thunder.json`, `movenet-multipose.json`\n*/\nexport interface BodyConfig {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n detector?: {\n modelPath: string\n },\n}\n\n/** Controlls and configures all hand detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n *\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `detector.modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `handdetect.json` and `handtrack.json`\n*/\nexport interface HandConfig {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath?: string,\n },\n skeleton: {\n modelPath?: string,\n },\n}\n\n/** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `mb3-centernet.json` and `nanodet.json`\n*/\nexport interface ObjectConfig {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n}\n\n/** Controlls and configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - blur: blur segmentation output by pixels for more realistic image\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `selfie.json` and `meet.json`\n\n*/\nexport interface SegmentationConfig {\n enabled: boolean,\n modelPath: string,\n blur: number,\n}\n\n/** Run input through image filters before inference\n * - available only in Browser environments\n * - image filters run with near-zero latency as they are executed on the GPU using WebGL\n*/\nexport interface FilterConfig {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n}\n\n/** Controlls gesture detection */\nexport interface GestureConfig {\n enabled: boolean,\n}\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n *\n * Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L292)\n */\nexport interface Config {\n /** Backend used for TFJS operations\n * Valid build-in backends are:\n * - Browser: `cpu`, `wasm`, `webgl`, `humangl`\n * - NodeJS: `cpu`, `wasm`, `tensorflow`\n *\n * Experimental:\n * - Browser: `webgpu` - requires custom build of `tfjs-backend-webgpu`\n *\n * Defaults: `humangl` for browser and `tensorflow` for nodejs\n */\n backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu',\n // backend: string;\n\n /** Path to *.wasm files if backend is set to `wasm`\n * - if not set, auto-detects to link to CDN `jsdelivr` when running in browser\n */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n // warmup: string;\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Internal Variable */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n *\n * {@link FilterConfig}\n */\n filter: Partial,\n\n /** {@link GestureConfig} */\n gesture: Partial;\n\n /** {@link FaceConfig} */\n face: Partial,\n\n /** {@link BodyConfig} */\n body: Partial,\n\n /** {@link HandConfig} */\n hand: Partial,\n\n /** {@link ObjectConfig} */\n object: Partial,\n\n /** {@link SegmentationConfig} */\n segmentation: Partial,\n}\n\n/**\n * [See all default Config values...](https://github.com/vladmandic/human/blob/main/src/config.ts#L244)\n *\n */\nconst config: Config = {\n backend: '', // select tfjs backend to use, leave empty to use default backend\n // for browser environments: 'webgl', 'wasm', 'cpu', or 'humangl' (which is a custom version of webgl)\n // for nodejs environments: 'tensorflow', 'wasm', 'cpu'\n // default set to `humangl` for browsers and `tensorflow` for nodejs\n modelBasePath: '', // base path for all models\n // default set to `../models/` for browsers and `file://models/` for nodejs\n wasmPath: '', // path for wasm binaries, only used for backend: wasm\n // default set to download from jsdeliv during Human class instantiation\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 1, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 11, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head does not move fast\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n // in which case user is reponsible for disposing the tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 12, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 13, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n detector: {\n modelPath: '', // optional body detector\n },\n maxDetected: -1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet and movenet-multipose as other models detects single pose\n // set to -1 to autodetect based on number of detected faces\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 5, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n // only valid for `handdetect` variation\n skipFrames: 14, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.2, // ammount of overlap between two detected objects before one object is removed\n maxDetected: -1, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n // set to -1 to autodetect based on number of detected faces\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handtrack.json', // hand detector model, can be absolute path or relative to modelBasePath\n // can be 'handdetect' or 'handtrack'\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 15, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // controlls and configures all body segmentation module\n // removes background from input containing person\n // if segmentation is enabled it will run as preprocessing task before any other model\n // alternatively leave it disabled and use it on-demand using human.segmentation method which can\n // remove background or replace it with user-provided background\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n blur: 8, // blur segmentation output by n pixels for more realistic image\n },\n};\n\nexport { config as defaults };\n", "/*\n Human\n homepage: \n author: '\n*/\n\n// tfjs/tf-browser.ts\nexport * from \"@tensorflow/tfjs/dist/index.js\";\nexport * from \"@tensorflow/tfjs-backend-webgl/dist/index.js\";\nexport * from \"@tensorflow/tfjs-backend-wasm/dist/index.js\";\n\n// dist/tfjs.version.js\nvar version = \"3.9.0\";\nvar version2 = \"3.9.0\";\nvar version3 = \"3.9.0\";\nvar version4 = \"3.9.0\";\nvar version5 = \"3.9.0\";\nvar version6 = \"3.9.0\";\nvar version7 = \"3.9.0\";\nvar version8 = \"3.9.0\";\nvar version9 = {\n tfjs: version,\n \"tfjs-core\": version2,\n \"tfjs-data\": version3,\n \"tfjs-layers\": version4,\n \"tfjs-converter\": version5,\n \"tfjs-backend-cpu\": version6,\n \"tfjs-backend-webgl\": version7,\n \"tfjs-backend-wasm\": version8\n};\nexport {\n version9 as version\n};\n", "/**\n * Image Filters in WebGL algoritm implementation\n *\n * Based on: [WebGLImageFilter](https://github.com/phoboslab/WebGLImageFilter)\n *\n * This module is written in ES5 JS and does not conform to code and style standards\n */\n\n// @ts-nocheck\n\nfunction GLProgram(gl, vertexSource, fragmentSource) {\n const _collect = function (source, prefix, collection) {\n const r = new RegExp('\\\\b' + prefix + ' \\\\w+ (\\\\w+)', 'ig');\n source.replace(r, (match, name) => {\n collection[name] = 0;\n return match;\n });\n };\n\n const _compile = function (source, type) {\n const shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw new Error('filter: gl compile failed', gl.getShaderInfoLog(shader));\n return shader;\n };\n\n this.uniform = {};\n this.attribute = {};\n const _vsh = _compile(vertexSource, gl.VERTEX_SHADER);\n const _fsh = _compile(fragmentSource, gl.FRAGMENT_SHADER);\n this.id = gl.createProgram();\n gl.attachShader(this.id, _vsh);\n gl.attachShader(this.id, _fsh);\n gl.linkProgram(this.id);\n\n if (!gl.getProgramParameter(this.id, gl.LINK_STATUS)) throw new Error('filter: gl link failed', gl.getProgramInfoLog(this.id));\n\n gl.useProgram(this.id);\n // Collect attributes\n _collect(vertexSource, 'attribute', this.attribute);\n for (const a in this.attribute) this.attribute[a] = gl.getAttribLocation(this.id, a);\n // Collect uniforms\n _collect(vertexSource, 'uniform', this.uniform);\n _collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = gl.getUniformLocation(this.id, u);\n}\n\n// export const GLImageFilter = function (params) {\nexport function GLImageFilter(params) {\n if (!params) params = { };\n let _drawCount = 0;\n let _sourceTexture = null;\n let _lastInChain = false;\n let _currentFramebufferIndex = -1;\n let _tempFramebuffers = [null, null];\n let _filterChain = [];\n let _width = -1;\n let _height = -1;\n let _vertexBuffer = null;\n let _currentProgram = null;\n const _filter = {};\n const _canvas = params.canvas || document.createElement('canvas');\n // key is the shader program source, value is the compiled program\n const _shaderProgramCache = { };\n const DRAW = { INTERMEDIATE: 1 };\n const gl = _canvas.getContext('webgl');\n if (!gl) throw new Error('filter: context failed');\n\n this.addFilter = function (name) {\n // eslint-disable-next-line prefer-rest-params\n const args = Array.prototype.slice.call(arguments, 1);\n const filter = _filter[name];\n _filterChain.push({ func: filter, args });\n };\n\n this.reset = function () {\n _filterChain = [];\n };\n\n const _resize = function (width, height) {\n // Same width/height? Nothing to do here\n if (width === _width && height === _height) { return; }\n _canvas.width = width;\n _width = width;\n _canvas.height = height;\n _height = height;\n // Create the context if we don't have it yet\n if (!_vertexBuffer) {\n // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n const vertices = new Float32Array([\n -1, -1, 0, 1, 1, -1, 1, 1, -1, 1, 0, 0,\n -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0,\n ]);\n // eslint-disable-next-line no-unused-expressions\n (_vertexBuffer = gl.createBuffer(), gl.bindBuffer(gl.ARRAY_BUFFER, _vertexBuffer));\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n }\n gl.viewport(0, 0, _width, _height);\n // Delete old temp framebuffers\n _tempFramebuffers = [null, null];\n };\n\n const _createFramebufferTexture = function (width, height) {\n const fbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n const renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n return { fbo, texture };\n };\n\n const _getTempFramebuffer = function (index) {\n _tempFramebuffers[index] = _tempFramebuffers[index] || _createFramebufferTexture(_width, _height);\n return _tempFramebuffers[index];\n };\n\n const _draw = function (flags = null) {\n let source = null;\n let target = null;\n let flipY = false;\n // Set up the source\n if (_drawCount === 0) {\n // First draw call - use the source texture\n source = _sourceTexture;\n } else {\n // All following draw calls use the temp buffer last drawn to\n source = _getTempFramebuffer(_currentFramebufferIndex)?.texture;\n }\n _drawCount++;\n // Set up the target\n if (_lastInChain && !(flags & DRAW.INTERMEDIATE)) {\n // Last filter in our chain - draw directly to the WebGL Canvas. We may\n // also have to flip the image vertically now\n target = null;\n flipY = _drawCount % 2 === 0;\n } else {\n // Intermediate draw call - get a temp buffer to draw to\n _currentFramebufferIndex = (_currentFramebufferIndex + 1) % 2;\n target = _getTempFramebuffer(_currentFramebufferIndex)?.fbo;\n }\n // Bind the source and target and draw the two triangles\n gl.bindTexture(gl.TEXTURE_2D, source);\n gl.bindFramebuffer(gl.FRAMEBUFFER, target);\n gl.uniform1f(_currentProgram.uniform.flipY, (flipY ? -1 : 1));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n };\n\n this.apply = function (image) {\n _resize(image.width, image.height);\n _drawCount = 0;\n // Create the texture for the input image if we haven't yet\n if (!_sourceTexture) _sourceTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, _sourceTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n // No filters? Just draw\n if (_filterChain.length === 0) {\n // const program = _compileShader(SHADER.FRAGMENT_IDENTITY);\n _draw();\n return _canvas;\n }\n for (let i = 0; i < _filterChain.length; i++) {\n _lastInChain = (i === _filterChain.length - 1);\n const f = _filterChain[i];\n f.func.apply(this, f.args || []);\n }\n return _canvas;\n };\n\n const _compileShader = function (fragmentSource) {\n if (_shaderProgramCache[fragmentSource]) {\n _currentProgram = _shaderProgramCache[fragmentSource];\n gl.useProgram(_currentProgram.id);\n return _currentProgram;\n }\n // Compile shaders\n const SHADER = {};\n SHADER.VERTEX_IDENTITY = [\n 'precision highp float;',\n 'attribute vec2 pos;',\n 'attribute vec2 uv;',\n 'varying vec2 vUv;',\n 'uniform float flipY;',\n 'void main(void) {',\n 'vUv = uv;',\n 'gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);',\n '}',\n ].join('\\n');\n SHADER.FRAGMENT_IDENTITY = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'void main(void) {',\n 'gl_FragColor = texture2D(texture, vUv);',\n '}',\n ].join('\\n');\n _currentProgram = new GLProgram(gl, SHADER.VERTEX_IDENTITY, fragmentSource);\n const floatSize = Float32Array.BYTES_PER_ELEMENT;\n const vertSize = 4 * floatSize;\n gl.enableVertexAttribArray(_currentProgram.attribute.pos);\n gl.vertexAttribPointer(_currentProgram.attribute.pos, 2, gl.FLOAT, false, vertSize, 0 * floatSize);\n gl.enableVertexAttribArray(_currentProgram.attribute.uv);\n gl.vertexAttribPointer(_currentProgram.attribute.uv, 2, gl.FLOAT, false, vertSize, 2 * floatSize);\n _shaderProgramCache[fragmentSource] = _currentProgram;\n return _currentProgram;\n };\n\n // -------------------------------------------------------------------------\n // Color Matrix Filter\n _filter.colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n // Can we ignore the alpha value? Makes things a bit faster.\n const shader = (m[18] === 1 && m[3] === 0 && m[8] === 0 && m[13] === 0 && m[15] === 0 && m[16] === 0 && m[17] === 0 && m[19] === 0)\n ? _filter.colorMatrix.SHADER.WITHOUT_ALPHA\n : _filter.colorMatrix.SHADER.WITH_ALPHA;\n const program = _compileShader(shader);\n gl.uniform1fv(program.uniform.m, m);\n _draw();\n };\n _filter.colorMatrix.SHADER = {};\n _filter.colorMatrix.SHADER.WITH_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];',\n 'gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19];',\n '}',\n ].join('\\n');\n _filter.colorMatrix.SHADER.WITHOUT_ALPHA = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform float m[20];',\n 'void main(void) {',\n 'vec4 c = texture2D(texture, vUv);',\n 'gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[4];',\n 'gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[9];',\n 'gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14];',\n 'gl_FragColor.a = c.a;',\n '}',\n ].join('\\n');\n\n _filter.brightness = function (brightness) {\n const b = (brightness || 0) + 1;\n _filter.colorMatrix([\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.saturation = function (amount) {\n const x = (amount || 0) * 2 / 3 + 1;\n const y = ((x - 1) * -0.5);\n _filter.colorMatrix([\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturate = function () {\n _filter.saturation(-1);\n };\n\n _filter.contrast = function (amount) {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\n\n _filter.colorMatrix([\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.negative = function () {\n _filter.contrast(-2);\n };\n\n _filter.hue = function (rotation) {\n rotation = (rotation || 0) / 180 * Math.PI;\n const cos = Math.cos(rotation);\n const sin = Math.sin(rotation);\n const lumR = 0.213;\n const lumG = 0.715;\n const lumB = 0.072;\n\n _filter.colorMatrix([\n lumR + cos * (1 - lumR) + sin * (-lumR), lumG + cos * (-lumG) + sin * (-lumG), lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0,\n lumR + cos * (-lumR) + sin * (0.143), lumG + cos * (1 - lumG) + sin * (0.140), lumB + cos * (-lumB) + sin * (-0.283), 0, 0,\n lumR + cos * (-lumR) + sin * (-(1 - lumR)), lumG + cos * (-lumG) + sin * (lumG), lumB + cos * (1 - lumB) + sin * (lumB), 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.desaturateLuminance = function () {\n _filter.colorMatrix([\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0.2764723, 0.9297080, 0.0938197, 0, -37.1,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.sepia = function () {\n _filter.colorMatrix([\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.brownie = function () {\n _filter.colorMatrix([\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.vintagePinhole = function () {\n _filter.colorMatrix([\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.kodachrome = function () {\n _filter.colorMatrix([\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.technicolor = function () {\n _filter.colorMatrix([\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.polaroid = function () {\n _filter.colorMatrix([\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n _filter.shiftToBGR = function () {\n _filter.colorMatrix([\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Convolution Filter\n _filter.convolution = function (matrix) {\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / _width;\n const pixelSizeY = 1 / _height;\n const program = _compileShader(_filter.convolution.SHADER);\n gl.uniform1fv(program.uniform.m, m);\n gl.uniform2f(program.uniform.px, pixelSizeX, pixelSizeY);\n _draw();\n };\n\n _filter.convolution.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'uniform float m[9];',\n 'void main(void) {',\n 'vec4 c11 = texture2D(texture, vUv - px);', // top left\n 'vec4 c12 = texture2D(texture, vec2(vUv.x, vUv.y - px.y));', // top center\n 'vec4 c13 = texture2D(texture, vec2(vUv.x + px.x, vUv.y - px.y));', // top right\n 'vec4 c21 = texture2D(texture, vec2(vUv.x - px.x, vUv.y) );', // mid left\n 'vec4 c22 = texture2D(texture, vUv);', // mid center\n 'vec4 c23 = texture2D(texture, vec2(vUv.x + px.x, vUv.y) );', // mid right\n 'vec4 c31 = texture2D(texture, vec2(vUv.x - px.x, vUv.y + px.y) );', // bottom left\n 'vec4 c32 = texture2D(texture, vec2(vUv.x, vUv.y + px.y) );', // bottom center\n 'vec4 c33 = texture2D(texture, vUv + px );', // bottom right\n 'gl_FragColor = ',\n 'c11 * m[0] + c12 * m[1] + c22 * m[2] +',\n 'c21 * m[3] + c22 * m[4] + c23 * m[5] +',\n 'c31 * m[6] + c32 * m[7] + c33 * m[8];',\n 'gl_FragColor.a = c22.a;',\n '}',\n ].join('\\n');\n\n _filter.detectEdges = function () {\n _filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n };\n\n _filter.sobelX = function () {\n _filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n };\n\n _filter.sobelY = function () {\n _filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n };\n\n _filter.sharpen = function (amount) {\n const a = amount || 1;\n _filter.convolution.call(this, [\n 0, -1 * a, 0,\n -1 * a, 1 + 4 * a, -1 * a,\n 0, -1 * a, 0,\n ]);\n };\n\n _filter.emboss = function (size) {\n const s = size || 1;\n _filter.convolution.call(this, [\n -2 * s, -1 * s, 0,\n -1 * s, 1, 1 * s,\n 0, 1 * s, 2 * s,\n ]);\n };\n\n // -------------------------------------------------------------------------\n // Blur Filter\n _filter.blur = function (size) {\n const blurSizeX = (size / 7) / _width;\n const blurSizeY = (size / 7) / _height;\n const program = _compileShader(_filter.blur.SHADER);\n // Vertical\n gl.uniform2f(program.uniform.px, 0, blurSizeY);\n _draw(DRAW.INTERMEDIATE);\n // Horizontal\n gl.uniform2f(program.uniform.px, blurSizeX, 0);\n _draw();\n };\n\n _filter.blur.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform sampler2D texture;',\n 'uniform vec2 px;',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-7.0*px.x, -7.0*px.y))*0.0044299121055113265;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-6.0*px.x, -6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-5.0*px.x, -5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-4.0*px.x, -4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-3.0*px.x, -3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-2.0*px.x, -2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2(-1.0*px.x, -1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv )*0.159576912161;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 1.0*px.x, 1.0*px.y))*0.147308056121;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 2.0*px.x, 2.0*px.y))*0.115876621105;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 3.0*px.x, 3.0*px.y))*0.0776744219933;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 4.0*px.x, 4.0*px.y))*0.0443683338718;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 5.0*px.x, 5.0*px.y))*0.0215963866053;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794;',\n 'gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265;',\n '}',\n ].join('\\n');\n\n // -------------------------------------------------------------------------\n // Pixelate Filter\n _filter.pixelate = function (size) {\n const blurSizeX = (size) / _width;\n const blurSizeY = (size) / _height;\n const program = _compileShader(_filter.pixelate.SHADER);\n // Horizontal\n gl.uniform2f(program.uniform.size, blurSizeX, blurSizeY);\n _draw();\n };\n\n _filter.pixelate.SHADER = [\n 'precision highp float;',\n 'varying vec2 vUv;',\n 'uniform vec2 size;',\n 'uniform sampler2D texture;',\n 'vec2 pixelate(vec2 coord, vec2 size) {',\n 'return floor( coord / size ) * size;',\n '}',\n 'void main(void) {',\n 'gl_FragColor = vec4(0.0);',\n 'vec2 coord = pixelate(vUv, size);',\n 'gl_FragColor += texture2D(texture, coord);',\n '}',\n ].join('\\n');\n}\n", "import * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport { mergeDeep } from './util';\n\nexport type Env = {\n browser: undefined | boolean,\n node: undefined | boolean,\n worker: undefined | boolean,\n platform: undefined | string,\n agent: undefined | string,\n backends: string[],\n initial: boolean,\n tfjs: {\n version: undefined | string,\n },\n offscreen: undefined | boolean,\n wasm: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n simd: undefined | boolean,\n multithread: undefined | boolean,\n },\n webgl: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n version: undefined | string,\n renderer: undefined | string,\n },\n webgpu: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n adapter: undefined | string,\n },\n kernels: string[],\n Canvas: undefined,\n Image: undefined,\n ImageData: undefined,\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let env: Env = {\n browser: undefined,\n node: undefined,\n worker: undefined,\n platform: undefined,\n agent: undefined,\n initial: true,\n backends: [],\n offscreen: undefined,\n tfjs: {\n version: undefined,\n },\n wasm: {\n supported: undefined,\n backend: undefined,\n simd: undefined,\n multithread: undefined,\n },\n webgl: {\n supported: undefined,\n backend: undefined,\n version: undefined,\n renderer: undefined,\n },\n webgpu: {\n supported: undefined,\n backend: undefined,\n adapter: undefined,\n },\n kernels: [],\n Canvas: undefined,\n Image: undefined,\n ImageData: undefined,\n};\n\nexport async function cpuInfo() {\n const cpu = { model: '', flags: [] };\n if (env.node && env.platform?.startsWith('linux')) {\n // eslint-disable-next-line global-require\n const fs = require('fs');\n try {\n const data = fs.readFileSync('/proc/cpuinfo').toString();\n for (const line of data.split('\\n')) {\n if (line.startsWith('model name')) {\n cpu.model = line.match(/:(.*)/g)[0].replace(':', '').trim();\n }\n if (line.startsWith('flags')) {\n cpu.flags = line.match(/:(.*)/g)[0].replace(':', '').trim().split(' ').sort();\n }\n }\n } catch { /**/ }\n }\n if (!env['cpu']) Object.defineProperty(env, 'cpu', { value: cpu });\n else env['cpu'] = cpu;\n}\n\nexport async function backendInfo() {\n // analyze backends\n env.backends = Object.keys(tf.engine().registryFactory);\n env.wasm.supported = typeof WebAssembly !== 'undefined';\n env.wasm.backend = env.backends.includes('wasm');\n if (env.wasm.supported && env.wasm.backend && tf.getBackend() === 'wasm') {\n env.wasm.simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n env.wasm.multithread = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n }\n\n const c = image.canvas(100, 100);\n const ctx = c ? c.getContext('webgl2') : undefined; // causes too many gl contexts\n // const ctx = typeof tf.backend().getGPGPUContext !== undefined ? tf.backend().getGPGPUContext : null;\n env.webgl.supported = typeof ctx !== 'undefined';\n env.webgl.backend = env.backends.includes('webgl');\n if (env.webgl.supported && env.webgl.backend && (tf.getBackend() === 'webgl' || tf.getBackend() === 'humangl')) {\n // @ts-ignore getGPGPUContext only exists on WebGL backend\n const gl = tf.backend().gpgpu !== 'undefined' ? await tf.backend().getGPGPUContext().gl : null;\n if (gl) {\n env.webgl.version = gl.getParameter(gl.VERSION);\n env.webgl.renderer = gl.getParameter(gl.RENDERER);\n }\n }\n\n env.webgpu.supported = env.browser && typeof navigator['gpu'] !== 'undefined';\n env.webgpu.backend = env.backends.includes('webgpu');\n if (env.webgpu.supported) env.webgpu.adapter = (await navigator['gpu'].requestAdapter())?.name;\n\n // enumerate kernels\n env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());\n}\n\nexport async function get() {\n env.browser = typeof navigator !== 'undefined';\n env.node = typeof process !== 'undefined';\n // @ts-ignore WorkerGlobalScope evaluated in browser only\n env.worker = env.browser ? (typeof WorkerGlobalScope !== 'undefined') : undefined;\n env.tfjs.version = tf.version_core;\n\n // offscreencanvas supported?\n env.offscreen = typeof env.offscreen === 'undefined' ? typeof OffscreenCanvas !== 'undefined' : env.offscreen;\n // get platform and agent\n if (typeof navigator !== 'undefined') {\n const raw = navigator.userAgent.match(/\\(([^()]+)\\)/g);\n if (raw && raw[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n env.platform = (platformMatch && platformMatch[0]) ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n env.agent = navigator.userAgent.replace(raw[0], '');\n if (env.platform[1]) env.agent = env.agent.replace(raw[1], '');\n env.agent = env.agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n env.platform = `${process.platform} ${process.arch}`;\n env.agent = `NodeJS ${process.version}`;\n }\n await backendInfo();\n\n // get cpu info\n // await cpuInfo();\n}\n\nexport async function set(obj) {\n env = mergeDeep(env, obj);\n}\n", "/**\n * Image Processing algorithm implementation\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport type { Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\n\nexport type Input = Tensor | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | typeof Image | typeof env.Canvas;\n\nconst maxSize = 2048;\n// internal temp canvases\nlet inCanvas;\nlet outCanvas;\n// @ts-ignore // imagefx is js module that should be converted to a class\nlet fx: fxImage.GLImageFilter | null; // instance of imagefx\n\nexport function canvas(width, height): HTMLCanvasElement | OffscreenCanvas {\n let c;\n if (env.browser) {\n if (env.offscreen) {\n c = new OffscreenCanvas(width, height);\n } else {\n c = document.createElement('canvas');\n c.width = width;\n c.height = height;\n }\n } else {\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n }\n // if (!c) throw new Error('cannot create canvas');\n return c;\n}\n\n// process input image and return tensor\n// input can be tensor, imagedata, htmlimageelement, htmlvideoelement\n// input is resized and run through imagefx filter\nexport function process(input: Input, config: Config): { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null } {\n let tensor;\n if (!input) {\n // throw new Error('input is missing');\n if (config.debug) log('input is missing');\n return { tensor: null, canvas: null }; // video may become temporarily unavailable due to onresize\n }\n // sanity checks since different browsers do not implement all dom elements\n if (\n !(input instanceof tf.Tensor)\n && !(typeof Image !== 'undefined' && input instanceof Image)\n && !(typeof env.Canvas !== 'undefined' && input instanceof env.Canvas)\n && !(typeof globalThis.Canvas !== 'undefined' && input instanceof globalThis.Canvas)\n && !(typeof ImageData !== 'undefined' && input instanceof ImageData)\n && !(typeof ImageBitmap !== 'undefined' && input instanceof ImageBitmap)\n && !(typeof HTMLImageElement !== 'undefined' && input instanceof HTMLImageElement)\n && !(typeof HTMLMediaElement !== 'undefined' && input instanceof HTMLMediaElement)\n && !(typeof HTMLVideoElement !== 'undefined' && input instanceof HTMLVideoElement)\n && !(typeof HTMLCanvasElement !== 'undefined' && input instanceof HTMLCanvasElement)\n && !(typeof OffscreenCanvas !== 'undefined' && input instanceof OffscreenCanvas)\n ) {\n throw new Error('input type is not recognized');\n }\n if (input instanceof tf.Tensor) {\n // if input is tensor, use as-is\n if ((input as Tensor)['isDisposedInternal']) throw new Error('input tensor is disposed');\n if ((input as Tensor).shape && (input as Tensor).shape.length === 4 && (input as unknown as Tensor).shape[0] === 1 && (input as unknown as Tensor).shape[3] === 3) tensor = tf.clone(input);\n else throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${(input as Tensor).shape}`);\n } else {\n // check if resizing will be needed\n if (typeof input['readyState'] !== 'undefined' && input['readyState'] <= 2) {\n if (config.debug) log('input stream is not ready');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n const originalWidth = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) {\n if (config.debug) log('cannot determine input dimensions');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n let targetWidth = originalWidth;\n let targetHeight = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);\n }\n\n // create our canvas and resize it if needed\n if ((config.filter.width || 0) > 0) targetWidth = config.filter.width;\n else if ((config.filter.height || 0) > 0) targetWidth = originalWidth * ((config.filter.height || 0) / originalHeight);\n if ((config.filter.height || 0) > 0) targetHeight = config.filter.height;\n else if ((config.filter.width || 0) > 0) targetHeight = originalHeight * ((config.filter.width || 0) / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('input cannot determine dimension');\n if (!inCanvas || (inCanvas?.width !== targetWidth) || (inCanvas?.height !== targetHeight)) inCanvas = canvas(targetWidth, targetHeight);\n\n // draw input to our canvas\n const ctx = inCanvas.getContext('2d');\n if ((typeof ImageData !== 'undefined') && (input instanceof ImageData)) {\n ctx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof ctx.translate !== 'undefined') {\n ctx.translate(originalWidth, 0);\n ctx.scale(-1, 1);\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n ctx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n ctx.drawImage(input, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas?.width, inCanvas?.height);\n }\n }\n // imagefx transforms using gl\n if (config.filter.enabled && env.webgl.supported) {\n if (!fx || !outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas?.height !== outCanvas?.height)) {\n outCanvas = canvas(inCanvas?.width, inCanvas?.height);\n if (outCanvas?.width !== inCanvas?.width) outCanvas.width = inCanvas?.width;\n if (outCanvas?.height !== inCanvas?.height) outCanvas.height = inCanvas?.height;\n // log('created FX filter');\n fx = env.browser ? new fxImage.GLImageFilter({ canvas: outCanvas }) : null; // && (typeof document !== 'undefined')\n }\n if (!fx) return { tensor: null, canvas: inCanvas };\n fx.reset();\n fx.addFilter('brightness', config.filter.brightness); // must have at least one filter enabled\n if (config.filter.contrast !== 0) fx.addFilter('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.addFilter('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.addFilter('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.addFilter('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.addFilter('hue', config.filter.hue);\n if (config.filter.negative) fx.addFilter('negative');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.vintage) fx.addFilter('brownie');\n if (config.filter.sepia) fx.addFilter('sepia');\n if (config.filter.kodachrome) fx.addFilter('kodachrome');\n if (config.filter.technicolor) fx.addFilter('technicolor');\n if (config.filter.polaroid) fx.addFilter('polaroid');\n if (config.filter.pixelate !== 0) fx.addFilter('pixelate', config.filter.pixelate);\n fx.apply(inCanvas);\n // read pixel data\n /*\n const gl = outCanvas.getContext('webgl');\n if (gl) {\n const glBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 4);\n const pixBuffer = new Uint8Array(outCanvas.width * outCanvas.height * 3);\n gl.readPixels(0, 0, outCanvas.width, outCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, glBuffer);\n // gl returns rbga while we only need rgb, so discarding alpha channel\n // gl returns starting point as lower left, so need to invert vertical\n let i = 0;\n for (let y = outCanvas.height - 1; y >= 0; y--) {\n for (let x = 0; x < outCanvas.width; x++) {\n const index = (x + y * outCanvas.width) * 4;\n pixBuffer[i++] = glBuffer[index + 0];\n pixBuffer[i++] = glBuffer[index + 1];\n pixBuffer[i++] = glBuffer[index + 2];\n }\n }\n outCanvas.data = pixBuffer;\n const shape = [outCanvas.height, outCanvas.width, 3];\n const pixels = tf.tensor3d(outCanvas.data, shape, 'float32');\n tensor = tf.expandDims(pixels, 0);\n tf.dispose(pixels);\n }\n */\n } else {\n outCanvas = inCanvas;\n if (fx) fx = null;\n }\n // create tensor from image if tensor is not already defined\n if (!tensor) {\n let pixels;\n if (outCanvas.data) { // if we have data, just convert to tensor\n const shape = [outCanvas.height, outCanvas.width, 3];\n pixels = tf.tensor3d(outCanvas.data, shape, 'float32');\n } else if ((typeof ImageData !== 'undefined') && (outCanvas instanceof ImageData)) { // if input is imagedata, just use it\n pixels = tf.browser ? tf.browser.fromPixels(outCanvas) : null;\n } else if (config.backend === 'webgl' || config.backend === 'humangl') { // tf kernel-optimized method to get imagedata\n // we cant use canvas as-is as it already has a context, so we do a silly one more canvas\n const tempCanvas = canvas(targetWidth, targetHeight);\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n tempCtx?.drawImage(outCanvas, 0, 0);\n console.log('PIXELS', tempCanvas);\n pixels = (tf.browser && env.browser) ? tf.browser.fromPixels(tempCanvas) : null;\n try {\n pixels = (tf.browser && env.browser) ? tf.browser.fromPixels(tempCanvas) : null;\n } catch (err) {\n throw new Error('browser webgl error');\n }\n } else { // cpu and wasm kernel does not implement efficient fromPixels method\n // we cant use canvas as-is as it already has a context, so we do a silly one more canvas and do fromPixels on ImageData instead\n const tempCanvas = canvas(targetWidth, targetHeight);\n if (!tempCanvas) return { tensor: null, canvas: inCanvas };\n tempCanvas.width = targetWidth;\n tempCanvas.height = targetHeight;\n const tempCtx = tempCanvas.getContext('2d');\n if (!tempCtx) return { tensor: null, canvas: inCanvas };\n tempCtx.drawImage(outCanvas, 0, 0);\n const data = tempCtx.getImageData(0, 0, targetWidth, targetHeight);\n if (tf.browser && env.browser) {\n pixels = tf.browser.fromPixels(data);\n } else {\n pixels = tf.tidy(() => {\n const imageData = tf.tensor(Array.from(data.data), [targetWidth, targetHeight, 4]);\n const channels = tf.split(imageData, 4, 2); // split rgba to channels\n const rgb = tf.stack([channels[0], channels[1], channels[2]], 2); // stack channels back to rgb and ignore alpha\n const expand = tf.reshape(rgb, [imageData.shape[0], imageData.shape[1], 3]); // move extra dim from the end of tensor and use it as batch number instead\n return expand;\n });\n }\n }\n if (pixels) {\n const casted = tf.cast(pixels, 'float32');\n tensor = tf.expandDims(casted, 0);\n tf.dispose(pixels);\n tf.dispose(casted);\n } else {\n tensor = tf.zeros([1, targetWidth, targetHeight, 3]);\n throw new Error('cannot create tensor from input');\n }\n }\n }\n return { tensor, canvas: (config.filter.return ? outCanvas : null) };\n}\n\nlet lastInputSum = 0;\nlet lastCacheDiff = 1;\nexport async function skip(config, input: Tensor) {\n if (config.cacheSensitivity === 0) return false;\n const resizeFact = 32;\n if (!input.shape[1] || !input.shape[2]) return false;\n const reduced: Tensor = tf.image.resizeBilinear(input, [Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);\n\n // use tensor sum\n /*\n const sumT = this.tf.sum(reduced);\n const sum = await sumT.data()[0] as number;\n sumT.dispose();\n */\n // use js loop sum, faster than uploading tensor to gpu calculating and downloading back\n const reducedData = await reduced.data(); // raw image rgb array\n tf.dispose(reduced);\n let sum = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum += reducedData[3 * i + 2]; // look only at green value of each pixel\n\n const diff = 100 * (Math.max(sum, lastInputSum) / Math.min(sum, lastInputSum) - 1);\n lastInputSum = sum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n const skipFrame = diff < Math.max(config.cacheSensitivity, lastCacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n lastCacheDiff = diff > 10 * config.cacheSensitivity ? 0 : diff;\n // console.log('skipFrame', skipFrame, this.config.cacheSensitivity, diff);\n return skipFrame;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nexport const meshAnnotations = {\n silhouette: [\n 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288,\n 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136,\n 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109,\n ],\n lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],\n lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173],\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133],\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190],\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243],\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189],\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244],\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245],\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193],\n rightEyebrowLower: [35, 124, 46, 53, 52, 65],\n rightEyeIris: [473, 474, 475, 476, 477],\n leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398],\n leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362],\n leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414],\n leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463],\n leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413],\n leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464],\n leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465],\n leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417],\n leftEyebrowLower: [265, 353, 276, 283, 282, 295],\n leftEyeIris: [468, 469, 470, 471, 472],\n midwayBetweenEyes: [168],\n noseTip: [1],\n noseBottom: [2],\n noseRightCorner: [98],\n noseLeftCorner: [327],\n rightCheek: [205],\n leftCheek: [425],\n};\n\nexport const meshLandmarks = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, meshAnnotations['midwayBetweenEyes'][0]],\n};\n\nexport const blazeFaceLandmarks = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nexport const MESH_TO_IRIS_INDICES_MAP = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] },\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] },\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] },\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] },\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] },\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] },\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] },\n // { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] },\n // { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] },\n];\n\nexport const UV468 = [\n [0.499976992607117, 0.652534008026123],\n [0.500025987625122, 0.547487020492554],\n [0.499974012374878, 0.602371990680695],\n [0.482113003730774, 0.471979022026062],\n [0.500150978565216, 0.527155995368958],\n [0.499909996986389, 0.498252987861633],\n [0.499523013830185, 0.40106201171875],\n [0.289712011814117, 0.380764007568359],\n [0.499954998493195, 0.312398016452789],\n [0.499987006187439, 0.269918978214264],\n [0.500023007392883, 0.107050001621246],\n [0.500023007392883, 0.666234016418457],\n [0.5000159740448, 0.679224014282227],\n [0.500023007392883, 0.692348003387451],\n [0.499976992607117, 0.695277988910675],\n [0.499976992607117, 0.70593398809433],\n [0.499976992607117, 0.719385027885437],\n [0.499976992607117, 0.737019002437592],\n [0.499967992305756, 0.781370997428894],\n [0.499816000461578, 0.562981009483337],\n [0.473773002624512, 0.573909997940063],\n [0.104906998574734, 0.254140973091125],\n [0.365929991006851, 0.409575998783112],\n [0.338757991790771, 0.41302502155304],\n [0.311120003461838, 0.409460008144379],\n [0.274657994508743, 0.389131009578705],\n [0.393361985683441, 0.403706014156342],\n [0.345234006643295, 0.344011008739471],\n [0.370094001293182, 0.346076011657715],\n [0.319321990013123, 0.347265005111694],\n [0.297903001308441, 0.353591024875641],\n [0.24779200553894, 0.410809993743896],\n [0.396889001131058, 0.842755019664764],\n [0.280097991228104, 0.375599980354309],\n [0.106310002505779, 0.399955987930298],\n [0.2099249958992, 0.391353011131287],\n [0.355807989835739, 0.534406006336212],\n [0.471751004457474, 0.65040397644043],\n [0.474155008792877, 0.680191993713379],\n [0.439785003662109, 0.657229006290436],\n [0.414617002010345, 0.66654098033905],\n [0.450374007225037, 0.680860996246338],\n [0.428770989179611, 0.682690978050232],\n [0.374971002340317, 0.727805018424988],\n [0.486716985702515, 0.547628998756409],\n [0.485300987958908, 0.527395009994507],\n [0.257764995098114, 0.314490020275116],\n [0.401223003864288, 0.455172002315521],\n [0.429818987846375, 0.548614978790283],\n [0.421351999044418, 0.533740997314453],\n [0.276895999908447, 0.532056987285614],\n [0.483370006084442, 0.499586999416351],\n [0.33721199631691, 0.282882988452911],\n [0.296391993761063, 0.293242990970612],\n [0.169294998049736, 0.193813979625702],\n [0.447580009698868, 0.302609980106354],\n [0.392390012741089, 0.353887975215912],\n [0.354490011930466, 0.696784019470215],\n [0.067304998636246, 0.730105042457581],\n [0.442739009857178, 0.572826027870178],\n [0.457098007202148, 0.584792017936707],\n [0.381974011659622, 0.694710969924927],\n [0.392388999462128, 0.694203019142151],\n [0.277076005935669, 0.271932005882263],\n [0.422551989555359, 0.563233017921448],\n [0.385919004678726, 0.281364023685455],\n [0.383103013038635, 0.255840003490448],\n [0.331431001424789, 0.119714021682739],\n [0.229923993349075, 0.232002973556519],\n [0.364500999450684, 0.189113974571228],\n [0.229622006416321, 0.299540996551514],\n [0.173287004232407, 0.278747975826263],\n [0.472878992557526, 0.666198015213013],\n [0.446828007698059, 0.668527007102966],\n [0.422762006521225, 0.673889994621277],\n [0.445307999849319, 0.580065965652466],\n [0.388103008270264, 0.693961024284363],\n [0.403039008378983, 0.706539988517761],\n [0.403629004955292, 0.693953037261963],\n [0.460041999816895, 0.557139039039612],\n [0.431158006191254, 0.692366003990173],\n [0.452181994915009, 0.692366003990173],\n [0.475387006998062, 0.692366003990173],\n [0.465828001499176, 0.779190003871918],\n [0.472328990697861, 0.736225962638855],\n [0.473087012767792, 0.717857003211975],\n [0.473122000694275, 0.704625964164734],\n [0.473033010959625, 0.695277988910675],\n [0.427942007780075, 0.695277988910675],\n [0.426479011774063, 0.703539967536926],\n [0.423162013292313, 0.711845993995667],\n [0.4183090031147, 0.720062971115112],\n [0.390094995498657, 0.639572978019714],\n [0.013953999616206, 0.560034036636353],\n [0.499913990497589, 0.58014702796936],\n [0.413199990987778, 0.69539999961853],\n [0.409626007080078, 0.701822996139526],\n [0.468080013990402, 0.601534962654114],\n [0.422728985548019, 0.585985004901886],\n [0.463079988956451, 0.593783974647522],\n [0.37211999297142, 0.47341400384903],\n [0.334562003612518, 0.496073007583618],\n [0.411671012639999, 0.546965003013611],\n [0.242175996303558, 0.14767599105835],\n [0.290776997804642, 0.201445996761322],\n [0.327338010072708, 0.256527006626129],\n [0.399509996175766, 0.748921036720276],\n [0.441727995872498, 0.261676013469696],\n [0.429764986038208, 0.187834024429321],\n [0.412198007106781, 0.108901023864746],\n [0.288955003023148, 0.398952007293701],\n [0.218936994671822, 0.435410976409912],\n [0.41278201341629, 0.398970007896423],\n [0.257135003805161, 0.355440020561218],\n [0.427684992551804, 0.437960982322693],\n [0.448339998722076, 0.536936044692993],\n [0.178560003638268, 0.45755398273468],\n [0.247308000922203, 0.457193970680237],\n [0.286267012357712, 0.467674970626831],\n [0.332827985286713, 0.460712015628815],\n [0.368755996227264, 0.447206974029541],\n [0.398963987827301, 0.432654976844788],\n [0.476410001516342, 0.405806005001068],\n [0.189241006970406, 0.523923993110657],\n [0.228962004184723, 0.348950982093811],\n [0.490725994110107, 0.562400996685028],\n [0.404670000076294, 0.485132992267609],\n [0.019469000399113, 0.401564002037048],\n [0.426243007183075, 0.420431017875671],\n [0.396993011236191, 0.548797011375427],\n [0.266469985246658, 0.376977026462555],\n [0.439121007919312, 0.51895797252655],\n [0.032313998788595, 0.644356966018677],\n [0.419054001569748, 0.387154996395111],\n [0.462783008813858, 0.505746960639954],\n [0.238978996872902, 0.779744982719421],\n [0.198220998048782, 0.831938028335571],\n [0.107550002634525, 0.540755033493042],\n [0.183610007166862, 0.740257024765015],\n [0.134409993886948, 0.333683013916016],\n [0.385764002799988, 0.883153975009918],\n [0.490967005491257, 0.579378008842468],\n [0.382384985685349, 0.508572995662689],\n [0.174399003386497, 0.397670984268188],\n [0.318785011768341, 0.39623498916626],\n [0.343364000320435, 0.400596976280212],\n [0.396100014448166, 0.710216999053955],\n [0.187885001301765, 0.588537991046906],\n [0.430987000465393, 0.944064974784851],\n [0.318993002176285, 0.898285031318665],\n [0.266247987747192, 0.869701027870178],\n [0.500023007392883, 0.190576016902924],\n [0.499976992607117, 0.954452991485596],\n [0.366169989109039, 0.398822009563446],\n [0.393207013607025, 0.39553701877594],\n [0.410373002290726, 0.391080021858215],\n [0.194993004202843, 0.342101991176605],\n [0.388664990663528, 0.362284004688263],\n [0.365961998701096, 0.355970978736877],\n [0.343364000320435, 0.355356991291046],\n [0.318785011768341, 0.35834002494812],\n [0.301414996385574, 0.363156020641327],\n [0.058132998645306, 0.319076001644135],\n [0.301414996385574, 0.387449026107788],\n [0.499987989664078, 0.618434011936188],\n [0.415838003158569, 0.624195992946625],\n [0.445681989192963, 0.566076993942261],\n [0.465844005346298, 0.620640993118286],\n [0.49992299079895, 0.351523995399475],\n [0.288718998432159, 0.819945991039276],\n [0.335278987884521, 0.852819979190826],\n [0.440512001514435, 0.902418971061707],\n [0.128294005990028, 0.791940987110138],\n [0.408771991729736, 0.373893976211548],\n [0.455606997013092, 0.451801002025604],\n [0.499877005815506, 0.908990025520325],\n [0.375436991453171, 0.924192011356354],\n [0.11421000212431, 0.615022003650665],\n [0.448662012815475, 0.695277988910675],\n [0.4480200111866, 0.704632043838501],\n [0.447111994028091, 0.715808033943176],\n [0.444831997156143, 0.730794012546539],\n [0.430011987686157, 0.766808986663818],\n [0.406787008047104, 0.685672998428345],\n [0.400738000869751, 0.681069016456604],\n [0.392399996519089, 0.677703022956848],\n [0.367855995893478, 0.663918972015381],\n [0.247923001646996, 0.601333022117615],\n [0.452769994735718, 0.420849978923798],\n [0.43639200925827, 0.359887003898621],\n [0.416164010763168, 0.368713974952698],\n [0.413385987281799, 0.692366003990173],\n [0.228018000721931, 0.683571994304657],\n [0.468268007040024, 0.352671027183533],\n [0.411361992359161, 0.804327011108398],\n [0.499989002943039, 0.469825029373169],\n [0.479153990745544, 0.442654013633728],\n [0.499974012374878, 0.439637005329132],\n [0.432112008333206, 0.493588984012604],\n [0.499886006116867, 0.866917014122009],\n [0.49991300702095, 0.821729004383087],\n [0.456548988819122, 0.819200992584229],\n [0.344549000263214, 0.745438992977142],\n [0.37890899181366, 0.574010014533997],\n [0.374292999505997, 0.780184984207153],\n [0.319687992334366, 0.570737957954407],\n [0.357154995203018, 0.604269981384277],\n [0.295284003019333, 0.621580958366394],\n [0.447750002145767, 0.862477004528046],\n [0.410986006259918, 0.508723020553589],\n [0.31395098567009, 0.775308012962341],\n [0.354128003120422, 0.812552988529205],\n [0.324548006057739, 0.703992962837219],\n [0.189096003770828, 0.646299958229065],\n [0.279776990413666, 0.71465802192688],\n [0.1338230073452, 0.682700991630554],\n [0.336768001317978, 0.644733011722565],\n [0.429883986711502, 0.466521978378296],\n [0.455527991056442, 0.548622965812683],\n [0.437114000320435, 0.558896005153656],\n [0.467287987470627, 0.529924988746643],\n [0.414712011814117, 0.335219979286194],\n [0.37704598903656, 0.322777986526489],\n [0.344107985496521, 0.320150971412659],\n [0.312875986099243, 0.32233202457428],\n [0.283526003360748, 0.333190023899078],\n [0.241245999932289, 0.382785975933075],\n [0.102986000478268, 0.468762993812561],\n [0.267612010240555, 0.424560010433197],\n [0.297879010438919, 0.433175981044769],\n [0.333433985710144, 0.433878004550934],\n [0.366427004337311, 0.426115989685059],\n [0.396012008190155, 0.416696012020111],\n [0.420121014118195, 0.41022801399231],\n [0.007561000064015, 0.480777025222778],\n [0.432949006557465, 0.569517970085144],\n [0.458638995885849, 0.479089021682739],\n [0.473466008901596, 0.545744001865387],\n [0.476087987422943, 0.563830018043518],\n [0.468472003936768, 0.555056989192963],\n [0.433990985155106, 0.582361996173859],\n [0.483518004417419, 0.562983989715576],\n [0.482482999563217, 0.57784903049469],\n [0.42645001411438, 0.389798998832703],\n [0.438998997211456, 0.39649498462677],\n [0.450067013502121, 0.400434017181396],\n [0.289712011814117, 0.368252992630005],\n [0.276670008897781, 0.363372981548309],\n [0.517862021923065, 0.471948027610779],\n [0.710287988185883, 0.380764007568359],\n [0.526226997375488, 0.573909997940063],\n [0.895093023777008, 0.254140973091125],\n [0.634069979190826, 0.409575998783112],\n [0.661242008209229, 0.41302502155304],\n [0.688880026340485, 0.409460008144379],\n [0.725341975688934, 0.389131009578705],\n [0.606630027294159, 0.40370500087738],\n [0.654766023159027, 0.344011008739471],\n [0.629905998706818, 0.346076011657715],\n [0.680678009986877, 0.347265005111694],\n [0.702096998691559, 0.353591024875641],\n [0.75221198797226, 0.410804986953735],\n [0.602918028831482, 0.842862963676453],\n [0.719901978969574, 0.375599980354309],\n [0.893692970275879, 0.399959981441498],\n [0.790081977844238, 0.391354024410248],\n [0.643998026847839, 0.534487962722778],\n [0.528249025344849, 0.65040397644043],\n [0.525849997997284, 0.680191040039062],\n [0.560214996337891, 0.657229006290436],\n [0.585384011268616, 0.66654098033905],\n [0.549625992774963, 0.680860996246338],\n [0.57122802734375, 0.682691991329193],\n [0.624852001667023, 0.72809898853302],\n [0.513050019741058, 0.547281980514526],\n [0.51509702205658, 0.527251958847046],\n [0.742246985435486, 0.314507007598877],\n [0.598631024360657, 0.454979002475739],\n [0.570338010787964, 0.548575043678284],\n [0.578631997108459, 0.533622980117798],\n [0.723087012767792, 0.532054007053375],\n [0.516445994377136, 0.499638974666595],\n [0.662801027297974, 0.282917976379395],\n [0.70362401008606, 0.293271005153656],\n [0.830704987049103, 0.193813979625702],\n [0.552385985851288, 0.302568018436432],\n [0.607609987258911, 0.353887975215912],\n [0.645429015159607, 0.696707010269165],\n [0.932694971561432, 0.730105042457581],\n [0.557260990142822, 0.572826027870178],\n [0.542901992797852, 0.584792017936707],\n [0.6180260181427, 0.694710969924927],\n [0.607590973377228, 0.694203019142151],\n [0.722943007946014, 0.271963000297546],\n [0.577413976192474, 0.563166975975037],\n [0.614082992076874, 0.281386971473694],\n [0.616907000541687, 0.255886018276215],\n [0.668509006500244, 0.119913995265961],\n [0.770092010498047, 0.232020974159241],\n [0.635536015033722, 0.189248979091644],\n [0.77039098739624, 0.299556016921997],\n [0.826722025871277, 0.278755009174347],\n [0.527121007442474, 0.666198015213013],\n [0.553171992301941, 0.668527007102966],\n [0.577238023281097, 0.673889994621277],\n [0.554691970348358, 0.580065965652466],\n [0.611896991729736, 0.693961024284363],\n [0.59696102142334, 0.706539988517761],\n [0.596370995044708, 0.693953037261963],\n [0.539958000183105, 0.557139039039612],\n [0.568841993808746, 0.692366003990173],\n [0.547818005084991, 0.692366003990173],\n [0.52461302280426, 0.692366003990173],\n [0.534089982509613, 0.779141008853912],\n [0.527670979499817, 0.736225962638855],\n [0.526912987232208, 0.717857003211975],\n [0.526877999305725, 0.704625964164734],\n [0.526966989040375, 0.695277988910675],\n [0.572058022022247, 0.695277988910675],\n [0.573521018028259, 0.703539967536926],\n [0.57683801651001, 0.711845993995667],\n [0.581691026687622, 0.720062971115112],\n [0.609944999217987, 0.639909982681274],\n [0.986046016216278, 0.560034036636353],\n [0.5867999792099, 0.69539999961853],\n [0.590372025966644, 0.701822996139526],\n [0.531915009021759, 0.601536989212036],\n [0.577268004417419, 0.585934996604919],\n [0.536915004253387, 0.593786001205444],\n [0.627542972564697, 0.473352015018463],\n [0.665585994720459, 0.495950996875763],\n [0.588353991508484, 0.546862006187439],\n [0.757824003696442, 0.14767599105835],\n [0.709249973297119, 0.201507985591888],\n [0.672684013843536, 0.256581008434296],\n [0.600408971309662, 0.74900496006012],\n [0.55826598405838, 0.261672019958496],\n [0.570303976535797, 0.187870979309082],\n [0.588165998458862, 0.109044015407562],\n [0.711045026779175, 0.398952007293701],\n [0.781069993972778, 0.435405015945435],\n [0.587247014045715, 0.398931980133057],\n [0.742869973182678, 0.355445981025696],\n [0.572156012058258, 0.437651991844177],\n [0.55186802148819, 0.536570012569427],\n [0.821442008018494, 0.457556009292603],\n [0.752701997756958, 0.457181990146637],\n [0.71375697851181, 0.467626988887787],\n [0.66711300611496, 0.460672974586487],\n [0.631101012229919, 0.447153985500336],\n [0.6008620262146, 0.432473003864288],\n [0.523481011390686, 0.405627012252808],\n [0.810747981071472, 0.523926019668579],\n [0.771045982837677, 0.348959028720856],\n [0.509127020835876, 0.562718033790588],\n [0.595292985439301, 0.485023975372314],\n [0.980530977249146, 0.401564002037048],\n [0.573499977588654, 0.420000016689301],\n [0.602994978427887, 0.548687994480133],\n [0.733529984951019, 0.376977026462555],\n [0.560611009597778, 0.519016981124878],\n [0.967685997486115, 0.644356966018677],\n [0.580985009670258, 0.387160003185272],\n [0.537728011608124, 0.505385041236877],\n [0.760966002941132, 0.779752969741821],\n [0.801778972148895, 0.831938028335571],\n [0.892440974712372, 0.54076099395752],\n [0.816350996494293, 0.740260004997253],\n [0.865594983100891, 0.333687007427216],\n [0.614073991775513, 0.883246004581451],\n [0.508952975273132, 0.579437971115112],\n [0.617941975593567, 0.508316040039062],\n [0.825608015060425, 0.397674977779388],\n [0.681214988231659, 0.39623498916626],\n [0.656635999679565, 0.400596976280212],\n [0.603900015354156, 0.710216999053955],\n [0.81208598613739, 0.588539004325867],\n [0.56801301240921, 0.944564998149872],\n [0.681007981300354, 0.898285031318665],\n [0.733752012252808, 0.869701027870178],\n [0.633830010890961, 0.398822009563446],\n [0.606792986392975, 0.39553701877594],\n [0.589659988880157, 0.391062021255493],\n [0.805015981197357, 0.342108011245728],\n [0.611334979534149, 0.362284004688263],\n [0.634037971496582, 0.355970978736877],\n [0.656635999679565, 0.355356991291046],\n [0.681214988231659, 0.35834002494812],\n [0.698584973812103, 0.363156020641327],\n [0.941866993904114, 0.319076001644135],\n [0.698584973812103, 0.387449026107788],\n [0.584177017211914, 0.624107003211975],\n [0.554318010807037, 0.566076993942261],\n [0.534153997898102, 0.62064003944397],\n [0.711217999458313, 0.819975018501282],\n [0.664629995822906, 0.852871000766754],\n [0.559099972248077, 0.902631998062134],\n [0.871706008911133, 0.791940987110138],\n [0.591234028339386, 0.373893976211548],\n [0.544341027736664, 0.451583981513977],\n [0.624562978744507, 0.924192011356354],\n [0.88577002286911, 0.615028977394104],\n [0.551338016986847, 0.695277988910675],\n [0.551980018615723, 0.704632043838501],\n [0.552887976169586, 0.715808033943176],\n [0.555167973041534, 0.730794012546539],\n [0.569944024085999, 0.767035007476807],\n [0.593203008174896, 0.685675978660583],\n [0.599261999130249, 0.681069016456604],\n [0.607599973678589, 0.677703022956848],\n [0.631937980651855, 0.663500010967255],\n [0.752032995223999, 0.601315021514893],\n [0.547226011753082, 0.420395016670227],\n [0.563543975353241, 0.359827995300293],\n [0.583841025829315, 0.368713974952698],\n [0.586614012718201, 0.692366003990173],\n [0.771915018558502, 0.683578014373779],\n [0.531597018241882, 0.352482974529266],\n [0.588370978832245, 0.804440975189209],\n [0.52079701423645, 0.442565023899078],\n [0.567984998226166, 0.493479013442993],\n [0.543282985687256, 0.819254994392395],\n [0.655317008495331, 0.745514988899231],\n [0.621008992195129, 0.574018001556396],\n [0.625559985637665, 0.78031200170517],\n [0.680198013782501, 0.570719003677368],\n [0.64276397228241, 0.604337990283966],\n [0.704662978649139, 0.621529996395111],\n [0.552012026309967, 0.862591981887817],\n [0.589071989059448, 0.508637011051178],\n [0.685944974422455, 0.775357007980347],\n [0.645735025405884, 0.812640011310577],\n [0.675342977046967, 0.703978002071381],\n [0.810858011245728, 0.646304965019226],\n [0.72012197971344, 0.714666962623596],\n [0.866151988506317, 0.682704985141754],\n [0.663187026977539, 0.644596993923187],\n [0.570082008838654, 0.466325998306274],\n [0.544561982154846, 0.548375964164734],\n [0.562758982181549, 0.558784961700439],\n [0.531987011432648, 0.530140042304993],\n [0.585271000862122, 0.335177004337311],\n [0.622952997684479, 0.32277899980545],\n [0.655896008014679, 0.320163011550903],\n [0.687132000923157, 0.322345972061157],\n [0.716481983661652, 0.333200991153717],\n [0.758756995201111, 0.382786989212036],\n [0.897013008594513, 0.468769013881683],\n [0.732392013072968, 0.424547016620636],\n [0.70211398601532, 0.433162987232208],\n [0.66652500629425, 0.433866024017334],\n [0.633504986763, 0.426087975502014],\n [0.603875994682312, 0.416586995124817],\n [0.579657971858978, 0.409945011138916],\n [0.992439985275269, 0.480777025222778],\n [0.567192018032074, 0.569419980049133],\n [0.54136598110199, 0.478899002075195],\n [0.526564002037048, 0.546118021011353],\n [0.523913025856018, 0.563830018043518],\n [0.531529009342194, 0.555056989192963],\n [0.566035985946655, 0.582329034805298],\n [0.51631098985672, 0.563053965568542],\n [0.5174720287323, 0.577877044677734],\n [0.573594987392426, 0.389806985855103],\n [0.560697972774506, 0.395331978797913],\n [0.549755990505219, 0.399751007556915],\n [0.710287988185883, 0.368252992630005],\n [0.723330020904541, 0.363372981548309],\n];\n\nexport const TRI468 = [\n 127, 34, 139, 11, 0, 37, 232, 231, 120, 72, 37, 39, 128, 121, 47, 232, 121, 128, 104, 69, 67, 175, 171, 148, 157, 154, 155, 118, 50, 101, 73, 39, 40, 9,\n 151, 108, 48, 115, 131, 194, 204, 211, 74, 40, 185, 80, 42, 183, 40, 92, 186, 230, 229, 118, 202, 212, 214, 83, 18, 17, 76, 61, 146, 160, 29, 30, 56,\n 157, 173, 106, 204, 194, 135, 214, 192, 203, 165, 98, 21, 71, 68, 51, 45, 4, 144, 24, 23, 77, 146, 91, 205, 50, 187, 201, 200, 18, 91, 106, 182, 90, 91,\n 181, 85, 84, 17, 206, 203, 36, 148, 171, 140, 92, 40, 39, 193, 189, 244, 159, 158, 28, 247, 246, 161, 236, 3, 196, 54, 68, 104, 193, 168, 8, 117,\n 228, 31, 189, 193, 55, 98, 97, 99, 126, 47, 100, 166, 79, 218, 155, 154, 26, 209, 49, 131, 135, 136, 150, 47, 126, 217, 223, 52, 53, 45, 51, 134, 211,\n 170, 140, 67, 69, 108, 43, 106, 91, 230, 119, 120, 226, 130, 247, 63, 53, 52, 238, 20, 242, 46, 70, 156, 78, 62, 96, 46, 53, 63, 143, 34, 227, 173,\n 155, 133, 123, 117, 111, 44, 125, 19, 236, 134, 51, 216, 206, 205, 154, 153, 22, 39, 37, 167, 200, 201, 208, 36, 142, 100, 57, 212, 202, 20, 60, 99, 28,\n 158, 157, 35, 226, 113, 160, 159, 27, 204, 202, 210, 113, 225, 46, 43, 202, 204, 62, 76, 77, 137, 123, 116, 41, 38, 72, 203, 129, 142, 64, 98, 240, 49,\n 102, 64, 41, 73, 74, 212, 216, 207, 42, 74, 184, 169, 170, 211, 170, 149, 176, 105, 66, 69, 122, 6, 168, 123, 147, 187, 96, 77, 90, 65, 55, 107, 89,\n 90, 180, 101, 100, 120, 63, 105, 104, 93, 137, 227, 15, 86, 85, 129, 102, 49, 14, 87, 86, 55, 8, 9, 100, 47, 121, 145, 23, 22, 88, 89, 179, 6, 122,\n 196, 88, 95, 96, 138, 172, 136, 215, 58, 172, 115, 48, 219, 42, 80, 81, 195, 3, 51, 43, 146, 61, 171, 175, 199, 81, 82, 38, 53, 46, 225, 144, 163, 110,\n 246, 33, 7, 52, 65, 66, 229, 228, 117, 34, 127, 234, 107, 108, 69, 109, 108, 151, 48, 64, 235, 62, 78, 191, 129, 209, 126, 111, 35, 143, 163, 161, 246,\n 117, 123, 50, 222, 65, 52, 19, 125, 141, 221, 55, 65, 3, 195, 197, 25, 7, 33, 220, 237, 44, 70, 71, 139, 122, 193, 245, 247, 130, 33, 71, 21, 162,\n 153, 158, 159, 170, 169, 150, 188, 174, 196, 216, 186, 92, 144, 160, 161, 2, 97, 167, 141, 125, 241, 164, 167, 37, 72, 38, 12, 145, 159, 160, 38, 82, 13,\n 63, 68, 71, 226, 35, 111, 158, 153, 154, 101, 50, 205, 206, 92, 165, 209, 198, 217, 165, 167, 97, 220, 115, 218, 133, 112, 243, 239, 238, 241, 214,\n 135, 169, 190, 173, 133, 171, 208, 32, 125, 44, 237, 86, 87, 178, 85, 86, 179, 84, 85, 180, 83, 84, 181, 201, 83, 182, 137, 93, 132, 76, 62, 183, 61,\n 76, 184, 57, 61, 185, 212, 57, 186, 214, 207, 187, 34, 143, 156, 79, 239, 237, 123, 137, 177, 44, 1, 4, 201, 194, 32, 64, 102, 129, 213, 215, 138, 59,\n 166, 219, 242, 99, 97, 2, 94, 141, 75, 59, 235, 24, 110, 228, 25, 130, 226, 23, 24, 229, 22, 23, 230, 26, 22, 231, 112, 26, 232, 189, 190, 243, 221, 56,\n 190, 28, 56, 221, 27, 28, 222, 29, 27, 223, 30, 29, 224, 247, 30, 225, 238, 79, 20, 166, 59, 75, 60, 75, 240, 147, 177, 215, 20, 79, 166, 187, 147, 213,\n 112, 233, 244, 233, 128, 245, 128, 114, 188, 114, 217, 174, 131, 115, 220, 217, 198, 236, 198, 131, 134, 177, 132, 58, 143, 35, 124, 110, 163, 7, 228,\n 110, 25, 356, 389, 368, 11, 302, 267, 452, 350, 349, 302, 303, 269, 357, 343, 277, 452, 453, 357, 333, 332, 297, 175, 152, 377, 384, 398, 382, 347,\n 348, 330, 303, 304, 270, 9, 336, 337, 278, 279, 360, 418, 262, 431, 304, 408, 409, 310, 415, 407, 270, 409, 410, 450, 348, 347, 422, 430, 434, 313,\n 314, 17, 306, 307, 375, 387, 388, 260, 286, 414, 398, 335, 406, 418, 364, 367, 416, 423, 358, 327, 251, 284, 298, 281, 5, 4, 373, 374, 253, 307, 320,\n 321, 425, 427, 411, 421, 313, 18, 321, 405, 406, 320, 404, 405, 315, 16, 17, 426, 425, 266, 377, 400, 369, 322, 391, 269, 417, 465, 464, 386, 257, 258,\n 466, 260, 388, 456, 399, 419, 284, 332, 333, 417, 285, 8, 346, 340, 261, 413, 441, 285, 327, 460, 328, 355, 371, 329, 392, 439, 438, 382, 341, 256,\n 429, 420, 360, 364, 394, 379, 277, 343, 437, 443, 444, 283, 275, 440, 363, 431, 262, 369, 297, 338, 337, 273, 375, 321, 450, 451, 349, 446, 342, 467,\n 293, 334, 282, 458, 461, 462, 276, 353, 383, 308, 324, 325, 276, 300, 293, 372, 345, 447, 382, 398, 362, 352, 345, 340, 274, 1, 19, 456, 248, 281, 436,\n 427, 425, 381, 256, 252, 269, 391, 393, 200, 199, 428, 266, 330, 329, 287, 273, 422, 250, 462, 328, 258, 286, 384, 265, 353, 342, 387, 259, 257, 424,\n 431, 430, 342, 353, 276, 273, 335, 424, 292, 325, 307, 366, 447, 345, 271, 303, 302, 423, 266, 371, 294, 455, 460, 279, 278, 294, 271, 272, 304, 432,\n 434, 427, 272, 407, 408, 394, 430, 431, 395, 369, 400, 334, 333, 299, 351, 417, 168, 352, 280, 411, 325, 319, 320, 295, 296, 336, 319, 403, 404, 330,\n 348, 349, 293, 298, 333, 323, 454, 447, 15, 16, 315, 358, 429, 279, 14, 15, 316, 285, 336, 9, 329, 349, 350, 374, 380, 252, 318, 402, 403, 6, 197, 419,\n 318, 319, 325, 367, 364, 365, 435, 367, 397, 344, 438, 439, 272, 271, 311, 195, 5, 281, 273, 287, 291, 396, 428, 199, 311, 271, 268, 283, 444, 445,\n 373, 254, 339, 263, 466, 249, 282, 334, 296, 449, 347, 346, 264, 447, 454, 336, 296, 299, 338, 10, 151, 278, 439, 455, 292, 407, 415, 358, 371, 355,\n 340, 345, 372, 390, 249, 466, 346, 347, 280, 442, 443, 282, 19, 94, 370, 441, 442, 295, 248, 419, 197, 263, 255, 359, 440, 275, 274, 300, 383, 368,\n 351, 412, 465, 263, 467, 466, 301, 368, 389, 380, 374, 386, 395, 378, 379, 412, 351, 419, 436, 426, 322, 373, 390, 388, 2, 164, 393, 370, 462, 461,\n 164, 0, 267, 302, 11, 12, 374, 373, 387, 268, 12, 13, 293, 300, 301, 446, 261, 340, 385, 384, 381, 330, 266, 425, 426, 423, 391, 429, 355, 437, 391,\n 327, 326, 440, 457, 438, 341, 382, 362, 459, 457, 461, 434, 430, 394, 414, 463, 362, 396, 369, 262, 354, 461, 457, 316, 403, 402, 315, 404, 403, 314,\n 405, 404, 313, 406, 405, 421, 418, 406, 366, 401, 361, 306, 408, 407, 291, 409, 408, 287, 410, 409, 432, 436, 410, 434, 416, 411, 264, 368, 383, 309,\n 438, 457, 352, 376, 401, 274, 275, 4, 421, 428, 262, 294, 327, 358, 433, 416, 367, 289, 455, 439, 462, 370, 326, 2, 326, 370, 305, 460, 455, 254,\n 449, 448, 255, 261, 446, 253, 450, 449, 252, 451, 450, 256, 452, 451, 341, 453, 452, 413, 464, 463, 441, 413, 414, 258, 442, 441, 257, 443, 442, 259,\n 444, 443, 260, 445, 444, 467, 342, 445, 459, 458, 250, 289, 392, 290, 290, 328, 460, 376, 433, 435, 250, 290, 392, 411, 416, 433, 341, 463, 464, 453,\n 464, 465, 357, 465, 412, 343, 412, 399, 360, 363, 440, 437, 399, 456, 420, 456, 363, 401, 435, 288, 372, 383, 353, 339, 255, 249, 448, 261, 255, 133,\n 243, 190, 133, 155, 112, 33, 246, 247, 33, 130, 25, 398, 384, 286, 362, 398, 414, 362, 463, 341, 263, 359, 467, 263, 249, 255, 466, 467, 260, 75, 60,\n 166, 238, 239, 79, 162, 127, 139, 72, 11, 37, 121, 232, 120, 73, 72, 39, 114, 128, 47, 233, 232, 128, 103, 104, 67, 152, 175, 148, 173, 157, 155,\n 119, 118, 101, 74, 73, 40, 107, 9, 108, 49, 48, 131, 32, 194, 211, 184, 74, 185, 191, 80, 183, 185, 40, 186, 119, 230, 118, 210, 202, 214, 84, 83, 17,\n 77, 76, 146, 161, 160, 30, 190, 56, 173, 182, 106, 194, 138, 135, 192, 129, 203, 98, 54, 21, 68, 5, 51, 4, 145, 144, 23, 90, 77, 91, 207, 205, 187, 83,\n 201, 18, 181, 91, 182, 180, 90, 181, 16, 85, 17, 205, 206, 36, 176, 148, 140, 165, 92, 39, 245, 193, 244, 27, 159, 28, 30, 247, 161, 174, 236, 196,\n 103, 54, 104, 55, 193, 8, 111, 117, 31, 221, 189, 55, 240, 98, 99, 142, 126, 100, 219, 166, 218, 112, 155, 26, 198, 209, 131, 169, 135, 150, 114, 47,\n 217, 224, 223, 53, 220, 45, 134, 32, 211, 140, 109, 67, 108, 146, 43, 91, 231, 230, 120, 113, 226, 247, 105, 63, 52, 241, 238, 242, 124, 46, 156, 95,\n 78, 96, 70, 46, 63, 116, 143, 227, 116, 123, 111, 1, 44, 19, 3, 236, 51, 207, 216, 205, 26, 154, 22, 165, 39, 167, 199, 200, 208, 101, 36, 100, 43,\n 57, 202, 242, 20, 99, 56, 28, 157, 124, 35, 113, 29, 160, 27, 211, 204, 210, 124, 113, 46, 106, 43, 204, 96, 62, 77, 227, 137, 116, 73, 41, 72, 36, 203,\n 142, 235, 64, 240, 48, 49, 64, 42, 41, 74, 214, 212, 207, 183, 42, 184, 210, 169, 211, 140, 170, 176, 104, 105, 69, 193, 122, 168, 50, 123, 187, 89, 96,\n 90, 66, 65, 107, 179, 89, 180, 119, 101, 120, 68, 63, 104, 234, 93, 227, 16, 15, 85, 209, 129, 49, 15, 14, 86, 107, 55, 9, 120, 100, 121, 153, 145, 22,\n 178, 88, 179, 197, 6, 196, 89, 88, 96, 135, 138, 136, 138, 215, 172, 218, 115, 219, 41, 42, 81, 5, 195, 51, 57, 43, 61, 208, 171, 199, 41, 81, 38,\n 224, 53, 225, 24, 144, 110, 105, 52, 66, 118, 229, 117, 227, 34, 234, 66, 107, 69, 10, 109, 151, 219, 48, 235, 183, 62, 191, 142, 129, 126, 116, 111,\n 143, 7, 163, 246, 118, 117, 50, 223, 222, 52, 94, 19, 141, 222, 221, 65, 196, 3, 197, 45, 220, 44, 156, 70, 139, 188, 122, 245, 139, 71, 162, 145,\n 153, 159, 149, 170, 150, 122, 188, 196, 206, 216, 92, 163, 144, 161, 164, 2, 167, 242, 141, 241, 0, 164, 37, 11, 72, 12, 144, 145, 160, 12, 38, 13, 70,\n 63, 71, 31, 226, 111, 157, 158, 154, 36, 101, 205, 203, 206, 165, 126, 209, 217, 98, 165, 97, 237, 220, 218, 237, 239, 241, 210, 214, 169, 140, 171, 32,\n 241, 125, 237, 179, 86, 178, 180, 85, 179, 181, 84, 180, 182, 83, 181, 194, 201, 182, 177, 137, 132, 184, 76, 183, 185, 61, 184, 186, 57, 185, 216, 212,\n 186, 192, 214, 187, 139, 34, 156, 218, 79, 237, 147, 123, 177, 45, 44, 4, 208, 201, 32, 98, 64, 129, 192, 213, 138, 235, 59, 219, 141, 242, 97, 97, 2,\n 141, 240, 75, 235, 229, 24, 228, 31, 25, 226, 230, 23, 229, 231, 22, 230, 232, 26, 231, 233, 112, 232, 244, 189, 243, 189, 221, 190, 222, 28, 221,\n 223, 27, 222, 224, 29, 223, 225, 30, 224, 113, 247, 225, 99, 60, 240, 213, 147, 215, 60, 20, 166, 192, 187, 213, 243, 112, 244, 244, 233, 245, 245,\n 128, 188, 188, 114, 174, 134, 131, 220, 174, 217, 236, 236, 198, 134, 215, 177, 58, 156, 143, 124, 25, 110, 7, 31, 228, 25, 264, 356, 368, 0, 11, 267,\n 451, 452, 349, 267, 302, 269, 350, 357, 277, 350, 452, 357, 299, 333, 297, 396, 175, 377, 381, 384, 382, 280, 347, 330, 269, 303, 270, 151, 9, 337,\n 344, 278, 360, 424, 418, 431, 270, 304, 409, 272, 310, 407, 322, 270, 410, 449, 450, 347, 432, 422, 434, 18, 313, 17, 291, 306, 375, 259, 387, 260,\n 424, 335, 418, 434, 364, 416, 391, 423, 327, 301, 251, 298, 275, 281, 4, 254, 373, 253, 375, 307, 321, 280, 425, 411, 200, 421, 18, 335, 321, 406,\n 321, 320, 405, 314, 315, 17, 423, 426, 266, 396, 377, 369, 270, 322, 269, 413, 417, 464, 385, 386, 258, 248, 456, 419, 298, 284, 333, 168, 417, 8,\n 448, 346, 261, 417, 413, 285, 326, 327, 328, 277, 355, 329, 309, 392, 438, 381, 382, 256, 279, 429, 360, 365, 364, 379, 355, 277, 437, 282, 443, 283,\n 281, 275, 363, 395, 431, 369, 299, 297, 337, 335, 273, 321, 348, 450, 349, 359, 446, 467, 283, 293, 282, 250, 458, 462, 300, 276, 383, 292, 308, 325,\n 283, 276, 293, 264, 372, 447, 346, 352, 340, 354, 274, 19, 363, 456, 281, 426, 436, 425, 380, 381, 252, 267, 269, 393, 421, 200, 428, 371, 266, 329,\n 432, 287, 422, 290, 250, 328, 385, 258, 384, 446, 265, 342, 386, 387, 257, 422, 424, 430, 445, 342, 276, 422, 273, 424, 306, 292, 307, 352, 366, 345,\n 268, 271, 302, 358, 423, 371, 327, 294, 460, 331, 279, 294, 303, 271, 304, 436, 432, 427, 304, 272, 408, 395, 394, 431, 378, 395, 400, 296, 334, 299,\n 6, 351, 168, 376, 352, 411, 307, 325, 320, 285, 295, 336, 320, 319, 404, 329, 330, 349, 334, 293, 333, 366, 323, 447, 316, 15, 315, 331, 358, 279,\n 317, 14, 316, 8, 285, 9, 277, 329, 350, 253, 374, 252, 319, 318, 403, 351, 6, 419, 324, 318, 325, 397, 367, 365, 288, 435, 397, 278, 344, 439, 310,\n 272, 311, 248, 195, 281, 375, 273, 291, 175, 396, 199, 312, 311, 268, 276, 283, 445, 390, 373, 339, 295, 282, 296, 448, 449, 346, 356, 264, 454, 337,\n 336, 299, 337, 338, 151, 294, 278, 455, 308, 292, 415, 429, 358, 355, 265, 340, 372, 388, 390, 466, 352, 346, 280, 295, 442, 282, 354, 19, 370, 285,\n 441, 295, 195, 248, 197, 457, 440, 274, 301, 300, 368, 417, 351, 465, 251, 301, 389, 385, 380, 386, 394, 395, 379, 399, 412, 419, 410, 436, 322, 387,\n 373, 388, 326, 2, 393, 354, 370, 461, 393, 164, 267, 268, 302, 12, 386, 374, 387, 312, 268, 13, 298, 293, 301, 265, 446, 340, 380, 385, 381, 280, 330,\n 425, 322, 426, 391, 420, 429, 437, 393, 391, 326, 344, 440, 438, 458, 459, 461, 364, 434, 394, 428, 396, 262, 274, 354, 457, 317, 316, 402, 316, 315,\n 403, 315, 314, 404, 314, 313, 405, 313, 421, 406, 323, 366, 361, 292, 306, 407, 306, 291, 408, 291, 287, 409, 287, 432, 410, 427, 434, 411, 372, 264,\n 383, 459, 309, 457, 366, 352, 401, 1, 274, 4, 418, 421, 262, 331, 294, 358, 435, 433, 367, 392, 289, 439, 328, 462, 326, 94, 2, 370, 289, 305, 455, 339,\n 254, 448, 359, 255, 446, 254, 253, 449, 253, 252, 450, 252, 256, 451, 256, 341, 452, 414, 413, 463, 286, 441, 414, 286, 258, 441, 258, 257, 442, 257,\n 259, 443, 259, 260, 444, 260, 467, 445, 309, 459, 250, 305, 289, 290, 305, 290, 460, 401, 376, 435, 309, 250, 392, 376, 411, 433, 453, 341, 464, 357,\n 453, 465, 343, 357, 412, 437, 343, 399, 344, 360, 440, 420, 437, 456, 360, 420, 363, 361, 401, 288, 265, 372, 353, 390, 339, 249, 339, 448, 255];\n\nexport const TRI68 = [0, 1, 36, 0, 36, 17, 1, 2, 41, 1, 41, 36, 2, 3, 31, 2, 31, 41, 3, 4, 48, 3, 48, 31, 4, 5, 48, 5, 6, 48, 6, 7, 59, 6, 59, 48, 7, 8, 58, 7, 58, 59,\n 8, 9, 56, 8, 56, 57, 8, 57, 58, 9, 10, 55, 9, 55, 56, 10, 11, 54, 10, 54, 55, 11, 12, 54, 12, 13, 54, 13, 14, 35, 13, 35, 54, 14, 15, 46, 14, 46, 35, 15, 16,\n 45, 15, 45, 46, 16, 26, 45, 17, 36, 18, 18, 37, 19, 18, 36, 37, 19, 38, 20, 19, 37, 38, 20, 39, 21, 20, 38, 39, 21, 39, 27, 22, 42, 23, 22, 27, 42, 23, 43, 24,\n 23, 42, 43, 24, 44, 25, 24, 43, 44, 25, 45, 26, 25, 44, 45, 27, 39, 28, 27, 28, 42, 28, 39, 29, 28, 29, 42, 29, 31, 30, 29, 30, 35, 29, 40, 31, 29, 35, 47, 29,\n 39, 40, 29, 47, 42, 30, 31, 32, 30, 32, 33, 30, 33, 34, 30, 34, 35, 31, 50, 32, 31, 40, 41, 31, 48, 49, 31, 49, 50, 32, 51, 33, 32, 50, 51, 33, 51, 34, 34, 52,\n 35, 34, 51, 52, 35, 46, 47, 35, 52, 53, 35, 53, 54, 36, 41, 37, 37, 40, 38, 37, 41, 40, 38, 40, 39, 42, 47, 43, 43, 47, 44, 44, 46, 45, 44, 47, 46, 48, 60, 49,\n 48, 59, 60, 49, 61, 50, 49, 60, 61, 50, 62, 51, 50, 61, 62, 51, 62, 52, 52, 63, 53, 52, 62, 63, 53, 64, 54, 53, 63, 64, 54, 64, 55, 55, 65, 56, 55, 64, 65, 56,\n 66, 57, 56, 65, 66, 57, 66, 58, 58, 67, 59, 58, 66, 67, 59, 67, 60, 60, 67, 61, 61, 66, 62, 61, 67, 66, 62, 66, 63, 63, 65, 64, 63, 66, 65, 21, 27, 22];\n\nexport const TRI33 = [\n /* eyes */ 0, 8, 7, 7, 8, 1, 2, 10, 9, 9, 10, 3,\n /* brows */ 17, 0, 18, 18, 0, 7, 18, 7, 19, 19, 7, 1, 19, 1, 11, 19, 11, 20, 21, 3, 22, 21, 9, 3, 20, 9, 21, 20, 2, 9, 20, 11, 2,\n /* 4head */ 23, 17, 18, 25, 21, 22, 24, 19, 20, 24, 18, 19, 24, 20, 21, 24, 23, 18, 24, 21, 25,\n /* nose */ 11, 12, 4, 11, 4, 13, 1, 12, 11, 11, 13, 2, 12, 14, 4, 4, 14, 13,\n /* up-lip */ 14, 5, 15, 14, 15, 6, 12, 5, 14, 14, 6, 13,\n /* cheeks */ 8, 12, 1, 2, 13, 10, 8, 26, 12, 10, 13, 27, 26, 5, 12, 13, 6, 27, 0, 26, 8, 10, 27, 3,\n /* chin */ 5, 32, 16, 16, 32, 6, 5, 30, 32, 6, 32, 31,\n /* cont */ 26, 30, 5, 27, 6, 31, 0, 28, 26, 3, 27, 29, 17, 28, 0, 3, 29, 22, 23, 28, 17, 22, 29, 25, 28, 30, 26, 27, 31, 29,\n];\n\nexport const TRI7 = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68 = [\n /* cont */ 127, 234, 132, 58, 172, 150, 149, 148, 152, 377, 378, 379, 397, 288, 361, 454, 356,\n /* brows */ 70, 63, 105, 66, 107, 336, 296, 334, 293, 300,\n /* nose */ 168, 6, 195, 4, 98, 97, 2, 326, 327,\n /* eyes */ 33, 160, 158, 133, 153, 144, 362, 385, 387, 263, 373, 380,\n /* lip */ 57, 40, 37, 0, 267, 270, 287, 321, 314, 17, 84, 91,\n /* mouth */ 78, 81, 13, 311, 308, 402, 14, 178,\n];\n\nexport const VTX33 = [33, 133, 362, 263, 1, 62, 308, 159, 145, 386, 374, 6, 102, 331, 2, 13, 14, 70, 105, 107, 336, 334, 300, 54, 10, 284, 50, 280, 234, 454, 58, 288, 152];\n\nexport const VTX7 = [33, 133, 362, 263, 1, 78, 308];\n\nexport const UV68 = VTX68.map((x) => UV468[x]);\n\nexport const UV33 = VTX33.map((x) => UV468[x]);\n\nexport const UV7 = VTX7.map((x) => UV468[x]);\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport type { Box, Point } from '../result';\n\nexport const createBox = (startEndTensor) => ({ startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]), endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]) });\n\nexport const disposeBox = (t) => tf.dispose([t.startPoint, t.endPoint]);\n\nexport const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])];\n\nexport const getBoxCenter = (box): [number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2];\n\nexport const getClampedBox = (box, input): Box => (box ? [\n Math.trunc(Math.max(0, box.startPoint[0])),\n Math.trunc(Math.max(0, box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), box.endPoint[1]) - Math.max(0, box.startPoint[1])),\n] : [0, 0, 0, 0]);\n\nexport const getRawBox = (box, input): Box => (box ? [\n box.startPoint[0] / (input.shape[2] || 0),\n box.startPoint[1] / (input.shape[1] || 0),\n (box.endPoint[0] - box.startPoint[0]) / (input.shape[2] || 0),\n (box.endPoint[1] - box.startPoint[1]) / (input.shape[1] || 0),\n] : [0, 0, 0, 0]);\n\nexport const scaleBoxCoordinates = (box, factor) => {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n return { startPoint, endPoint };\n};\n\nexport const cutBoxFromImageAndResize = (box, image, cropSize) => {\n const h = image.shape[1];\n const w = image.shape[2];\n return tf.image.cropAndResize(image, [[box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w]], [0], cropSize);\n};\n\nexport const enlargeBox = (box, factor = 1.5) => {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize: [number, number] = [factor * size[0] / 2, factor * size[1] / 2];\n return { startPoint: [center[0] - halfSize[0], center[1] - halfSize[1]] as Point, endPoint: [center[0] + halfSize[0], center[1] + halfSize[1]] as Point, landmarks: box.landmarks };\n};\n\nexport const squarifyBox = (box) => {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize = Math.max(...size) / 2;\n return { startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)] as Point, endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)] as Point, landmarks: box.landmarks };\n};\n\nexport const calculateLandmarksBoundingBox = (landmarks) => {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n return { startPoint: [Math.min(...xs), Math.min(...ys)], endPoint: [Math.max(...xs), Math.max(...ys)], landmarks };\n};\n\nexport const IDENTITY_MATRIX = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n\nexport const normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n\nexport const computeRotation = (point1, point2) => normalizeRadians(Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]));\n\nexport const radToDegrees = (rad) => rad * 180 / Math.PI;\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport const dot = (v1, v2) => {\n let product = 0;\n for (let i = 0; i < v1.length; i++) product += v1[i] * v2[i];\n return product;\n};\n\nexport const getColumnFrom2DArr = (arr, columnIndex) => {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) column.push(arr[i][columnIndex]);\n return column;\n};\n\nexport const multiplyTransformMatrices = (mat1, mat2) => {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n return product;\n};\n\nexport const buildRotationMatrix = (rotation, center) => {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n};\n\nexport const invertTransformMatrix = (matrix) => {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [-dot(rotationComponent[0], translationComponent), -dot(rotationComponent[1], translationComponent)];\n return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];\n};\n\nexport const rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];\n\nexport const xyDistanceBetweenPoints = (a, b) => Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n\nexport function generateAnchors(inputSize) {\n const spec = { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] };\n const anchors: Array<[number, number]> = [];\n for (let i = 0; i < spec.strides.length; i++) {\n const stride = spec.strides[i];\n const gridRows = Math.floor((inputSize + stride - 1) / stride);\n const gridCols = Math.floor((inputSize + stride - 1) / stride);\n const anchorsNum = spec.anchors[i];\n for (let gridY = 0; gridY < gridRows; gridY++) {\n const anchorY = stride * (gridY + 0.5);\n for (let gridX = 0; gridX < gridCols; gridX++) {\n const anchorX = stride * (gridX + 0.5);\n for (let n = 0; n < anchorsNum; n++) anchors.push([anchorX, anchorY]);\n }\n }\n }\n return anchors;\n}\n\nexport function transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize) {\n const boxSize = getBoxSize({ startPoint: box.startPoint, endPoint: box.endPoint });\n const coordsScaled = rawCoords.map((coord) => ([\n boxSize[0] / inputSize * (coord[0] - inputSize / 2),\n boxSize[1] / inputSize * (coord[1] - inputSize / 2),\n coord[2] || 0,\n ]));\n const coordsRotationMatrix = (angle !== 0) ? buildRotationMatrix(angle, [0, 0]) : IDENTITY_MATRIX;\n const coordsRotated = (angle !== 0) ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = (angle !== 0) ? invertTransformMatrix(rotationMatrix) : IDENTITY_MATRIX;\n const boxCenter = [...getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint }), 1];\n return coordsRotated.map((coord) => ([\n Math.round(coord[0] + dot(boxCenter, inverseRotationMatrix[0])),\n Math.round(coord[1] + dot(boxCenter, inverseRotationMatrix[1])),\n Math.round(coord[2] || 0),\n ]));\n}\n\nexport function correctFaceRotation(box, input, inputSize) {\n const [indexOfMouth, indexOfForehead] = (box.landmarks.length >= coords.meshLandmarks.count) ? coords.meshLandmarks.symmetryLine : coords.blazeFaceLandmarks.symmetryLine;\n const angle: number = computeRotation(box.landmarks[indexOfMouth], box.landmarks[indexOfForehead]);\n const faceCenter: Point = getBoxCenter({ startPoint: box.startPoint, endPoint: box.endPoint });\n const faceCenterNormalized: Point = [faceCenter[0] / input.shape[2], faceCenter[1] / input.shape[1]];\n const rotated = tf.image.rotateWithOffset(input, angle, 0, faceCenterNormalized); // rotateWithOffset is not defined for tfjs-node\n const rotationMatrix = buildRotationMatrix(-angle, faceCenter);\n const cut = cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, rotated, [inputSize, inputSize]);\n const face = tf.div(cut, 255);\n tf.dispose(cut);\n tf.dispose(rotated);\n return [angle, rotationMatrix, face];\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as util from './facemeshutil';\nimport type { Config } from '../config';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\n\nconst keypointsCount = 6;\nlet model: GraphModel | null;\nlet anchorsData: [number, number][] = [];\nlet anchors: Tensor | null = null;\nlet inputSize = 0;\n\n// export const size = () => (model && model.inputs[0].shape ? model.inputs[0].shape[2] : 0);\nexport const size = () => inputSize;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.detector?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n anchorsData = util.generateAnchors(inputSize);\n anchors = tf.tensor2d(anchorsData);\n return model;\n}\n\nfunction decodeBounds(boxOutputs) {\n const boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n const centers = tf.add(boxStarts, anchors);\n const boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n const boxSizesNormalized = tf.div(boxSizes, inputSize);\n const centersNormalized = tf.div(centers, inputSize);\n const halfBoxSize = tf.div(boxSizesNormalized, 2);\n const starts = tf.sub(centersNormalized, halfBoxSize);\n const ends = tf.add(centersNormalized, halfBoxSize);\n const startNormalized = tf.mul(starts, inputSize);\n const endNormalized = tf.mul(ends, inputSize);\n const concatAxis = 1;\n return tf.concat2d([startNormalized, endNormalized], concatAxis);\n}\n\nexport async function getBoxes(inputImage: Tensor, config: Config) {\n // sanity check on input\n if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return { boxes: [] };\n const [batch, boxes, scores] = tf.tidy(() => {\n const resizedImage = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]);\n const normalizedImage = tf.sub(tf.div(resizedImage, 127.5), 0.5);\n const res = model?.execute(normalizedImage);\n let batchOut;\n if (Array.isArray(res)) { // are we using tfhub or pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n const concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n const concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n const concat = tf.concat([concat512, concat384], 1);\n batchOut = tf.squeeze(concat, 0);\n } else {\n batchOut = tf.squeeze(res); // when using tfhub model\n }\n const boxesOut = decodeBounds(batchOut);\n const logits = tf.slice(batchOut, [0, 0], [-1, 1]);\n const scoresOut = tf.squeeze(tf.sigmoid(logits)); // inside tf.tidy\n return [batchOut, boxesOut, scoresOut];\n });\n\n const nmsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, (config.face.detector?.maxDetected || 0), (config.face.detector?.iouThreshold || 0), (config.face.detector?.minConfidence || 0));\n const nms = await nmsTensor.array();\n tf.dispose(nmsTensor);\n const annotatedBoxes: Array<{ box: { startPoint: Tensor, endPoint: Tensor }, landmarks: Tensor, anchor: [number, number] | undefined, confidence: number }> = [];\n const scoresData = await scores.data();\n for (let i = 0; i < nms.length; i++) {\n const confidence = scoresData[nms[i]];\n if (confidence > (config.face.detector?.minConfidence || 0)) {\n const boundingBox = tf.slice(boxes, [nms[i], 0], [1, -1]);\n const landmarks = tf.tidy(() => tf.reshape(tf.squeeze(tf.slice(batch, [nms[i], keypointsCount - 1], [1, -1])), [keypointsCount, -1]));\n annotatedBoxes.push({ box: util.createBox(boundingBox), landmarks, anchor: anchorsData[nms[i]], confidence });\n tf.dispose(boundingBox);\n }\n }\n tf.dispose(batch);\n tf.dispose(boxes);\n tf.dispose(scores);\n\n return {\n boxes: annotatedBoxes,\n scaleFactor: [inputImage.shape[2] / inputSize, inputImage.shape[1] / inputSize],\n };\n}\n", "import * as coords from './facemeshcoords';\nimport * as util from './facemeshutil';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log, join } from '../util/util';\nimport type { Config } from '../config';\nimport type { Point } from '../result';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\n\nconst irisEnlarge = 2.3;\n\nconst leftOutline = coords.meshAnnotations['leftEyeLower0'];\nconst rightOutline = coords.meshAnnotations['rightEyeLower0'];\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.iris?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates\n// Update the z coordinate to be an average of the original and the new.\nfunction replaceRawCoordinates(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.MESH_TO_IRIS_INDICES_MAP.length; i++) {\n const { key, indices } = coords.MESH_TO_IRIS_INDICES_MAP[i];\n const originalIndices = coords.meshAnnotations[`${prefix}${key}`];\n if (!keys || keys.includes(key)) {\n for (let j = 0; j < indices.length; j++) {\n const index = indices[j];\n rawCoords[originalIndices[j]] = [\n newCoords[index][0], newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n\n// eslint-disable-next-line class-methods-use-this\nexport const getLeftToRightEyeDepthDifference = (rawCoords) => {\n const leftEyeZ = rawCoords[eyeLandmarks.leftBounds[0]][2];\n const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2];\n return leftEyeZ - rightEyeZ;\n};\n\n// Returns a box describing a cropped region around the eye fit for passing to the iris model.\nexport const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, flip = false, meshSize) => {\n const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), irisEnlarge));\n const boxSize = util.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / meshSize,\n box.startPoint[0] / meshSize, box.endPoint[1] / meshSize,\n box.endPoint[0] / meshSize,\n ]], [0], [inputSize, inputSize]);\n if (flip && env.kernels.includes('flipleftright')) {\n const flipped = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n tf.dispose(crop);\n crop = flipped;\n }\n return { box, boxSize, crop };\n};\n\n// Given a cropped image of an eye, returns the coordinates of the contours surrounding the eye and the iris.\nexport const getEyeCoords = (eyeData, eyeBox, eyeBoxSize, flip = false) => {\n const eyeRawCoords: Array = [];\n for (let i = 0; i < irisLandmarks.numCoordinates; i++) {\n const x = eyeData[i * 3];\n const y = eyeData[i * 3 + 1];\n const z = eyeData[i * 3 + 2];\n eyeRawCoords.push([\n (flip ? (1 - (x / inputSize)) : (x / inputSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / inputSize) * eyeBoxSize[1] + eyeBox.startPoint[1], z,\n ]);\n }\n return { rawCoords: eyeRawCoords, iris: eyeRawCoords.slice(irisLandmarks.index) };\n};\n\n// The z-coordinates returned for the iris are unreliable, so we take the z values from the surrounding keypoints.\n// eslint-disable-next-line class-methods-use-this\nexport const getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => {\n const upperCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeLower0`][irisLandmarks.lowerCenter]][2];\n const averageZ = (upperCenterZ + lowerCenterZ) / 2;\n // Iris indices: 0: center | 1: right | 2: above | 3: left | 4: below\n return irisCoords.map((coord, i) => {\n let z = averageZ;\n if (i === 2) {\n z = upperCenterZ;\n } else if (i === 4) {\n z = lowerCenterZ;\n }\n return [coord[0], coord[1], z];\n });\n};\n\nexport async function augmentIris(rawCoords, face, config, meshSize) {\n if (!model) {\n if (config.debug) log('face mesh iris detection requested, but model is not loaded');\n return rawCoords;\n }\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], true, meshSize);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], true, meshSize);\n const combined = tf.concat([leftEyeCrop, rightEyeCrop]);\n tf.dispose(leftEyeCrop);\n tf.dispose(rightEyeCrop);\n const eyePredictions = model.predict(combined) as Tensor;\n tf.dispose(combined);\n const eyePredictionsData = await eyePredictions.data(); // inside tf.tidy\n tf.dispose(eyePredictions);\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize);\n const leftToRightEyeDepthDifference = getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', null);\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', null);\n // If the user is looking to the left or to the right, the iris coordinates tend to diverge too much from the mesh coordinates for them to be merged\n // So we only update a single contour line above and below the eye.\n } else if (leftToRightEyeDepthDifference < 1) { // User is looking towards the right.\n replaceRawCoordinates(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceRawCoordinates(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n const newCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n return newCoords;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n *\n * Based on:\n * - [**MediaPipe BlazeFace**](https://drive.google.com/file/d/1f39lSzU5Oq-j_OXgS67KfN5wNsoeAZ4V/view)\n * - Facial Spacial Geometry: [**MediaPipe FaceMesh**](https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view)\n * - Eye Iris Details: [**MediaPipe Iris**](https://drive.google.com/file/d/1bsWbokp9AklH2ANjCfmjqEzzxO1CNbMu/view)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as blazeface from './blazeface';\nimport * as util from './facemeshutil';\nimport * as coords from './facemeshcoords';\nimport * as iris from './iris';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { FaceResult, Point } from '../result';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\ntype BoxCache = { startPoint: Point, endPoint: Point, landmarks: Array, confidence: number, faceConfidence?: number | undefined };\nlet boxCache: Array = [];\nlet model: GraphModel | null = null;\nlet inputSize = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet detectedFaces = 0;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!config.skipFrame || (((detectedFaces !== config.face.detector?.maxDetected) || !config.face.mesh?.enabled)) && (skipped > (config.face.detector?.skipFrames || 0))) { // reset cached boxes\n const newBoxes = await blazeface.getBoxes(input, config); // get results from blazeface detector\n boxCache = []; // empty cache\n for (const possible of newBoxes.boxes) { // extract data from detector\n const startPoint = await possible.box.startPoint.data() as unknown as Point;\n const endPoint = await possible.box.endPoint.data() as unknown as Point;\n const landmarks = await possible.landmarks.array() as Array;\n boxCache.push({ startPoint, endPoint, landmarks, confidence: possible.confidence });\n }\n newBoxes.boxes.forEach((prediction) => tf.dispose([prediction.box.startPoint, prediction.box.endPoint, prediction.landmarks]));\n for (let i = 0; i < boxCache.length; i++) { // enlarge and squarify detected boxes\n const scaledBox = util.scaleBoxCoordinates({ startPoint: boxCache[i].startPoint, endPoint: boxCache[i].endPoint }, newBoxes.scaleFactor);\n const enlargedBox = util.enlargeBox(scaledBox);\n const squarifiedBox = util.squarifyBox(enlargedBox);\n boxCache[i] = { ...squarifiedBox, confidence: boxCache[i].confidence, landmarks: boxCache[i].landmarks };\n }\n skipped = 0;\n } else {\n skipped++;\n }\n\n const faces: Array = [];\n const newBoxes: Array = [];\n let id = 0;\n for (let box of boxCache) {\n let angle = 0;\n let rotationMatrix;\n const face: FaceResult = {\n id: id++,\n mesh: [],\n meshRaw: [],\n box: [0, 0, 0, 0],\n boxRaw: [0, 0, 0, 0],\n score: 0,\n boxScore: 0,\n faceScore: 0,\n annotations: {},\n };\n\n if (config.face.detector?.rotation && config.face.mesh?.enabled && env.kernels.includes('rotatewithoffset')) {\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(box, input, inputSize);\n } else {\n rotationMatrix = util.IDENTITY_MATRIX;\n const cut = util.cutBoxFromImageAndResize({ startPoint: box.startPoint, endPoint: box.endPoint }, input, config.face.mesh?.enabled ? [inputSize, inputSize] : [blazeface.size(), blazeface.size()]);\n face.tensor = tf.div(cut, 255);\n tf.dispose(cut);\n }\n face.boxScore = Math.round(100 * box.confidence) / 100;\n if (!config.face.mesh?.enabled) { // mesh not enabled, return resuts from detector only\n face.box = util.getClampedBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.score = Math.round(100 * box.confidence || 0) / 100;\n face.mesh = box.landmarks.map((pt) => [\n ((box.startPoint[0] + box.endPoint[0])) / 2 + ((box.endPoint[0] + box.startPoint[0]) * pt[0] / blazeface.size()),\n ((box.startPoint[1] + box.endPoint[1])) / 2 + ((box.endPoint[1] + box.startPoint[1]) * pt[1] / blazeface.size()),\n ]);\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key]]]; // add annotations\n } else if (!model) { // mesh enabled, but not loaded\n if (config.debug) log('face mesh detection requested, but model is not loaded');\n } else { // mesh enabled\n const [contours, confidence, contourCoords] = model.execute(face.tensor as Tensor) as Array; // first returned tensor represents facial contours which are already included in the coordinates.\n tf.dispose(contours);\n const faceConfidence = (await confidence.data())[0] as number;\n tf.dispose(confidence);\n const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);\n let rawCoords = await coordsReshaped.array();\n tf.dispose(contourCoords);\n tf.dispose(coordsReshaped);\n if (faceConfidence < (config.face.detector?.minConfidence || 1)) {\n box.confidence = faceConfidence; // reset confidence of cached box\n } else {\n if (config.face.iris?.enabled) rawCoords = await iris.augmentIris(rawCoords, face.tensor, config, inputSize); // augment results with iris\n face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / inputSize]);\n box = { ...util.enlargeBox(util.calculateLandmarksBoundingBox(face.mesh), 1.5), confidence: box.confidence }; // redefine box with mesh calculated one\n for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations\n if (config.face.detector?.rotation && config.face.mesh.enabled && config.face.description?.enabled && env.kernels.includes('rotatewithoffset')) { // do rotation one more time with mesh keypoints if we want to return perfect image\n tf.dispose(face.tensor); // dispose so we can overwrite original face\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(box, input, inputSize);\n }\n face.box = util.getClampedBox(box, input); // update detected box with box around the face mesh\n face.boxRaw = util.getRawBox(box, input);\n face.score = Math.round(100 * faceConfidence || 100 * box.confidence || 0) / 100;\n face.faceScore = Math.round(100 * faceConfidence) / 100;\n box = { ...util.squarifyBox(box), confidence: box.confidence, faceConfidence }; // updated stored cache values\n }\n }\n faces.push(face);\n newBoxes.push(box);\n }\n if (config.face.mesh?.enabled) boxCache = newBoxes.filter((a) => a.confidence > (config.face.detector?.minConfidence || 0)); // remove cache entries for detected boxes on low confidence\n detectedFaces = faces.length;\n return faces;\n}\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.mesh?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * FaceRes model implementation\n *\n * Returns Age, Gender, Descriptor\n * Implements Face simmilarity function\n *\n * Based on: [**HSE-FaceRes**](https://github.com/HSE-asavchenko/HSE_FaceRec_tf)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: Array<{\n age: number,\n gender: string,\n genderScore: number,\n descriptor: number[],\n}> = [];\n\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n const modelUrl = join(config.modelBasePath, config.face.description?.modelPath || '');\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(modelUrl) as unknown as GraphModel;\n if (!model) log('load model failed:', config.face.description?.modelPath || '');\n else if (config.debug) log('load model:', modelUrl);\n } else if (config.debug) log('cached model:', modelUrl);\n return model;\n}\n\nexport function enhance(input): Tensor {\n const image = tf.tidy(() => {\n // input received from detector is already normalized to 0..1\n // input is also assumed to be straightened\n const tensor = input.image || input.tensor || input;\n if (!(tensor instanceof tf.Tensor)) return null;\n // do a tight crop of image and resize it to fit the model\n const box = [[0.05, 0.15, 0.85, 0.85]]; // empyrical values for top, left, bottom, right\n // const box = [[0.0, 0.0, 1.0, 1.0]]; // basically no crop for test\n if (!model?.inputs[0].shape) return null; // model has no shape so no point continuing\n const crop = (tensor.shape.length === 3)\n ? tf.image.cropAndResize(tf.expandDims(tensor, 0), box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) // add batch dimension if missing\n : tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n\n /*\n // just resize to fit the embedding model instead of cropping\n const crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n */\n\n /*\n // convert to black&white to avoid colorization impact\n const rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const [red, green, blue] = tf.split(crop, 3, 3);\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n const merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\n */\n\n /*\n // increase image pseudo-contrast 100%\n // (or do it per-channel so mean is done on each channel)\n // (or calculate histogram and do it based on histogram)\n const mean = merge.mean();\n const factor = 2;\n const contrast = merge.sub(mean).mul(factor).add(mean);\n */\n\n /*\n // normalize brightness from 0..1\n // silly way of creating pseudo-hdr of image\n const darken = crop.sub(crop.min());\n const lighten = darken.div(darken.max());\n */\n\n const norm = tf.mul(crop, 255);\n\n return norm;\n });\n return image;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < (config.face.description?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const enhanced = enhance(image);\n\n let resT;\n const obj = {\n age: 0,\n gender: 'unknown',\n genderScore: 0,\n descriptor: [],\n };\n\n if (config.face.description?.enabled) resT = await model?.predict(enhanced);\n tf.dispose(enhanced);\n\n if (resT) {\n const gender = await resT.find((t) => t.shape[1] === 1).data();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > (config.face.description?.minConfidence || 0)) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const argmax = tf.argMax(resT.find((t) => t.shape[1] === 100), 1);\n const age = (await argmax.data())[0];\n tf.dispose(argmax);\n const all = await resT.find((t) => t.shape[1] === 100).data();\n obj.age = Math.round(all[age - 1] > all[age + 1] ? 10 * age - 100 * all[age - 1] : 10 * age + 100 * all[age + 1]) / 10;\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n\n const descriptor = await desc.data();\n obj.descriptor = [...descriptor];\n resT.forEach((t) => tf.dispose(t));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * Emotion model implementation\n *\n * [**Oarriaga**](https://github.com/oarriaga/face_classification)\n */\n\nimport { log, join } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { env } from '../util/env';\n\nconst annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];\nlet model: GraphModel | null;\n// let last: Array<{ score: number, emotion: string }> = [];\nconst last: Array> = [];\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// tuning values\nconst rgb = [0.2989, 0.5870, 0.1140]; // factors for red/green/blue colors when converting to grayscale\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.emotion?.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor, config: Config, idx, count) {\n if (!model) return null;\n if ((skipped < (config.face.emotion?.skipFrames || 0)) && config.skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const [red, green, blue] = tf.split(resize, 3, 3);\n tf.dispose(resize);\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n const redNorm = tf.mul(red, rgb[0]);\n const greenNorm = tf.mul(green, rgb[1]);\n const blueNorm = tf.mul(blue, rgb[2]);\n tf.dispose(red);\n tf.dispose(green);\n tf.dispose(blue);\n const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\n tf.dispose(redNorm);\n tf.dispose(greenNorm);\n tf.dispose(blueNorm);\n const normalize = tf.tidy(() => tf.mul(tf.sub(grayscale, 0.5), 2));\n tf.dispose(grayscale);\n const obj: Array<{ score: number, emotion: string }> = [];\n if (config.face.emotion?.enabled) {\n const emotionT = await model?.predict(normalize) as Tensor; // result is already in range 0..1, no need for additional activation\n const data = await emotionT.data();\n tf.dispose(emotionT);\n for (let i = 0; i < data.length; i++) {\n if (data[i] > (config.face.emotion?.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] });\n }\n obj.sort((a, b) => b.score - a.score);\n }\n tf.dispose(normalize);\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * PoseNet body detection model implementation constants\n * See `posenet.ts` for entry point\n */\n\nimport type { BodyResult } from '../result';\n\nexport const partNames = [\n 'nose', 'leftEye', 'rightEye', 'leftEar', 'rightEar', 'leftShoulder',\n 'rightShoulder', 'leftElbow', 'rightElbow', 'leftWrist', 'rightWrist',\n 'leftHip', 'rightHip', 'leftKnee', 'rightKnee', 'leftAnkle', 'rightAnkle',\n];\n\nexport const count = partNames.length; // 17 keypoints\n\nexport const partIds = partNames.reduce((result, jointName, i) => {\n result[jointName] = i;\n return result;\n}, {});\n\nconst connectedPartNames = [\n ['leftHip', 'leftShoulder'], ['leftElbow', 'leftShoulder'],\n ['leftElbow', 'leftWrist'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['rightHip', 'rightShoulder'],\n ['rightElbow', 'rightShoulder'], ['rightElbow', 'rightWrist'],\n ['rightHip', 'rightKnee'], ['rightKnee', 'rightAnkle'],\n ['leftShoulder', 'rightShoulder'], ['leftHip', 'rightHip'],\n];\nexport const connectedPartIndices = connectedPartNames.map(([jointNameA, jointNameB]) => ([partIds[jointNameA], partIds[jointNameB]]));\n\nexport const poseChain = [\n ['nose', 'leftEye'], ['leftEye', 'leftEar'], ['nose', 'rightEye'],\n ['rightEye', 'rightEar'], ['nose', 'leftShoulder'],\n ['leftShoulder', 'leftElbow'], ['leftElbow', 'leftWrist'],\n ['leftShoulder', 'leftHip'], ['leftHip', 'leftKnee'],\n ['leftKnee', 'leftAnkle'], ['nose', 'rightShoulder'],\n ['rightShoulder', 'rightElbow'], ['rightElbow', 'rightWrist'],\n ['rightShoulder', 'rightHip'], ['rightHip', 'rightKnee'],\n ['rightKnee', 'rightAnkle'],\n];\n\nexport function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence: number) {\n return connectedPartIndices.reduce((result, [leftJoint, rightJoint]) => {\n if (eitherPointDoesntMeetConfidence(keypoints[leftJoint].score, keypoints[rightJoint].score, minConfidence)) {\n return result;\n }\n result.push([keypoints[leftJoint], keypoints[rightJoint]]);\n return result;\n }, []);\n}\n\nexport function getBoundingBox(keypoints): [number, number, number, number] {\n const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y } }) => ({\n maxX: Math.max(maxX, x),\n maxY: Math.max(maxY, y),\n minX: Math.min(minX, x),\n minY: Math.min(minY, y),\n }), {\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n });\n return [coord.minX, coord.minY, coord.maxX - coord.minX, coord.maxY - coord.minY];\n}\n\nexport function scalePoses(poses, [height, width], [inputResolutionHeight, inputResolutionWidth]): Array {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i) => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\n box: [Math.trunc(pose.box[0] * scaleX), Math.trunc(pose.box[1] * scaleY), Math.trunc(pose.box[2] * scaleX), Math.trunc(pose.box[3] * scaleY)],\n keypoints: pose.keypoints.map(({ score, part, position }) => ({\n score,\n part,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)],\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight],\n })),\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\n return scaledPoses;\n}\n\n// algorithm based on Coursera Lecture from Algorithms, Part 1: https://www.coursera.org/learn/algorithms-part1/lecture/ZjoSM/heapsort\nexport class MaxHeap {\n priorityQueue: Array; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\n\n constructor(maxSize, getElementValue) {\n this.priorityQueue = new Array(maxSize);\n this.numberOfElements = -1;\n this.getElementValue = getElementValue;\n }\n\n enqueue(x) {\n this.priorityQueue[++this.numberOfElements] = x;\n this.swim(this.numberOfElements);\n }\n\n dequeue() {\n const max = this.priorityQueue[0];\n this.exchange(0, this.numberOfElements--);\n this.sink(0);\n this.priorityQueue[this.numberOfElements + 1] = null;\n return max;\n }\n\n empty() { return this.numberOfElements === -1; }\n\n size() { return this.numberOfElements + 1; }\n\n all() { return this.priorityQueue.slice(0, this.numberOfElements + 1); }\n\n max() { return this.priorityQueue[0]; }\n\n swim(k) {\n while (k > 0 && this.less(Math.floor(k / 2), k)) {\n this.exchange(k, Math.floor(k / 2));\n k = Math.floor(k / 2);\n }\n }\n\n sink(k) {\n while (2 * k <= this.numberOfElements) {\n let j = 2 * k;\n if (j < this.numberOfElements && this.less(j, j + 1)) j++;\n if (!this.less(k, j)) break;\n this.exchange(k, j);\n k = j;\n }\n }\n\n getValueAt(i) {\n // @ts-ignore getter is of unknown type\n return this.getElementValue(this.priorityQueue[i]);\n }\n\n less(i, j) {\n return this.getValueAt(i) < this.getValueAt(j);\n }\n\n exchange(i, j) {\n const t = this.priorityQueue[i];\n this.priorityQueue[i] = this.priorityQueue[j];\n this.priorityQueue[j] = t;\n }\n}\n\nexport function getOffsetPoint(y, x, keypoint, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + count),\n };\n}\n\nexport function getImageCoords(part, outputStride, offsets) {\n const { heatmapY, heatmapX, id: keypoint } = part;\n const { y, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets);\n return {\n x: part.heatmapX * outputStride + x,\n y: part.heatmapY * outputStride + y,\n };\n}\n\nexport function fillArray(element, size) {\n const result = new Array(size);\n for (let i = 0; i < size; i++) {\n result[i] = element;\n }\n return result;\n}\n\nexport function clamp(a, min, max) {\n if (a < min) return min;\n if (a > max) return max;\n return a;\n}\n\nexport function squaredDistance(y1, x1, y2, x2) {\n const dy = y2 - y1;\n const dx = x2 - x1;\n return dy * dy + dx * dx;\n}\n\nexport function addVectors(a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n}\n\nexport function clampVector(a, min, max) {\n return { y: clamp(a.y, min, max), x: clamp(a.x, min, max) };\n}\n", "/**\n * PoseNet body detection model implementation\n *\n * Based on: [**PoseNet**](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { BodyResult, Box } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as utils from './posenetutils';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\n\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId, sourceKeypoint, targetId, scores, offsets, displacements, offsetRefineStep = 2) {\n const getDisplacement = (point) => ({\n y: displacements.get(point.y, point.x, edgeId),\n x: displacements.get(point.y, point.x, (displacements.shape[2] / 2) + edgeId),\n });\n const getStridedIndexNearPoint = (point, height, width) => ({\n y: utils.clamp(Math.round(point.y / outputStride), 0, height - 1),\n x: utils.clamp(Math.round(point.x / outputStride), 0, width - 1),\n });\n\n const [height, width] = scores.shape;\n // Nearest neighbor interpolation for the source->target displacements.\n const sourceKeypointIndices = getStridedIndexNearPoint(sourceKeypoint.position, height, width);\n const displacement = getDisplacement(sourceKeypointIndices);\n const displacedPoint = utils.addVectors(sourceKeypoint.position, displacement);\n let targetKeypoint = displacedPoint;\n for (let i = 0; i < offsetRefineStep; i++) {\n const targetKeypointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const offsetPoint = utils.getOffsetPoint(targetKeypointIndices.y, targetKeypointIndices.x, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: utils.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = utils.poseChain.map(([parentJoinName, childJoinName]) => ([utils.partIds[parentJoinName], utils.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: utils.partNames[root.part.id],\n position: rootPoint,\n };\n // Decode the part positions upwards in the tree, following the backward displacements.\n for (let edge = numEdges - 1; edge >= 0; --edge) {\n const sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsBwd);\n }\n }\n // Decode the part positions downwards in the tree, following the forward displacements.\n for (let edge = 0; edge < numEdges; ++edge) {\n const sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores) {\n const [height, width] = scores.shape;\n let localMaximum = true;\n const yStart = Math.max(heatmapY - localMaximumRadius, 0);\n const yEnd = Math.min(heatmapY + localMaximumRadius + 1, height);\n for (let yCurrent = yStart; yCurrent < yEnd; ++yCurrent) {\n const xStart = Math.max(heatmapX - localMaximumRadius, 0);\n const xEnd = Math.min(heatmapX + localMaximumRadius + 1, width);\n for (let xCurrent = xStart; xCurrent < xEnd; ++xCurrent) {\n if (scores.get(yCurrent, xCurrent, keypointId) > score) {\n localMaximum = false;\n break;\n }\n }\n if (!localMaximum) break;\n }\n return localMaximum;\n}\n\nexport function buildPartWithScoreQueue(minConfidence, scores) {\n const [height, width, numKeypoints] = scores.shape;\n const queue = new utils.MaxHeap(height * width * numKeypoints, ({ score }) => score);\n for (let heatmapY = 0; heatmapY < height; ++heatmapY) {\n for (let heatmapX = 0; heatmapX < width; ++heatmapX) {\n for (let keypointId = 0; keypointId < numKeypoints; ++keypointId) {\n const score = scores.get(heatmapY, heatmapX, keypointId);\n // Only consider parts with score greater or equal to threshold as root candidates.\n if (score < minConfidence) continue;\n // Only consider keypoints whose score is maximum in a local window.\n if (scoreIsMaximumInLocalWindow(keypointId, score, heatmapY, heatmapX, scores)) queue.enqueue({ score, part: { heatmapY, heatmapX, id: keypointId } });\n }\n }\n }\n return queue;\n}\n\nfunction withinRadius(poses, { x, y }, keypointId) {\n return poses.some(({ keypoints }) => {\n const correspondingKeypoint = keypoints[keypointId]?.position;\n if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: Array<{ keypoints, box: Box, score: number }> = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\n // Generate at most maxDetected object instances per image in decreasing root part score order.\n while (poses.length < maxDetected && !queue.empty()) {\n // The top element in the queue is the next root candidate.\n const root = queue.dequeue();\n // Part-based non-maximum suppression: We reject a root candidate if it is within a disk of `nmsRadius` pixels from the corresponding part of a previously detected instance.\n // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.filter((a) => a.score > minConfidence);\n const score = getInstanceScore(poses, keypoints);\n const box = utils.getBoundingBox(keypoints);\n if (score > minConfidence) poses.push({ keypoints, box, score: Math.round(100 * score) / 100 });\n }\n return poses;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = tf.sub(tf.div(tf.cast(resized, 'float32'), 127.5), 1.0);\n const results: Array = model.execute(normalized, poseNetOutputs) as Array;\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = results3d[1].sigmoid(); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor: Tensor) => tensor.buffer()));\n for (const t of res) tf.dispose(t);\n\n const decoded = await decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = utils.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]) as BodyResult[];\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport function getBoxSize(box) {\n return [\n Math.abs(box.endPoint[0] - box.startPoint[0]),\n Math.abs(box.endPoint[1] - box.startPoint[1]),\n ];\n}\n\nexport function getBoxCenter(box) {\n return [\n box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2,\n box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2,\n ];\n}\n\nexport function cutBoxFromImageAndResize(box, image, cropSize) {\n const h = image.shape[1];\n const w = image.shape[2];\n const boxes = [[\n box.startPoint[1] / h,\n box.startPoint[0] / w,\n box.endPoint[1] / h,\n box.endPoint[0] / w,\n ]];\n return tf.image.cropAndResize(image, boxes, [0], cropSize);\n}\n\nexport function scaleBoxCoordinates(box, factor) {\n const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n const palmLandmarks = box.palmLandmarks.map((coord) => {\n const scaledCoord = [coord[0] * factor[0], coord[1] * factor[1]];\n return scaledCoord;\n });\n return { startPoint, endPoint, palmLandmarks, confidence: box.confidence };\n}\n\nexport function enlargeBox(box, factor = 1.5) {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const newHalfSize = [factor * size[0] / 2, factor * size[1] / 2];\n const startPoint = [center[0] - newHalfSize[0], center[1] - newHalfSize[1]];\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function squarifyBox(box) {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const maxEdge = Math.max(...size);\n const halfSize = maxEdge / 2;\n const startPoint = [centers[0] - halfSize, centers[1] - halfSize];\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport function shiftBox(box, shiftFactor) {\n const boxSize = [\n box.endPoint[0] - box.startPoint[0],\n box.endPoint[1] - box.startPoint[1],\n ];\n const shiftVector = [boxSize[0] * shiftFactor[0], boxSize[1] * shiftFactor[1]];\n const startPoint = [box.startPoint[0] + shiftVector[0], box.startPoint[1] + shiftVector[1]];\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]];\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n", "/**\n * HandPose model implementation constants\n * See `handpose.ts` for entry point\n */\n\nexport const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as anchors from './anchors';\nimport type { Tensor, GraphModel } from '../tfjs/types';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model) {\n this.model = model;\n this.anchors = anchors.anchors.map((anchor) => [anchor.x, anchor.y]);\n this.anchorsTensor = tf.tensor2d(this.anchors);\n this.inputSize = (this.model && this.model.inputs && this.model.inputs[0].shape) ? this.model.inputs[0].shape[2] : 0;\n this.inputSizeTensor = tf.tensor1d([this.inputSize, this.inputSize]);\n this.doubleInputSizeTensor = tf.tensor1d([this.inputSize * 2, this.inputSize * 2]);\n }\n\n normalizeBoxes(boxes) {\n return tf.tidy(() => {\n const boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n const boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n const boxCenterPoints = tf.add(tf.div(boxOffsets, this.inputSizeTensor), this.anchorsTensor);\n const halfBoxSizes = tf.div(boxSizes, this.doubleInputSizeTensor);\n const startPoints = tf.mul(tf.sub(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n const endPoints = tf.mul(tf.add(boxCenterPoints, halfBoxSizes), this.inputSizeTensor);\n return tf.concat2d([startPoints, endPoints], 1);\n });\n }\n\n normalizeLandmarks(rawPalmLandmarks, index) {\n return tf.tidy(() => {\n const landmarks = tf.add(tf.div(tf.reshape(rawPalmLandmarks, [-1, 7, 2]), this.inputSizeTensor), this.anchors[index]);\n return tf.mul(landmarks, this.inputSizeTensor);\n });\n }\n\n async getBoxes(input, config) {\n const t: Record = {};\n t.batched = this.model.predict(input) as Tensor;\n t.predictions = tf.squeeze(t.batched);\n t.scores = tf.tidy(() => tf.squeeze(tf.sigmoid(tf.slice(t.predictions, [0, 0], [-1, 1]))));\n const scores = await t.scores.data();\n t.boxes = tf.slice(t.predictions, [0, 1], [-1, 4]);\n t.norm = this.normalizeBoxes(t.boxes);\n // box detection is flaky so we look for 3x boxes than we need results\n t.nms = await tf.image.nonMaxSuppressionAsync(t.norm, t.scores, 3 * config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.array() as Array;\n const hands: Array<{ box: Tensor, palmLandmarks: Tensor, confidence: number }> = [];\n for (const index of nms) {\n const palmBox = tf.slice(t.norm, [index, 0], [1, -1]);\n const palmLandmarks = tf.tidy(() => tf.reshape(this.normalizeLandmarks(tf.slice(t.predictions, [index, 5], [1, 14]), index), [-1, 2]));\n hands.push({ box: palmBox, palmLandmarks, confidence: scores[index] });\n // console.log('handdetector:getBoxes', nms.length, index, scores[index], config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence, palmBox.dataSync());\n }\n for (const tensor of Object.keys(t)) tf.dispose(t[tensor]); // dispose all\n return hands;\n }\n\n async estimateHandBounds(input, config): Promise<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }[]> {\n const inputHeight = input.shape[1];\n const inputWidth = input.shape[2];\n const image = tf.tidy(() => tf.sub(tf.div(tf.image.resizeBilinear(input, [this.inputSize, this.inputSize]), 127.5), 1));\n const predictions = await this.getBoxes(image, config);\n tf.dispose(image);\n const hands: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number }> = [];\n if (!predictions || predictions.length === 0) return hands;\n for (const prediction of predictions) {\n const boxes = await prediction.box.data();\n const startPoint = boxes.slice(0, 2);\n const endPoint = boxes.slice(2, 4);\n const palmLandmarks = await prediction.palmLandmarks.array();\n tf.dispose(prediction.box);\n tf.dispose(prediction.palmLandmarks);\n hands.push(box.scaleBoxCoordinates({ startPoint, endPoint, palmLandmarks, confidence: prediction.confidence }, [inputWidth / this.inputSize, inputHeight / this.inputSize]));\n }\n return hands;\n }\n}\n", "export function normalizeRadians(angle) {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n\nexport function computeRotation(point1, point2) {\n const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]);\n return normalizeRadians(radians);\n}\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport function dot(v1, v2) {\n let product = 0;\n for (let i = 0; i < v1.length; i++) {\n product += v1[i] * v2[i];\n }\n return product;\n}\n\nexport function getColumnFrom2DArr(arr, columnIndex) {\n const column: Array = [];\n for (let i = 0; i < arr.length; i++) {\n column.push(arr[i][columnIndex]);\n }\n return column;\n}\n\nexport function multiplyTransformMatrices(mat1, mat2) {\n const product: Array = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) {\n product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n }\n return product;\n}\n\nexport function buildRotationMatrix(rotation, center) {\n const cosA = Math.cos(rotation);\n const sinA = Math.sin(rotation);\n const rotationMatrix = [[cosA, -sinA, 0], [sinA, cosA, 0], [0, 0, 1]];\n const translationMatrix = buildTranslationMatrix(center[0], center[1]);\n const translationTimesRotation = multiplyTransformMatrices(translationMatrix, rotationMatrix);\n const negativeTranslationMatrix = buildTranslationMatrix(-center[0], -center[1]);\n return multiplyTransformMatrices(translationTimesRotation, negativeTranslationMatrix);\n}\n\nexport function invertTransformMatrix(matrix) {\n const rotationComponent = [[matrix[0][0], matrix[1][0]], [matrix[0][1], matrix[1][1]]];\n const translationComponent = [matrix[0][2], matrix[1][2]];\n const invertedTranslation = [\n -dot(rotationComponent[0], translationComponent),\n -dot(rotationComponent[1], translationComponent),\n ];\n return [\n rotationComponent[0].concat(invertedTranslation[0]),\n rotationComponent[1].concat(invertedTranslation[1]),\n [0, 0, 1],\n ];\n}\n\nexport function rotatePoint(homogeneousCoordinate, rotationMatrix) {\n return [\n dot(homogeneousCoordinate, rotationMatrix[0]),\n dot(homogeneousCoordinate, rotationMatrix[1]),\n ];\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as box from './box';\nimport * as util from './util';\nimport type * as detector from './handdetector';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: Array<{ startPoint: number[]; endPoint: number[]; palmLandmarks: number[]; confidence: number } | null>;\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n this.inputSize = this.handPoseModel && this.handPoseModel.inputs[0].shape ? this.handPoseModel.inputs[0].shape[2] : 0;\n this.storedBoxes = [];\n this.skipped = 0;\n this.detectedHands = 0;\n }\n\n // eslint-disable-next-line class-methods-use-this\n calculateLandmarksBoundingBox(landmarks) {\n const xs = landmarks.map((d) => d[0]);\n const ys = landmarks.map((d) => d[1]);\n const startPoint = [Math.min(...xs), Math.min(...ys)];\n const endPoint = [Math.max(...xs), Math.max(...ys)];\n return { startPoint, endPoint };\n }\n\n getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return box.enlargeBox(box.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = box.enlargeBox(box.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = box.getBoxSize(box2);\n const scaleFactor = [boxSize[0] / this.inputSize, boxSize[1] / this.inputSize, (boxSize[0] + boxSize[1]) / this.inputSize / 2];\n const coordsScaled = rawCoords.map((coord) => [\n scaleFactor[0] * (coord[0] - this.inputSize / 2),\n scaleFactor[1] * (coord[1] - this.inputSize / 2),\n scaleFactor[2] * coord[2],\n ]);\n const coordsRotationMatrix = util.buildRotationMatrix(angle, [0, 0]);\n const coordsRotated = coordsScaled.map((coord) => {\n const rotated = util.rotatePoint(coord, coordsRotationMatrix);\n return [...rotated, coord[2]];\n });\n const inverseRotationMatrix = util.invertTransformMatrix(rotationMatrix);\n const boxCenter = [...box.getBoxCenter(box2), 1];\n const originalBoxCenter = [\n util.dot(boxCenter, inverseRotationMatrix[0]),\n util.dot(boxCenter, inverseRotationMatrix[1]),\n ];\n return coordsRotated.map((coord) => [\n Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames unless we only want box to start with\n let boxes;\n\n // console.log('handpipeline:estimateHands:skip criteria', this.skipped, config.hand.skipFrames, !config.hand.landmarks, !config.skipFrame); // should skip hand detector?\n if ((this.skipped === 0) || (this.skipped > config.hand.skipFrames) || !config.hand.landmarks || !config.skipFrame) {\n boxes = await this.handDetector.estimateHandBounds(image, config);\n this.skipped = 0;\n }\n if (config.skipFrame) this.skipped++;\n\n // if detector result count doesn't match current working set, use it to reset current working set\n if (boxes && (boxes.length > 0) && ((boxes.length !== this.detectedHands) && (this.detectedHands !== config.hand.maxDetected) || !config.hand.landmarks)) {\n this.detectedHands = 0;\n this.storedBoxes = [...boxes];\n // for (const possible of boxes) this.storedBoxes.push(possible);\n if (this.storedBoxes.length > 0) useFreshBox = true;\n }\n const hands: Array<{ landmarks: number[], confidence: number, boxConfidence: number, fingerConfidence: number, box: { topLeft: number[], bottomRight: number[] } }> = [];\n\n // go through working set of boxes\n for (let i = 0; i < this.storedBoxes.length; i++) {\n const currentBox = this.storedBoxes[i];\n if (!currentBox) continue;\n if (config.hand.landmarks) {\n const angle = config.hand.rotation ? util.computeRotation(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = box.getBoxCenter(currentBox);\n const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && env.kernels.includes('rotatewithoffset') ? tf.image.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone();\n const rotationMatrix = util.buildRotationMatrix(-angle, palmCenter);\n const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox;\n const croppedInput = box.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = tf.div(croppedInput, 255);\n tf.dispose(croppedInput);\n tf.dispose(rotatedImage);\n const [confidenceT, keypoints] = await this.handPoseModel.predict(handImage) as Array;\n tf.dispose(handImage);\n const confidence = (await confidenceT.data())[0];\n tf.dispose(confidenceT);\n if (confidence >= config.hand.minConfidence / 4) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n tf.dispose(keypoints);\n tf.dispose(keypointsReshaped);\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n // console.log('handpipeline:estimateHands low', confidence);\n this.storedBoxes[i] = null;\n }\n tf.dispose(keypoints);\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = box.enlargeBox(box.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: 0,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n landmarks: [],\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n if (hands.length > config.hand.maxDetected) hands.length = config.hand.maxDetected;\n return hands;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nexport const Finger = {\n thumb: 0,\n index: 1,\n middle: 2,\n ring: 3,\n pinky: 4,\n all: [0, 1, 2, 3, 4], // just for convenience\n nameMapping: { 0: 'thumb', 1: 'index', 2: 'middle', 3: 'ring', 4: 'pinky' },\n // Describes mapping of joints based on the 21 points returned by handpose.\n // [0] Palm\n // [1-4] Thumb\n // [5-8] Index\n // [9-12] Middle\n // [13-16] Ring\n // [17-20] Pinky\n pointsMapping: {\n 0: [[0, 1], [1, 2], [2, 3], [3, 4]],\n 1: [[0, 5], [5, 6], [6, 7], [7, 8]],\n 2: [[0, 9], [9, 10], [10, 11], [11, 12]],\n 3: [[0, 13], [13, 14], [14, 15], [15, 16]],\n 4: [[0, 17], [17, 18], [18, 19], [19, 20]],\n },\n getName: (value) => Finger.nameMapping[value],\n getPoints: (value) => Finger.pointsMapping[value],\n};\n\nexport const FingerCurl = {\n none: 0,\n half: 1,\n full: 2,\n nameMapping: { 0: 'none', 1: 'half', 2: 'full' },\n getName: (value) => FingerCurl.nameMapping[value],\n};\n\nexport const FingerDirection = {\n verticalUp: 0,\n verticalDown: 1,\n horizontalLeft: 2,\n horizontalRight: 3,\n diagonalUpRight: 4,\n diagonalUpLeft: 5,\n diagonalDownRight: 6,\n diagonalDownLeft: 7,\n nameMapping: { 0: 'verticalUp', 1: 'verticalDown', 2: 'horizontalLeft', 3: 'horizontalRight', 4: 'diagonalUpRight', 5: 'diagonalUpLeft', 6: 'diagonalDownRight', 7: 'diagonalDownLeft' },\n getName: (value) => FingerDirection.nameMapping[value],\n};\n\nexport class FingerGesture {\n name;\n curls;\n directions;\n weights;\n weightsRelative;\n\n constructor(name) {\n // name (should be unique)\n this.name = name;\n this.curls = {};\n this.directions = {};\n this.weights = [1.0, 1.0, 1.0, 1.0, 1.0];\n this.weightsRelative = [1.0, 1.0, 1.0, 1.0, 1.0];\n }\n\n addCurl(finger, curl, confidence) {\n if (typeof this.curls[finger] === 'undefined') this.curls[finger] = [];\n this.curls[finger].push([curl, confidence]);\n }\n\n addDirection(finger, position, confidence) {\n if (!this.directions[finger]) this.directions[finger] = [];\n this.directions[finger].push([position, confidence]);\n }\n\n setWeight(finger, weight) {\n this.weights[finger] = weight;\n // recalculate relative weights\n const total = this.weights.reduce((a, b) => a + b, 0);\n this.weightsRelative = this.weights.map((el) => el * 5 / total);\n }\n\n matchAgainst(detectedCurls, detectedDirections) {\n let confidence = 0.0;\n // look at the detected curl of each finger and compare with\n // the expected curl of this finger inside current gesture\n for (const fingerIdx in detectedCurls) {\n const detectedCurl = detectedCurls[fingerIdx];\n const expectedCurls = this.curls[fingerIdx];\n if (typeof expectedCurls === 'undefined') {\n // no curl description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible curl of this specific finger\n for (const [expectedCurl, score] of expectedCurls) {\n if (detectedCurl === expectedCurl) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n // same for detected direction of each finger\n for (const fingerIdx in detectedDirections) {\n const detectedDirection = detectedDirections[fingerIdx];\n const expectedDirections = this.directions[fingerIdx];\n if (typeof expectedDirections === 'undefined') {\n // no direction description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible direction of this specific finger\n for (const [expectedDirection, score] of expectedDirections) {\n if (detectedDirection === expectedDirection) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n return confidence / 10;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nimport { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef';\n\n// describe thumbs up gesture \uD83D\uDC4D\nconst ThumbsUp = new FingerGesture('thumbs up');\nThumbsUp.addCurl(Finger.thumb, FingerCurl.none, 1.0);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.verticalUp, 1.0);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.diagonalUpLeft, 0.25);\nThumbsUp.addDirection(Finger.thumb, FingerDirection.diagonalUpRight, 0.25);\nfor (const finger of [Finger.index, Finger.middle, Finger.ring, Finger.pinky]) {\n ThumbsUp.addCurl(finger, FingerCurl.full, 1.0);\n ThumbsUp.addDirection(finger, FingerDirection.horizontalLeft, 1.0);\n ThumbsUp.addDirection(finger, FingerDirection.horizontalRight, 1.0);\n}\n\n// describe Victory gesture \u270C\uFE0F\nconst Victory = new FingerGesture('victory');\nVictory.addCurl(Finger.thumb, FingerCurl.half, 0.5);\nVictory.addCurl(Finger.thumb, FingerCurl.none, 0.5);\nVictory.addDirection(Finger.thumb, FingerDirection.verticalUp, 1.0);\nVictory.addDirection(Finger.thumb, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addCurl(Finger.index, FingerCurl.none, 1.0);\nVictory.addDirection(Finger.index, FingerDirection.verticalUp, 0.75);\nVictory.addDirection(Finger.index, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addCurl(Finger.middle, FingerCurl.none, 1.0);\nVictory.addDirection(Finger.middle, FingerDirection.verticalUp, 1.0);\nVictory.addDirection(Finger.middle, FingerDirection.diagonalUpLeft, 0.75);\nVictory.addCurl(Finger.ring, FingerCurl.full, 1.0);\nVictory.addDirection(Finger.ring, FingerDirection.verticalUp, 0.2);\nVictory.addDirection(Finger.ring, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addDirection(Finger.ring, FingerDirection.horizontalLeft, 0.2);\nVictory.addCurl(Finger.pinky, FingerCurl.full, 1.0);\nVictory.addDirection(Finger.pinky, FingerDirection.verticalUp, 0.2);\nVictory.addDirection(Finger.pinky, FingerDirection.diagonalUpLeft, 1.0);\nVictory.addDirection(Finger.pinky, FingerDirection.horizontalLeft, 0.2);\nVictory.setWeight(Finger.index, 2);\nVictory.setWeight(Finger.middle, 2);\n\nexport default [ThumbsUp, Victory];\n", "/**\n * FingerPose algorithm implementation constants\n *\n * Based on: [**FingerPose***](https://github.com/andypotato/fingerpose)\n */\n\nimport { Finger, FingerCurl, FingerDirection } from './fingerdef';\nimport Gestures from '../hand/fingergesture';\n\nconst minConfidence = 0.7;\nconst options = {\n // curl estimation\n HALF_CURL_START_LIMIT: 60.0,\n NO_CURL_START_LIMIT: 130.0,\n // direction estimation\n DISTANCE_VOTE_POWER: 1.1,\n SINGLE_ANGLE_VOTE_POWER: 0.9,\n TOTAL_ANGLE_VOTE_POWER: 1.6,\n};\n\nfunction calculateSlope(point1x, point1y, point2x, point2y) {\n const value = (point1y - point2y) / (point1x - point2x);\n let slope = Math.atan(value) * 180 / Math.PI;\n if (slope <= 0) slope = -slope;\n else if (slope > 0) slope = 180 - slope;\n return slope;\n}\n\n// point1, point2 are 2d or 3d point arrays (xy[z])\n// returns either a single scalar (2d) or array of two slopes (3d)\nfunction getSlopes(point1, point2) {\n if (!point1 || !point2) return [0, 0];\n const slopeXY = calculateSlope(point1[0], point1[1], point2[0], point2[1]);\n if (point1.length === 2) return slopeXY;\n const slopeYZ = calculateSlope(point1[1], point1[2], point2[1], point2[2]);\n return [slopeXY, slopeYZ];\n}\n\nfunction angleOrientationAt(angle, weightageAt = 1.0) {\n let isVertical = 0;\n let isDiagonal = 0;\n let isHorizontal = 0;\n if (angle >= 75.0 && angle <= 105.0) isVertical = 1 * weightageAt;\n else if (angle >= 25.0 && angle <= 155.0) isDiagonal = 1 * weightageAt;\n else isHorizontal = 1 * weightageAt;\n return [isVertical, isDiagonal, isHorizontal];\n}\n\nfunction estimateFingerCurl(startPoint, midPoint, endPoint) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const start_mid_z_dist = startPoint[2] - midPoint[2];\n const start_end_z_dist = startPoint[2] - endPoint[2];\n const mid_end_z_dist = midPoint[2] - endPoint[2];\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist + start_mid_z_dist * start_mid_z_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist + start_end_z_dist * start_end_z_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist + mid_end_z_dist * mid_end_z_dist);\n let cos_in = (mid_end_dist * mid_end_dist + start_mid_dist * start_mid_dist - start_end_dist * start_end_dist) / (2 * mid_end_dist * start_mid_dist);\n if (cos_in > 1.0) cos_in = 1.0;\n else if (cos_in < -1.0) cos_in = -1.0;\n let angleOfCurve = Math.acos(cos_in);\n angleOfCurve = (57.2958 * angleOfCurve) % 180;\n let fingerCurl;\n if (angleOfCurve > options.NO_CURL_START_LIMIT) fingerCurl = FingerCurl.none;\n else if (angleOfCurve > options.HALF_CURL_START_LIMIT) fingerCurl = FingerCurl.half;\n else fingerCurl = FingerCurl.full;\n return fingerCurl;\n}\n\nfunction estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n if (max_dist_x === Math.abs(start_end_x_dist)) {\n if (start_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else if (max_dist_x === Math.abs(start_mid_x_dist)) {\n if (start_mid_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else {\n if (mid_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n }\n return estimatedDirection;\n}\n\nfunction estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y) {\n let estimatedDirection;\n if (max_dist_y === Math.abs(start_end_y_dist)) {\n if (start_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else if (max_dist_y === Math.abs(start_mid_y_dist)) {\n if (start_mid_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else {\n if (mid_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n }\n return estimatedDirection;\n}\n\nfunction estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n const reqd_vertical_direction = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n const reqd_horizontal_direction = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n if (reqd_vertical_direction === FingerDirection.verticalUp) {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalUpLeft;\n else estimatedDirection = FingerDirection.diagonalUpRight;\n } else {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalDownLeft;\n else estimatedDirection = FingerDirection.diagonalDownRight;\n }\n return estimatedDirection;\n}\n\nfunction calculateFingerDirection(startPoint, midPoint, endPoint, fingerSlopes) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const max_dist_x = Math.max(Math.abs(start_mid_x_dist), Math.abs(start_end_x_dist), Math.abs(mid_end_x_dist));\n const max_dist_y = Math.max(Math.abs(start_mid_y_dist), Math.abs(start_end_y_dist), Math.abs(mid_end_y_dist));\n let voteVertical = 0.0;\n let voteDiagonal = 0.0;\n let voteHorizontal = 0.0;\n const start_end_x_y_dist_ratio = max_dist_y / (max_dist_x + 0.00001);\n if (start_end_x_y_dist_ratio > 1.5) voteVertical += options.DISTANCE_VOTE_POWER;\n else if (start_end_x_y_dist_ratio > 0.66) voteDiagonal += options.DISTANCE_VOTE_POWER;\n else voteHorizontal += options.DISTANCE_VOTE_POWER;\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist);\n const max_dist = Math.max(start_mid_dist, start_end_dist, mid_end_dist);\n let calc_start_point_x = startPoint[0];\n let calc_start_point_y = startPoint[1];\n let calc_end_point_x = endPoint[0];\n let calc_end_point_y = endPoint[1];\n if (max_dist === start_mid_dist) {\n calc_end_point_x = endPoint[0];\n calc_end_point_y = endPoint[1];\n } else if (max_dist === mid_end_dist) {\n calc_start_point_x = midPoint[0];\n calc_start_point_y = midPoint[1];\n }\n const calcStartPoint = [calc_start_point_x, calc_start_point_y];\n const calcEndPoint = [calc_end_point_x, calc_end_point_y];\n const totalAngle = getSlopes(calcStartPoint, calcEndPoint);\n const votes = angleOrientationAt(totalAngle, options.TOTAL_ANGLE_VOTE_POWER);\n voteVertical += votes[0];\n voteDiagonal += votes[1];\n voteHorizontal += votes[2];\n for (const fingerSlope of fingerSlopes) {\n const fingerVotes = angleOrientationAt(fingerSlope, options.SINGLE_ANGLE_VOTE_POWER);\n voteVertical += fingerVotes[0];\n voteDiagonal += fingerVotes[1];\n voteHorizontal += fingerVotes[2];\n }\n // in case of tie, highest preference goes to Vertical,\n // followed by horizontal and then diagonal\n let estimatedDirection;\n if (voteVertical === Math.max(voteVertical, voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n } else if (voteHorizontal === Math.max(voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n } else {\n estimatedDirection = estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n }\n return estimatedDirection;\n}\n\nfunction estimate(landmarks) {\n // step 1: calculate slopes\n const slopesXY: Array = [];\n const slopesYZ: Array = [];\n const fingerCurls: Array = [];\n const fingerDirections: Array = [];\n if (!landmarks) return { curls: fingerCurls, directions: fingerDirections };\n\n // step 1: calculate slopes\n for (const finger of Finger.all) {\n const points = Finger.getPoints(finger);\n const slopeAtXY: Array = [];\n const slopeAtYZ: Array = [];\n for (const point of points) {\n const point1 = landmarks[point[0]];\n const point2 = landmarks[point[1]];\n // calculate single slope\n const slopes = getSlopes(point1, point2);\n const slopeXY = slopes[0];\n const slopeYZ = slopes[1];\n slopeAtXY.push(slopeXY);\n slopeAtYZ.push(slopeYZ);\n }\n slopesXY.push(slopeAtXY);\n slopesYZ.push(slopeAtYZ);\n }\n\n // step 2: calculate orientations\n for (const finger of Finger.all) {\n // start finger predictions from palm - except for thumb\n const pointIndexAt = (finger === Finger.thumb) ? 1 : 0;\n const fingerPointsAt = Finger.getPoints(finger);\n const startPoint = landmarks[fingerPointsAt[pointIndexAt][0]];\n const midPoint = landmarks[fingerPointsAt[pointIndexAt + 1][1]];\n const endPoint = landmarks[fingerPointsAt[3][1]];\n // check if finger is curled\n const fingerCurled = estimateFingerCurl(startPoint, midPoint, endPoint);\n const fingerPosition = calculateFingerDirection(startPoint, midPoint, endPoint, slopesXY[finger].slice(pointIndexAt));\n fingerCurls[finger] = fingerCurled;\n fingerDirections[finger] = fingerPosition;\n }\n return { curls: fingerCurls, directions: fingerDirections };\n}\n\nexport function analyze(keypoints) { // get estimations of curl / direction for each finger\n if (!keypoints || keypoints.length === 0) return null;\n const estimatorRes = estimate(keypoints);\n const landmarks = {};\n for (const fingerIdx of Finger.all) {\n landmarks[Finger.getName(fingerIdx)] = {\n curl: FingerCurl.getName(estimatorRes.curls[fingerIdx]),\n direction: FingerDirection.getName(estimatorRes.directions[fingerIdx]),\n };\n }\n // console.log('finger landmarks', landmarks);\n return landmarks;\n}\n\nexport function match(keypoints) { // compare gesture description to each known gesture\n const poses: Array<{ name: string, confidence: number }> = [];\n if (!keypoints || keypoints.length === 0) return poses;\n const estimatorRes = estimate(keypoints);\n for (const gesture of Gestures) {\n const confidence = gesture.matchAgainst(estimatorRes.curls, estimatorRes.directions);\n if (confidence >= minConfidence) poses.push({ name: gesture.name, confidence });\n }\n // console.log('finger poses', poses);\n return poses;\n}\n", "/**\n * HandPose model implementation\n *\n * Based on: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as handdetector from './handdetector';\nimport * as handpipeline from './handpipeline';\nimport * as fingerPose from '../hand/fingerpose';\nimport type { HandResult, Box, Point } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: Array = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n\n const keypoints = predictions[i].landmarks as unknown as Array;\n\n let box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: Box = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\n if (pt[0] < box[0]) box[0] = pt[0];\n if (pt[1] < box[1]) box[1] = pt[1];\n if (pt[0] > box[2]) box[2] = pt[0];\n if (pt[1] > box[3]) box[3] = pt[1];\n }\n box[2] -= box[0];\n box[3] -= box[1];\n boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n const landmarks = fingerPose.analyze(keypoints);\n hands.push({\n id: i,\n score: Math.round(100 * predictions[i].confidence) / 100,\n boxScore: Math.round(100 * predictions[i].boxConfidence) / 100,\n fingerScore: Math.round(100 * predictions[i].fingerConfidence) / 100,\n label: 'hand',\n box,\n boxRaw,\n keypoints,\n annotations: annotations as HandResult['annotations'],\n landmarks: landmarks as HandResult['landmarks'],\n });\n }\n return hands;\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (env.initial) {\n handDetectorModel = null;\n handPoseModel = null;\n }\n if (!handDetectorModel || !handPoseModel) {\n [handDetectorModel, handPoseModel] = await Promise.all([\n config.hand.enabled ? tf.loadGraphModel(join(config.modelBasePath, config.hand.detector?.modelPath || ''), { fromTFHub: (config.hand.detector?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,\n config.hand.landmarks ? tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton?.modelPath || ''), { fromTFHub: (config.hand.skeleton?.modelPath || '').includes('tfhub.dev') }) as unknown as GraphModel : null,\n ]);\n if (config.hand.enabled) {\n if (!handDetectorModel || !handDetectorModel['modelUrl']) log('load model failed:', config.hand.detector?.modelPath || '');\n else if (config.debug) log('load model:', handDetectorModel['modelUrl']);\n if (!handPoseModel || !handPoseModel['modelUrl']) log('load model failed:', config.hand.skeleton?.modelPath || '');\n else if (config.debug) log('load model:', handPoseModel['modelUrl']);\n }\n } else {\n if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n }\n const handDetector = new handdetector.HandDetector(handDetectorModel);\n handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n return [handDetectorModel, handPoseModel];\n}\n", "import type { Box } from '../result';\n\n// helper function: find box around keypoints, square it and scale it\nexport function scale(keypoints, boxScaleFact, outputSize) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const maxmin = [Math.max(...coords[0]), Math.min(...coords[0]), Math.max(...coords[1]), Math.min(...coords[1])]; // find min/max x/y coordinates\n const center = [(maxmin[0] + maxmin[1]) / 2, (maxmin[2] + maxmin[3]) / 2]; // find center x and y coord of all fingers\n const diff = Math.max(center[0] - maxmin[1], center[1] - maxmin[3], -center[0] + maxmin[0], -center[1] + maxmin[2]) * boxScaleFact; // largest distance from center in any direction\n const box = [\n Math.trunc(center[0] - diff),\n Math.trunc(center[1] - diff),\n Math.trunc(2 * diff),\n Math.trunc(2 * diff),\n ] as Box;\n const boxRaw = [ // work backwards\n box[0] / outputSize[0],\n box[1] / outputSize[1],\n box[2] / outputSize[0],\n box[3] / outputSize[1],\n ] as Box;\n const yxBox = [ // work backwards\n boxRaw[1],\n boxRaw[0],\n boxRaw[3] + boxRaw[1],\n boxRaw[2] + boxRaw[0],\n ] as Box;\n return { box, boxRaw, yxBox };\n}\n", "/**\n * HandTrack model implementation\n *\n * Based on:\n * - Hand Detection & Skeleton: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n * - Hand Tracking: [**HandTracking**](https://github.com/victordibia/handtracking)\n */\n\nimport { log, join } from '../util/util';\nimport { scale } from '../util/box';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { HandResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as fingerPose from './fingerpose';\nimport { fakeOps } from '../tfjs/backend';\n\nconst boxScaleFact = 1.5; // hand finger model prefers slighly larger box\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst modelOutputNodes = ['StatefulPartitionedCall/Postprocessor/Slice', 'StatefulPartitionedCall/Postprocessor/ExpandDims_1'];\n\nconst inputSize = [[0, 0], [0, 0]];\n\nconst classes = ['hand', 'fist', 'pinch', 'point', 'face', 'tip', 'pinchtip'];\n\nlet skipped = 0;\nlet outputSize: Point = [0, 0];\n\ntype HandDetectResult = {\n id: number,\n score: number,\n box: Box,\n boxRaw: Box,\n label: string,\n yxBox: Box,\n}\n\nconst cache: {\n handBoxes: Array,\n fingerBoxes: Array\n tmpBoxes: Array\n} = {\n handBoxes: [],\n fingerBoxes: [],\n tmpBoxes: [],\n};\n\nconst fingerMap = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nexport async function loadDetect(config: Config): Promise {\n // HandTrack Model: Original: TFJS Port: \n if (env.initial) models[0] = null;\n if (!models[0]) {\n // handtrack model has some kernel ops defined in model but those are never referenced and non-existent in tfjs\n // ideally need to prune the model itself\n fakeOps(['tensorlistreserve', 'enter', 'tensorlistfromtensor', 'merge', 'loopcond', 'switch', 'exit', 'tensorliststack', 'nextiteration', 'tensorlistsetitem', 'tensorlistgetitem', 'reciprocal', 'shape', 'split', 'where'], config);\n models[0] = await tf.loadGraphModel(join(config.modelBasePath, config.hand.detector?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[0].modelSignature['inputs']);\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[0] || !models[0]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[0]['modelUrl']);\n } else if (config.debug) log('cached model:', models[0]['modelUrl']);\n return models[0];\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await tf.loadGraphModel(join(config.modelBasePath, config.hand.skeleton?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[1].modelSignature['inputs']);\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[1] || !models[1]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[1]['modelUrl']);\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadSkeleton(config);\n return models;\n}\n\nasync function detectHands(input: Tensor, config: Config): Promise {\n const hands: HandDetectResult[] = [];\n if (!input || !models[0]) return hands;\n const t: Record = {};\n const ratio = (input.shape[2] || 1) / (input.shape[1] || 1);\n const height = Math.min(Math.round((input.shape[1] || 0) / 8) * 8, 512); // use dynamic input size but cap at 512\n const width = Math.round(height * ratio / 8) * 8;\n t.resize = tf.image.resizeBilinear(input, [height, width]); // todo: resize with padding\n t.cast = tf.cast(t.resize, 'int32');\n [t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes) as Tensor[];\n t.boxes = tf.squeeze(t.rawBoxes, [0, 2]);\n t.scores = tf.squeeze(t.rawScores, [0]);\n const classScores = tf.unstack(t.scores, 1);\n let id = 0;\n for (let i = 0; i < classScores.length; i++) {\n if (i === 4) continue; // skip faces\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes, classScores[i], config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.data();\n tf.dispose(t.nms);\n for (const res of Array.from(nms)) { // generates results for each class\n const boxSlice = tf.slice(t.boxes, res, 1);\n let yxBox: Box = [0, 0, 0, 0];\n if (config.hand.landmarks) { // scale box\n const detectedBox: Box = await boxSlice.data();\n const boxCenter: Point = [(detectedBox[0] + detectedBox[2]) / 2, (detectedBox[1] + detectedBox[3]) / 2];\n const boxDiff: Box = [+boxCenter[0] - detectedBox[0], +boxCenter[1] - detectedBox[1], -boxCenter[0] + detectedBox[2], -boxCenter[1] + detectedBox[3]];\n yxBox = [boxCenter[0] - boxScaleFact * boxDiff[0], boxCenter[1] - boxScaleFact * boxDiff[1], boxCenter[0] + boxScaleFact * boxDiff[2], boxCenter[1] + boxScaleFact * boxDiff[3]];\n } else { // use box as-is\n yxBox = await boxSlice.data();\n }\n const boxRaw: Box = [yxBox[1], yxBox[0], yxBox[3] - yxBox[1], yxBox[2] - yxBox[0]];\n const box: Box = [Math.trunc(boxRaw[0] * outputSize[0]), Math.trunc(boxRaw[1] * outputSize[1]), Math.trunc(boxRaw[2] * outputSize[0]), Math.trunc(boxRaw[3] * outputSize[1])];\n tf.dispose(boxSlice);\n const scoreSlice = tf.slice(classScores[i], res, 1);\n const score = (await scoreSlice.data())[0];\n tf.dispose(scoreSlice);\n const hand: HandDetectResult = { id: id++, score, box, boxRaw, label: classes[i], yxBox };\n hands.push(hand);\n }\n }\n classScores.forEach((tensor) => tf.dispose(tensor));\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n hands.sort((a, b) => b.score - a.score);\n if (hands.length > (config.hand.maxDetected || 1)) hands.length = (config.hand.maxDetected || 1);\n return hands;\n}\n\nasync function detectFingers(input: Tensor, h: HandDetectResult, config: Config): Promise {\n const hand: HandResult = {\n id: h.id,\n score: Math.round(100 * h.score) / 100,\n boxScore: Math.round(100 * h.score) / 100,\n fingerScore: 0,\n box: h.box,\n boxRaw: h.boxRaw,\n label: h.label,\n keypoints: [],\n landmarks: {} as HandResult['landmarks'],\n annotations: {} as HandResult['annotations'],\n };\n if (input && models[1] && config.hand.landmarks) {\n const t: Record = {};\n if (!h.yxBox) return hand;\n t.crop = tf.image.cropAndResize(input, [h.yxBox], [0], [inputSize[1][0], inputSize[1][1]], 'bilinear');\n t.cast = tf.cast(t.crop, 'float32');\n t.div = tf.div(t.cast, 255);\n [t.score, t.keypoints] = models[1].execute(t.div) as Tensor[];\n // const score = Math.round(100 * (await t.score.data())[0] / 100);\n const rawScore = (await t.score.data())[0];\n const score = (100 - Math.trunc(100 / (1 + Math.exp(rawScore)))) / 100; // reverse sigmoid value\n if (score >= (config.hand.minConfidence || 0)) {\n hand.fingerScore = score;\n t.reshaped = tf.reshape(t.keypoints, [-1, 3]);\n const rawCoords = await t.reshaped.array() as Point[];\n hand.keypoints = (rawCoords as Point[]).map((coord) => [\n (h.box[2] * coord[0] / inputSize[1][0]) + h.box[0],\n (h.box[3] * coord[1] / inputSize[1][1]) + h.box[1],\n (h.box[2] + h.box[3]) / 2 / inputSize[1][0] * (coord[2] || 0),\n ]);\n const updatedBox = scale(hand.keypoints, boxScaleFact, outputSize); // replace detected box with box calculated around keypoints\n h.box = updatedBox.box;\n h.boxRaw = updatedBox.boxRaw;\n h.yxBox = updatedBox.yxBox;\n hand.box = h.box;\n hand.landmarks = fingerPose.analyze(hand.keypoints) as HandResult['landmarks']; // calculate finger landmarks\n for (const key of Object.keys(fingerMap)) { // map keypoints to per-finger annotations\n hand.annotations[key] = fingerMap[key].map((index) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));\n }\n const ratioBoxFrame = Math.min(h.box[2] / (input.shape[2] || 1), h.box[3] / (input.shape[1] || 1));\n if (ratioBoxFrame > 0.05) cache.tmpBoxes.push(h); // if finger detection is enabled, only update cache if fingers are detected and box is big enough\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n return hand;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n outputSize = [input.shape[2] || 0, input.shape[1] || 0];\n let hands: Array = [];\n cache.tmpBoxes = []; // clear temp cache\n if (!config.hand.landmarks) cache.fingerBoxes = cache.handBoxes; // if hand detection only reset finger boxes cache\n if (!config.skipFrame) cache.fingerBoxes = [];\n if ((skipped < (config.hand.skipFrames || 0)) && config.skipFrame) { // just run finger detection while reusing cached boxes\n skipped++;\n hands = await Promise.all(cache.fingerBoxes.map((hand) => detectFingers(input, hand, config))); // run from finger box cache\n } else { // calculate new boxes and run finger detection\n skipped = 0;\n hands = await Promise.all(cache.fingerBoxes.map((hand) => detectFingers(input, hand, config))); // run from finger box cache\n if (hands.length !== config.hand.maxDetected) { // re-run with hand detection only if we dont have enough hands in cache\n cache.handBoxes = await detectHands(input, config);\n hands = await Promise.all(cache.handBoxes.map((hand) => detectFingers(input, hand, config)));\n }\n }\n cache.fingerBoxes = [...cache.tmpBoxes]; // repopulate cache with validated hands\n return hands as HandResult[];\n}\n", "/**\n * BlazePose model implementation\n */\n\nimport * as tf from '@tensorflow/tfjs';\nimport { log, join } from '../util/util';\nimport type { BodyKeypoint, BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport * as coords from './blazeposecoords';\n\nconst env = { initial: true };\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst inputSize = [[0, 0], [0, 0]];\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet outputNodes: string[]; // different for lite/full/heavy\nlet cache: BodyResult | null = null;\nlet padding: [number, number][] = [[0, 0], [0, 0], [0, 0], [0, 0]];\n\nexport async function loadDetect(config: Config): Promise {\n if (env.initial) models[0] = null;\n if (!models[0] && config.body.detector?.modelPath || '') {\n models[0] = await tf.loadGraphModel(join(config.modelBasePath, config.body.detector?.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[0].modelSignature['inputs']);\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!models[0] || !models[0]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[0]['modelUrl']);\n } else if (config.debug && models[0]) log('cached model:', models[0]['modelUrl']);\n return models[0] as GraphModel;\n}\n\nexport async function loadPose(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(models[1].modelSignature['inputs']);\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (config.body.modelPath?.includes('lite')) outputNodes = ['ld_3d', 'output_segmentation', 'output_heatmap', 'world_3d', 'output_poseflag'];\n else outputNodes = ['Identity', 'Identity_2', 'Identity_3', 'Identity_4', 'Identity_1']; // v2 from pinto full and heavy\n if (!models[1] || !models[1]['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', models[1]['modelUrl']);\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadPose(config);\n return models;\n}\n\nfunction calculateBoxes(keypoints: Array, outputSize: [number, number]): { keypointsBox: Box, keypointsBoxRaw: Box } {\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n const keypointsBox: Box = [Math.min(...x), Math.min(...y), Math.max(...x) - Math.min(...x), Math.max(...y) - Math.min(...y)];\n const keypointsBoxRaw: Box = [keypointsBox[0] / outputSize[0], keypointsBox[1] / outputSize[1], keypointsBox[2] / outputSize[0], keypointsBox[3] / outputSize[1]];\n /*\n const leftShoulder = keypoints.find((kpt) => kpt.part === 'leftShoulder');\n const rightShoulder = keypoints.find((kpt) => kpt.part === 'rightShoulder');\n if (!leftShoulder || !rightShoulder || !config.skipFrame) { // reset cache box coords\n cache.box = [0, 0, 1, 1];\n cache.boxRaw = cache.box;\n } else { // recalculate cache box coords\n const size = [leftShoulder.position[0] - rightShoulder.position[0], leftShoulder.position[1] - rightShoulder.position[1]];\n const shoulderWidth = Math.sqrt((size[0] * size[0]) + (size[1] * size[1])); // distance between left and right shoulder\n const shoulderCenter: Point = [(leftShoulder.position[0] + rightShoulder.position[0]) / 2, (leftShoulder.position[1] + rightShoulder.position[1]) / 2]; // center point between left and right shoulder\n const bodyCenter: Point = [shoulderCenter[0], shoulderCenter[0] + (shoulderWidth), 0]; // approximate center of the body\n const bodyCenterRaw: Point = [bodyCenter[0] / outputSize[0], bodyCenter[1] / outputSize[1], 0];\n const bodyCenterKpt: Keypoint = { part: 'bodyCenter', positionRaw: bodyCenterRaw, position: bodyCenter, score: 1 }; // add virtual keypoint\n keypoints.push(bodyCenterKpt);\n const scaleFact = 2.5;\n cache.box = [Math.trunc(bodyCenter[0] - (scaleFact * shoulderWidth)), Math.trunc(bodyCenter[1] - (scaleFact * shoulderWidth)), Math.trunc(2 * scaleFact * shoulderWidth), Math.trunc(2 * scaleFact * shoulderWidth)];\n cache.boxRaw = [cache.box[0] / outputSize[0], cache.box[1] / outputSize[1], cache.box[2] / outputSize[0], cache.box[3] / outputSize[1]];\n }\n */\n return { keypointsBox, keypointsBoxRaw };\n}\n\nasync function prepareImage(input: Tensor): Promise {\n const t: Record = {};\n if (!input.shape || !input.shape[1] || !input.shape[2]) return input;\n padding = [\n [0, 0], // dont touch batch\n [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], // height before&after\n [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], // width before&after\n [0, 0], // dont touch rbg\n ];\n t.pad = tf.pad(input as tf.Tensor4D, padding);\n t.resize = tf.image.resizeBilinear(t.pad as tf.Tensor4D, [inputSize[1][0], inputSize[1][1]]);\n const final = tf.div(t.resize, 255);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return final;\n}\n\nfunction rescaleKeypoints(keypoints: Array, outputSize: [number, number]): Array {\n for (const kpt of keypoints) {\n kpt.position = [\n kpt.position[0] * (outputSize[0] + padding[2][0] + padding[2][1]) / outputSize[0] - padding[2][0],\n kpt.position[1] * (outputSize[1] + padding[1][0] + padding[1][1]) / outputSize[1] - padding[1][0],\n kpt.position[2] as number,\n ];\n kpt.positionRaw = [\n kpt.position[0] / outputSize[0], kpt.position[1] / outputSize[1], kpt.position[2] as number,\n ];\n }\n return keypoints;\n}\n\nasync function detectParts(input: Tensor, config: Config, outputSize: [number, number]): Promise {\n const t: Record = {};\n t.input = await prepareImage(input);\n [t.ld/* 1,195 */, t.segmentation/* 1,256,256,1 */, t.heatmap/* 1,64,64,39 */, t.world/* 1,117 */, t.poseflag/* 1,1 */] = await models[1]?.execute(t.input, outputNodes) as Tensor[]; // run model\n const points = await t.ld.data();\n const keypointsRelative: Array = [];\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n const score = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; // normally this is from tf.sigmoid but no point of running sigmoid on full array which has coords as well\n // const presence = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 4])))) / 100; // reverse sigmoid value\n const positionRaw: Point = [points[depth * i + 0] / inputSize[1][0], points[depth * i + 1] / inputSize[1][1], points[depth * i + 2] + 0];\n const position: Point = [Math.trunc(outputSize[0] * positionRaw[0]), Math.trunc(outputSize[1] * positionRaw[1]), positionRaw[2] as number];\n // if (positionRaw[0] < 0 || positionRaw[1] < 0 || positionRaw[0] > 1 || positionRaw[1] > 1) score = 0;\n keypointsRelative.push({ part: coords.kpt[i], positionRaw, position, score });\n }\n const avgScore = Math.round(100 * keypointsRelative.reduce((prev, curr) => prev += curr.score, 0) / keypointsRelative.length) / 100; // average score of keypoints\n if (avgScore < (config.body.minConfidence || 0)) return null;\n const keypoints: Array = rescaleKeypoints(keypointsRelative, outputSize); // keypoints were relative to input image which is cropped\n const boxes = calculateBoxes(keypoints, [outputSize[0], outputSize[1]]); // now find boxes based on rescaled keypoints\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Array = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n return { id: 0, score: avgScore, box: boxes.keypointsBox, boxRaw: boxes.keypointsBoxRaw, keypoints, annotations };\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n const outputSize: [number, number] = [input.shape[2] || 0, input.shape[1] || 0];\n if ((skipped < (config.body.skipFrames || 0)) && config.skipFrame) {\n skipped++;\n } else {\n cache = await detectParts(input, config, outputSize);\n skipped = 0;\n }\n if (cache) return [cache];\n return [];\n}\n", "/* eslint-disable no-multi-spaces */\n\nexport const kpt = [\n 'nose', // 0\n 'leftEyeInside', // 1\n 'leftEye', // 2\n 'leftEyeOutside', // 3\n 'rightEyeInside', // 4\n 'rightEye', // 5\n 'rightEyeOutside', // 6\n 'leftEar', // 7\n 'rightEar', // 8\n 'leftMouth', // 9\n 'rightMouth', // 10\n 'leftShoulder', // 11\n 'rightShoulder', // 12\n 'leftElbow', // 13\n 'rightElbow', // 14\n 'leftWrist', // 15\n 'rightWrist', // 16\n 'leftPalm', // 17\n 'rightPalm', // 18\n 'leftIndex', // 19\n 'rightIndex', // 20\n 'leftPinky', // 21\n 'rightPinky', // 22\n 'leftHip', // 23\n 'rightHip', // 24\n 'leftKnee', // 25\n 'rightKnee', // 26\n 'leftAnkle', // 27\n 'rightAnkle', // 28\n 'leftHeel', // 29\n 'rightHeel', // 30\n 'leftFoot', // 31\n 'rightFoot', // 32\n 'bodyCenter', // 33\n 'bodyTop', // 34\n 'leftThumb', // 35\n 'leftHand', // 36\n 'rightThumb', // 37\n 'rightHand', // 38\n];\n\nexport const connected = {\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle', 'leftHeel', 'leftFoot'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle', 'rightHeel', 'rightFoot'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist', 'leftPalm'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist', 'rightPalm'],\n leftHand: [],\n rightHand: [],\n head: [],\n};\n", "export const kpt = [\n 'head',\n 'neck',\n 'rightShoulder',\n 'rightElbow',\n 'rightWrist',\n 'chest',\n 'leftShoulder',\n 'leftElbow',\n 'leftWrist',\n 'bodyCenter',\n 'rightHip',\n 'rightKnee',\n 'rightAnkle',\n 'leftHip',\n 'leftKnee',\n 'leftAnkle',\n];\n\nexport const connected = {\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * EfficientPose model implementation\n *\n * Based on: [**EfficientPose**](https://github.com/daniegr/EfficientPose)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as coords from './efficientposecoords';\nimport type { BodyKeypoint, BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\n\nconst keypoints: Array = [];\nlet box: Box = [0, 0, 0, 0];\nlet boxRaw: Box = [0, 0, 0, 0];\nlet score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nfunction max2d(inputs, minScore) {\n const [width, height] = inputs.shape;\n return tf.tidy(() => {\n const mod = (a, b) => tf.sub(a, tf.mul(tf.div(a, tf.scalar(b, 'int32')), tf.scalar(b, 'int32'))); // modulus op implemented in tf\n const reshaped = tf.reshape(inputs, [height * width]); // combine all data\n const newScore = tf.max(reshaped, 0).dataSync()[0]; // get highest score // inside tf.tidy\n if (newScore > minScore) { // skip coordinate calculation is score is too low\n const coordinates = tf.argMax(reshaped, 0);\n const x = mod(coordinates, width).dataSync()[0]; // inside tf.tidy\n const y = tf.div(coordinates, tf.scalar(width, 'int32')).dataSync()[0]; // inside tf.tidy\n return [x, y, newScore];\n }\n return [0, 0, newScore];\n });\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < (config.body?.skipFrames || 0)) && config.skipFrame && Object.keys(keypoints).length > 0) {\n skipped++;\n return [{ id: 0, score, box, boxRaw, keypoints, annotations: {} }];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n if (!model?.inputs[0].shape) return null;\n const resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n const enhance = tf.mul(resize, 2);\n const norm = enhance.sub(1);\n return norm;\n });\n\n let resT;\n if (config.body.enabled) resT = await model?.predict(tensor);\n tf.dispose(tensor);\n\n if (resT) {\n keypoints.length = 0;\n const squeeze = resT.squeeze();\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = squeeze.unstack(2);\n tf.dispose(squeeze);\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = max2d(stack[id], config.body.minConfidence);\n if (score > (config.body?.minConfidence || 0)) {\n keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: coords.kpt[id],\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = keypoints.map((a) => a.position[0]);\n const y = keypoints.map((a) => a.position[1]);\n box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = keypoints.map((a) => a.positionRaw[0]);\n const yRaw = keypoints.map((a) => a.positionRaw[1]);\n boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Array = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n resolve([{ id: 0, score, box, boxRaw, keypoints, annotations }]);\n });\n}\n", "export const kpt = [\n 'nose',\n 'leftEye',\n 'rightEye',\n 'leftEar',\n 'rightEar',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n];\n\nexport const connected = {\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * MoveNet model implementation\n *\n * Based on: [**MoveNet**](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)\n */\n\nimport { log, join } from '../util/util';\nimport { scale } from '../util/box';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as coords from './movenetcoords';\nimport type { BodyKeypoint, BodyResult, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { fakeOps } from '../tfjs/backend';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nconst cachedBoxes: Array = [];\n\nlet skipped = Number.MAX_SAFE_INTEGER;\nconst keypoints: Array = [];\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['size'], config);\n model = await tf.loadGraphModel(join(config.modelBasePath, config.body.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.body.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 256;\n return model;\n}\n\nfunction createBox(points): [Box, Box] {\n const x = points.map((a) => a.position[0]);\n const y = points.map((a) => a.position[1]);\n const box: Box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = points.map((a) => a.positionRaw[0]);\n const yRaw = points.map((a) => a.positionRaw[1]);\n const boxRaw: Box = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n return [box, boxRaw];\n}\n\nasync function parseSinglePose(res, config, image, inputBox) {\n const kpt = res[0][0];\n keypoints.length = 0;\n let score = 0;\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [\n (inputBox[3] - inputBox[1]) * kpt[id][1] + inputBox[1],\n (inputBox[2] - inputBox[0]) * kpt[id][0] + inputBox[0],\n ];\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: coords.kpt[id],\n positionRaw,\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const bodies: Array = [];\n const [box, boxRaw] = createBox(keypoints);\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Array = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n bodies.push({ id: 0, score, box, boxRaw, keypoints, annotations });\n return bodies;\n}\n\nasync function parseMultiPose(res, config, image, inputBox) {\n const bodies: Array = [];\n for (let id = 0; id < res[0].length; id++) {\n const kpt = res[0][id];\n const totalScore = Math.round(100 * kpt[51 + 4]) / 100;\n if (totalScore > config.body.minConfidence) {\n keypoints.length = 0;\n for (let i = 0; i < 17; i++) {\n const score = kpt[3 * i + 2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [\n (inputBox[3] - inputBox[1]) * kpt[3 * i + 1] + inputBox[1],\n (inputBox[2] - inputBox[0]) * kpt[3 * i + 0] + inputBox[0],\n ];\n keypoints.push({\n part: coords.kpt[i],\n score: Math.round(100 * score) / 100,\n positionRaw,\n position: [\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n const [box, boxRaw] = createBox(keypoints);\n // movenet-multipose has built-in box details\n // const boxRaw: Box = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]];\n // const box: Box = [Math.trunc(boxRaw[0] * (image.shape[2] || 0)), Math.trunc(boxRaw[1] * (image.shape[1] || 0)), Math.trunc(boxRaw[2] * (image.shape[2] || 0)), Math.trunc(boxRaw[3] * (image.shape[1] || 0))];\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Array = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n bodies.push({ id, score: totalScore, boxRaw, box, keypoints: [...keypoints], annotations });\n }\n }\n bodies.sort((a, b) => b.score - a.score);\n if (bodies.length > config.body.maxDetected) bodies.length = config.body.maxDetected;\n return bodies;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!model || !model?.inputs[0].shape) return [];\n return new Promise(async (resolve) => {\n const t: Record = {};\n\n let bodies: Array = [];\n\n if (!config.skipFrame) cachedBoxes.length = 0; // allowed to use cache or not\n skipped++;\n\n for (let i = 0; i < cachedBoxes.length; i++) { // run detection based on cached boxes\n t.crop = tf.image.cropAndResize(input, [cachedBoxes[i]], [0], [inputSize, inputSize], 'bilinear');\n t.cast = tf.cast(t.crop, 'int32');\n t.res = await model?.predict(t.cast) as Tensor;\n const res = await t.res.array();\n const newBodies = (t.res.shape[2] === 17) ? await parseSinglePose(res, config, input, cachedBoxes[i]) : await parseMultiPose(res, config, input, cachedBoxes[i]);\n bodies = bodies.concat(newBodies);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n\n if ((bodies.length !== config.body.maxDetected) && (skipped > (config.body.skipFrames || 0))) { // run detection on full frame\n t.resized = tf.image.resizeBilinear(input, [inputSize, inputSize], false);\n t.cast = tf.cast(t.resized, 'int32');\n t.res = await model?.predict(t.cast) as Tensor;\n const res = await t.res.array();\n bodies = (t.res.shape[2] === 17) ? await parseSinglePose(res, config, input, [0, 0, 1, 1]) : await parseMultiPose(res, config, input, [0, 0, 1, 1]);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n cachedBoxes.length = 0; // reset cache\n skipped = 0;\n }\n\n if (config.skipFrame) { // create box cache based on last detections\n cachedBoxes.length = 0;\n for (let i = 0; i < bodies.length; i++) {\n if (bodies[i].keypoints.length > 10) { // only update cache if we detected sufficient number of keypoints\n const kpts = bodies[i].keypoints.map((kpt) => kpt.position);\n const newBox = scale(kpts, 1.5, [input.shape[2], input.shape[1]]);\n cachedBoxes.push([...newBox.yxBox]);\n }\n }\n }\n resolve(bodies);\n });\n}\n", "/**\n * CoCo Labels used by object detection implementations\n */\nexport const labels = [\n { class: 1, label: 'person' },\n { class: 2, label: 'bicycle' },\n { class: 3, label: 'car' },\n { class: 4, label: 'motorcycle' },\n { class: 5, label: 'airplane' },\n { class: 6, label: 'bus' },\n { class: 7, label: 'train' },\n { class: 8, label: 'truck' },\n { class: 9, label: 'boat' },\n { class: 10, label: 'traffic light' },\n { class: 11, label: 'fire hydrant' },\n { class: 12, label: 'stop sign' },\n { class: 13, label: 'parking meter' },\n { class: 14, label: 'bench' },\n { class: 15, label: 'bird' },\n { class: 16, label: 'cat' },\n { class: 17, label: 'dog' },\n { class: 18, label: 'horse' },\n { class: 19, label: 'sheep' },\n { class: 20, label: 'cow' },\n { class: 21, label: 'elephant' },\n { class: 22, label: 'bear' },\n { class: 23, label: 'zebra' },\n { class: 24, label: 'giraffe' },\n { class: 25, label: 'backpack' },\n { class: 26, label: 'umbrella' },\n { class: 27, label: 'handbag' },\n { class: 28, label: 'tie' },\n { class: 29, label: 'suitcase' },\n { class: 30, label: 'frisbee' },\n { class: 31, label: 'skis' },\n { class: 32, label: 'snowboard' },\n { class: 33, label: 'sports ball' },\n { class: 34, label: 'kite' },\n { class: 35, label: 'baseball bat' },\n { class: 36, label: 'baseball glove' },\n { class: 37, label: 'skateboard' },\n { class: 38, label: 'surfboard' },\n { class: 39, label: 'tennis racket' },\n { class: 40, label: 'bottle' },\n { class: 41, label: 'wine glass' },\n { class: 42, label: 'cup' },\n { class: 43, label: 'fork' },\n { class: 44, label: 'knife' },\n { class: 45, label: 'spoon' },\n { class: 46, label: 'bowl' },\n { class: 47, label: 'banana' },\n { class: 48, label: 'apple' },\n { class: 49, label: 'sandwich' },\n { class: 50, label: 'orange' },\n { class: 51, label: 'broccoli' },\n { class: 52, label: 'carrot' },\n { class: 53, label: 'hot dog' },\n { class: 54, label: 'pizza' },\n { class: 55, label: 'donut' },\n { class: 56, label: 'cake' },\n { class: 57, label: 'chair' },\n { class: 58, label: 'couch' },\n { class: 59, label: 'potted plant' },\n { class: 60, label: 'bed' },\n { class: 61, label: 'dining table' },\n { class: 62, label: 'toilet' },\n { class: 63, label: 'tv' },\n { class: 64, label: 'laptop' },\n { class: 65, label: 'mouse' },\n { class: 66, label: 'remote' },\n { class: 67, label: 'keyboard' },\n { class: 68, label: 'cell phone' },\n { class: 69, label: 'microwave' },\n { class: 70, label: 'oven' },\n { class: 71, label: 'toaster' },\n { class: 72, label: 'sink' },\n { class: 73, label: 'refrigerator' },\n { class: 74, label: 'book' },\n { class: 75, label: 'clock' },\n { class: 76, label: 'vase' },\n { class: 77, label: 'scissors' },\n { class: 78, label: 'teddy bear' },\n { class: 79, label: 'hair drier' },\n { class: 80, label: 'toothbrush' },\n];\n", "/**\n * NanoDet object detection model implementation\n *\n * Based on: [**MB3-CenterNet**](https://github.com/610265158/mobilenetv3_centernet)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport type { ObjectResult, Box } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model;\nlet last: Array = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || ''));\n const inputs = Object.values(model.modelSignature['inputs']);\n model.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null;\n if (!model.inputSize) throw new Error(`cannot determine model inputSize: ${config.object.modelPath}`);\n if (!model || !model.modelUrl) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model.modelUrl);\n } else if (config.debug) log('cached model:', model.modelUrl);\n return model;\n}\n\nasync function process(res, inputSize, outputShape, config) {\n let id = 0;\n let results: Array = [];\n for (const strideSize of [1, 2, 4]) { // try each stride size as it detects large/medium/small objects\n // find scores, boxes, classes\n tf.tidy(async () => { // wrap in tidy to automatically deallocate temp tensors\n const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] === labels.length))?.squeeze();\n const featuresT = res.find((a) => (a.shape[1] === (baseSize ** 2) && a.shape[2] < labels.length))?.squeeze();\n const boxesMax = featuresT.reshape([-1, 4, featuresT.shape[1] / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdx = await boxesMax.argMax(2).array(); // what we need is indexes of features with highest scores, not values itself\n const scores = await scoresT.array(); // optionally use exponential scores or just as-is\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < scoresT.shape[1]; j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > config.object.minConfidence && j !== 61) {\n const cx = (0.5 + Math.trunc(i % baseSize)) / baseSize; // center.x normalized to range 0..1\n const cy = (0.5 + Math.trunc(i / baseSize)) / baseSize; // center.y normalized to range 0..1\n const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / inputSize)); // just grab indexes of features with highest scores\n const [x, y] = [\n cx - (scaleBox / strideSize * boxOffset[0]),\n cy - (scaleBox / strideSize * boxOffset[1]),\n ];\n const [w, h] = [\n cx + (scaleBox / strideSize * boxOffset[2]) - x,\n cy + (scaleBox / strideSize * boxOffset[3]) - y,\n ];\n let boxRaw: Box = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))) as Box; // fix out-of-bounds coords\n const box = [ // results normalized to input image pixels\n boxRaw[0] * outputShape[0],\n boxRaw[1] * outputShape[1],\n boxRaw[2] * outputShape[0],\n boxRaw[3] * outputShape[1],\n ];\n const result = {\n id: id++,\n // strideSize,\n score: Math.round(100 * score) / 100,\n class: j + 1,\n label: labels[j].label,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)) as Box,\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n });\n }\n // deallocate tensors\n res.forEach((t) => tf.dispose(t));\n\n // normally nms is run on raw results, but since boxes need to be calculated this way we skip calulcation of\n // unnecessary boxes and run nms only on good candidates (basically it just does IOU analysis as scores are already filtered)\n const nmsBoxes = results.map((a) => [a.boxRaw[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: Array = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = await nms.data();\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((_val, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor, config: Config): Promise {\n if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2], image.shape[1]];\n const resize = tf.image.resizeBilinear(image, [model.inputSize, model.inputSize], false);\n const norm = tf.div(resize, 255);\n const transpose = norm.transpose([0, 3, 1, 2]);\n tf.dispose(norm);\n tf.dispose(resize);\n\n let objectT;\n if (config.object.enabled) objectT = await model.predict(transpose);\n tf.dispose(transpose);\n\n const obj = await process(objectT, model.inputSize, outputSize, config);\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * CenterNet object detection model implementation\n *\n * Based on: [**NanoDet**](https://github.com/RangiLyu/nanodet)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport { labels } from './labels';\nimport type { ObjectResult, Box } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport { fakeOps } from '../tfjs/backend';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet last: ObjectResult[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['floormod'], config);\n model = await tf.loadGraphModel(join(config.modelBasePath, config.object.modelPath || '')) as unknown as GraphModel;\n const inputs = Object.values(model.modelSignature['inputs']);\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n if (!model || !model['modelUrl']) log('load model failed:', config.object.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor | null, outputShape, config: Config) {\n if (!res) return [];\n const results: Array = [];\n const detections = await res.array();\n const squeezeT = tf.squeeze(res);\n tf.dispose(res);\n const arr = tf.split(squeezeT, 6, 1); // x1, y1, x2, y2, score, class\n tf.dispose(squeezeT);\n const stackT = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n const boxesT = tf.squeeze(stackT);\n tf.dispose(stackT);\n const scoresT = tf.squeeze(arr[4]);\n const classesT = tf.squeeze(arr[5]);\n arr.forEach((t) => tf.dispose(t));\n const nmsT = await tf.image.nonMaxSuppressionAsync(boxesT, scoresT, config.object.maxDetected, config.object.iouThreshold, config.object.minConfidence);\n tf.dispose(boxesT);\n tf.dispose(scoresT);\n tf.dispose(classesT);\n const nms = await nmsT.data();\n tf.dispose(nmsT);\n let i = 0;\n for (const id of nms) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n const label = labels[classVal].label;\n const [x, y] = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n ];\n const boxRaw: Box = [\n x,\n y,\n detections[0][id][2] / inputSize - x,\n detections[0][id][3] / inputSize - y,\n ];\n const box: Box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n return results;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if ((skipped < (config.object.skipFrames || 0)) && config.skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2], input.shape[1]];\n const resize = tf.image.resizeBilinear(input, [inputSize, inputSize]);\n const objectT = config.object.enabled ? model?.execute(resize, ['tower_0/detections']) as Tensor : null;\n tf.dispose(resize);\n\n const obj = await process(objectT, outputSize, config);\n last = obj;\n\n resolve(obj);\n });\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Meet**](https://drive.google.com/file/d/1lnP1bRi9CSqQQXUHa13159vLELYDgDu0/preview)\n * - [**MediaPipe Selfie**](https://drive.google.com/file/d/1dCfozqknMa068vVsO2j_1FgZkW_e3VWv/preview)\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport type { Input } from '../image/image';\n\nlet model: GraphModel;\nlet busy = false;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.segmentation.modelPath || '')) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.segmentation.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function process(input: Input, background: Input | undefined, config: Config)\n: Promise<{ data: Array, canvas: HTMLCanvasElement | OffscreenCanvas | null, alpha: HTMLCanvasElement | OffscreenCanvas | null }> {\n if (busy) return { data: [], canvas: null, alpha: null };\n busy = true;\n if (!model) await load(config);\n const inputImage = image.process(input, config);\n const width = inputImage.canvas?.width || 0;\n const height = inputImage.canvas?.height || 0;\n if (!inputImage.tensor) return { data: [], canvas: null, alpha: null };\n const t: Record = {};\n\n t.resize = tf.image.resizeBilinear(inputImage.tensor, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n tf.dispose(inputImage.tensor);\n t.norm = tf.div(t.resize, 255);\n t.res = model.predict(t.norm) as Tensor;\n\n t.squeeze = tf.squeeze(t.res, 0); // meet.shape:[1,256,256,1], selfie.shape:[1,144,256,2]\n if (t.squeeze.shape[2] === 2) {\n t.softmax = tf.softmax(t.squeeze); // model meet has two channels for fg and bg\n [t.bg, t.fg] = tf.unstack(t.softmax, 2);\n t.expand = tf.expandDims(t.fg, 2);\n t.pad = tf.expandDims(t.expand, 0);\n t.crop = tf.image.cropAndResize(t.pad, [[0, 0, 0.5, 0.5]], [0], [width, height]);\n // running sofmax before unstack creates 2x2 matrix so we only take upper-left quadrant\n // otherwise run softmax after unstack and use standard resize\n // resizeOutput = tf.image.resizeBilinear(expand, [input.tensor?.shape[1], input.tensor?.shape[2]]);\n t.data = tf.squeeze(t.crop, 0);\n } else {\n t.data = tf.image.resizeBilinear(t.squeeze, [height, width]); // model selfie has a single channel that we can use directly\n }\n const data = Array.from(await t.data.data());\n\n if (env.node && !env.Canvas && (typeof ImageData === 'undefined')) {\n if (config.debug) log('canvas support missing');\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return { data, canvas: null, alpha: null }; // running in nodejs so return alpha array as-is\n }\n\n const alphaCanvas = image.canvas(width, height);\n await tf.browser.toPixels(t.data, alphaCanvas);\n const alphaCtx = alphaCanvas.getContext('2d') as CanvasRenderingContext2D;\n if (config.segmentation.blur && config.segmentation.blur > 0) alphaCtx.filter = `blur(${config.segmentation.blur}px)`; // use css filter for bluring, can be done with gaussian blur manually instead\n const alphaData = alphaCtx.getImageData(0, 0, width, height);\n\n const compositeCanvas = image.canvas(width, height);\n const compositeCtx = compositeCanvas.getContext('2d') as CanvasRenderingContext2D;\n if (inputImage.canvas) compositeCtx.drawImage(inputImage.canvas, 0, 0);\n compositeCtx.globalCompositeOperation = 'darken'; // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation // best options are: darken, color-burn, multiply\n if (config.segmentation.blur && config.segmentation.blur > 0) compositeCtx.filter = `blur(${config.segmentation.blur}px)`; // use css filter for bluring, can be done with gaussian blur manually instead\n compositeCtx.drawImage(alphaCanvas, 0, 0);\n compositeCtx.globalCompositeOperation = 'source-over'; // reset composite operation\n compositeCtx.filter = 'none'; // reset css filter\n const compositeData = compositeCtx.getImageData(0, 0, width, height);\n for (let i = 0; i < width * height; i++) compositeData.data[4 * i + 3] = alphaData.data[4 * i + 0]; // copy original alpha value to new composite canvas\n compositeCtx.putImageData(compositeData, 0, 0);\n\n let mergedCanvas: HTMLCanvasElement | OffscreenCanvas | null = null;\n if (background && compositeCanvas) { // draw background with segmentation as overlay if background is present\n mergedCanvas = image.canvas(width, height);\n const bgImage = image.process(background, config);\n tf.dispose(bgImage.tensor);\n const ctxMerge = mergedCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctxMerge.drawImage(bgImage.canvas as HTMLCanvasElement, 0, 0, mergedCanvas.width, mergedCanvas.height);\n ctxMerge.drawImage(compositeCanvas, 0, 0);\n }\n\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n busy = false;\n\n return { data, canvas: mergedCanvas || compositeCanvas, alpha: alphaCanvas };\n}\n", "/**\n * GEAR [gender/emotion/age/race] model implementation\n *\n * Based on: [**GEAR Predictor**](https://github.com/Udolf15/GEAR-Predictor)\n *\n * Obsolete and replaced by `faceres` that performs age/gender/descriptor analysis\n * Config placeholder: agegenderrace: { enabled: true, modelPath: 'gear.json' },\n */\n\nimport { log, join } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\n\nlet last = { age: 0 };\nlet skipped = Number.MAX_SAFE_INTEGER;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function load(config: Config | any) {\n if (env.initial) model = null;\n if (!model) {\n model = await tf.loadGraphModel(join(config.modelBasePath, config.face.agegenderrace.modelPath)) as unknown as GraphModel;\n if (!model || !model['modelUrl']) log('load model failed:', config.face.agegenderrace.modelPath);\n else if (config.debug) log('load model:', model['modelUrl']);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function predict(image: Tensor, config: Config) {\n if (!model) return null;\n // @ts-ignore config disabled\n if ((skipped < config.face.agegenderrace.skipFrames) && config.skipFrame && last.age && (last.age > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape[2], model?.inputs[0].shape[1]], false);\n // const enhance = tf.mul(resize, [255.0]);\n\n let ageT;\n let genderT;\n let raceT;\n const obj = { age: 0 };\n\n // @ts-ignore array definition unavailable at compile time\n if (config.face.agegenderrace.enabled) [ageT, genderT, raceT] = await model.execute(resize, ['age_output', 'gender_output', 'race_output']);\n tf.dispose(resize);\n // tf.dispose(enhance);\n\n if (ageT) {\n // const data = await ageT.data();\n // {0: 'below_20', 1: '21-25', 2: '26-30', 3: '31-40',4: '41-50', 5: '51-60', 6: 'Above60'}\n }\n if (genderT) {\n // const data = await genderT.data();\n }\n if (raceT) {\n // const data = await raceT.data();\n // {0: 'white', 1: 'black', 2: 'asian', 3: 'indian', 4: 'others'}\n }\n\n tf.dispose(ageT);\n tf.dispose(genderT);\n tf.dispose(raceT);\n\n last = obj;\n resolve(obj);\n });\n}\n", "/**\n * Loader and Validator for all models used by Human\n */\n\nimport { log } from './util/util';\nimport type { GraphModel } from './tfjs/types';\nimport * as blazeface from './face/blazeface';\nimport * as facemesh from './face/facemesh';\nimport * as iris from './face/iris';\nimport * as faceres from './face/faceres';\nimport * as emotion from './gear/emotion';\nimport * as posenet from './body/posenet';\nimport * as handpose from './handpose/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as blazepose from './body/blazepose';\nimport * as efficientpose from './body/efficientpose';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as centernet from './object/centernet';\nimport * as segmentation from './segmentation/segmentation';\nimport type { Human } from './human';\nimport { env } from './util/env';\nimport * as agegenderrace from './gear/gear-agegenderrace';\n\n/** Instances of all possible TFJS Graph Models used by Human\n * - loaded as needed based on configuration\n * - initialized explictly with `human.load()` method\n * - initialized implicity on first call to `human.detect()`\n * - each model can be `null` if not loaded, instance of `GraphModel` if loaded or `Promise` if loading\n */\nexport class Models {\n age: null | GraphModel | Promise = null;\n agegenderrace: null | GraphModel | Promise = null;\n blazeposedetect: null | GraphModel | Promise = null;\n blazepose: null | GraphModel | Promise = null;\n centernet: null | GraphModel | Promise = null;\n efficientpose: null | GraphModel | Promise = null;\n embedding: null | GraphModel | Promise = null;\n emotion: null | GraphModel | Promise = null;\n facedetect: null | GraphModel | Promise = null;\n faceiris: null | GraphModel | Promise = null;\n facemesh: null | GraphModel | Promise = null;\n faceres: null | GraphModel | Promise = null;\n gender: null | GraphModel | Promise = null;\n handpose: null | GraphModel | Promise = null;\n handskeleton: null | GraphModel | Promise = null;\n handtrack: null | GraphModel | Promise = null;\n movenet: null | GraphModel | Promise = null;\n nanodet: null | GraphModel | Promise = null;\n posenet: null | GraphModel | Promise = null;\n segmentation: null | GraphModel | Promise = null;\n}\n\nexport function reset(instance: Human): void {\n // if (instance.config.debug) log('resetting loaded models');\n for (const model of Object.keys(instance.models)) instance.models[model] = null;\n}\n\n/** Load method preloads all instance.configured models on-demand */\nexport async function load(instance: Human): Promise {\n if (env.initial) reset(instance);\n if (instance.config.hand.enabled) { // handpose model is a combo that must be loaded as a whole\n if (!instance.models.handpose && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config);\n if (!instance.models.handskeleton && instance.config.hand.landmarks && instance.config.hand.detector?.modelPath?.includes('handdetect')) [instance.models.handpose, instance.models.handskeleton] = await handpose.load(instance.config);\n }\n if (instance.config.face.enabled && !instance.models.facedetect) instance.models.facedetect = blazeface.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.mesh?.enabled && !instance.models.facemesh) instance.models.facemesh = facemesh.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.iris?.enabled && !instance.models.faceiris) instance.models.faceiris = iris.load(instance.config);\n if (instance.config.hand.enabled && !instance.models.handtrack && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handtrack = handtrack.loadDetect(instance.config);\n if (instance.config.hand.enabled && instance.config.hand.landmarks && !instance.models.handskeleton && instance.config.hand.detector?.modelPath?.includes('handtrack')) instance.models.handskeleton = handtrack.loadSkeleton(instance.config);\n if (instance.config.body.enabled && !instance.models.posenet && instance.config.body?.modelPath?.includes('posenet')) instance.models.posenet = posenet.load(instance.config);\n if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config);\n if (instance.config.body.enabled && !instance.models.blazepose && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazepose = blazepose.loadPose(instance.config);\n if (instance.config.body.enabled && !instance.models.blazeposedetect && instance.config.body.detector?.modelPath && instance.config.body?.modelPath?.includes('blazepose')) instance.models.blazeposedetect = blazepose.loadDetect(instance.config);\n if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body?.modelPath?.includes('efficientpose')) instance.models.efficientpose = efficientpose.load(instance.config);\n if (instance.config.body.enabled && !instance.models.movenet && instance.config.body?.modelPath?.includes('movenet')) instance.models.movenet = movenet.load(instance.config);\n if (instance.config.object.enabled && !instance.models.nanodet && instance.config.object?.modelPath?.includes('nanodet')) instance.models.nanodet = nanodet.load(instance.config);\n if (instance.config.object.enabled && !instance.models.centernet && instance.config.object?.modelPath?.includes('centernet')) instance.models.centernet = centernet.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.emotion?.enabled && !instance.models.emotion) instance.models.emotion = emotion.load(instance.config);\n if (instance.config.face.enabled && instance.config.face.description?.enabled && !instance.models.faceres) instance.models.faceres = faceres.load(instance.config);\n if (instance.config.segmentation.enabled && !instance.models.segmentation) instance.models.segmentation = segmentation.load(instance.config);\n if (instance.config.face.enabled && instance.config.face['agegenderrace']?.enabled && !instance.models.agegenderrace) instance.models.agegenderrace = agegenderrace.load(instance.config);\n\n // models are loaded in parallel asynchronously so lets wait until they are actually loaded\n for await (const model of Object.keys(instance.models)) {\n if (instance.models[model] && typeof instance.models[model] !== 'undefined') instance.models[model] = await instance.models[model];\n }\n}\n\nexport async function validate(instance: Human): Promise {\n interface Op { name: string, category: string, op: string }\n const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div'];\n for (const defined of Object.keys(instance.models)) {\n if (instance.models[defined]) { // check if model is loaded\n let models: GraphModel[] = [];\n if (Array.isArray(instance.models[defined])) {\n models = instance.models[defined]\n .filter((model) => (model !== null))\n .map((model) => ((model && model.executor) ? model : model.model));\n } else {\n models = [instance.models[defined]];\n }\n for (const model of models) {\n if (!model) {\n if (instance.config.debug) log('model marked as loaded but not defined:', defined);\n continue;\n }\n const ops: string[] = [];\n // @ts-ignore // executor is a private method\n const executor = model?.executor;\n if (executor && executor.graph.nodes) {\n for (const kernel of Object.values(executor.graph.nodes)) {\n const op = (kernel as Op).op.toLowerCase();\n if (!ops.includes(op)) ops.push(op);\n }\n } else {\n if (!executor && instance.config.debug) log('model signature not determined:', defined);\n }\n const missing: string[] = [];\n for (const op of ops) {\n if (!simpleOps.includes(op) // exclude simple ops\n && !instance.env.kernels.includes(op) // check actual kernel ops\n && !instance.env.kernels.includes(op.replace('_', '')) // check variation without _\n && !instance.env.kernels.includes(op.replace('native', '')) // check standard variation\n && !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation\n missing.push(op);\n }\n }\n // log('model validation ops:', defined, ops);\n if (missing.length > 0 && instance.config.debug) log('model validation:', defined, missing);\n }\n }\n }\n}\n", "/** TFJS custom backend registration */\n\nimport { log } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as image from '../image/image';\nimport * as models from '../models';\n// import { env } from '../env';\n\nexport const config = {\n name: 'humangl',\n priority: 999,\n canvas: null,\n gl: null,\n extensions: [],\n webGLattr: { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: false,\n desynchronized: true,\n },\n};\n\nfunction extensions(): void {\n /*\n https://www.khronos.org/registry/webgl/extensions/\n https://webglreport.com/?v=2\n */\n const gl = config.gl;\n if (!gl) return;\n config.extensions = gl.getSupportedExtensions() as string[];\n // gl.getExtension('KHR_parallel_shader_compile');\n}\n\n/**\n * Registers custom WebGL2 backend to be used by Human library\n *\n * @returns void\n */\nexport async function register(instance): Promise {\n // force backend reload if gl context is not valid\n if (instance.config.backend !== 'humangl') return;\n if ((config.name in tf.engine().registry) && (!config.gl || !config.gl.getParameter(config.gl.VERSION))) {\n log('error: humangl backend invalid context');\n models.reset(instance);\n /*\n log('resetting humangl backend');\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n }\n if (!tf.findBackend(config.name)) {\n try {\n config.canvas = await image.canvas(100, 100);\n } catch (err) {\n log('error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas?.getContext('webgl2', config.webGLattr) as WebGL2RenderingContext;\n if (config.canvas) {\n config.canvas.addEventListener('webglcontextlost', async (e) => {\n log('error: humangl:', e.type);\n // log('gpu memory usage:', instance.tf.engine().backendInstance.numBytesInGPU);\n log('possible browser memory leak using webgl');\n instance.emit('error');\n // throw new Error('browser webgl error');\n /*\n log('resetting humangl backend');\n env.initial = true;\n models.reset(instance);\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n });\n config.canvas.addEventListener('webglcontextrestored', (e) => {\n log('error: humangl context restored:', e);\n });\n config.canvas.addEventListener('webglcontextcreationerror', (e) => {\n log('error: humangl context create:', e);\n });\n }\n } catch (err) {\n log('error: cannot get WebGL context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('error: cannot set WebGL context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('error: cannot register WebGL backend:', err);\n return;\n }\n try {\n const kernels = tf.getKernelsForBackend('webgl');\n kernels.forEach((kernelConfig) => {\n const newKernelConfig = { ...kernelConfig, backendName: config.name };\n tf.registerKernel(newKernelConfig);\n });\n } catch (err) {\n log('error: cannot update WebGL backend registration:', err);\n return;\n }\n const current = tf.backend().getGPGPUContext ? tf.backend().getGPGPUContext().gl : null;\n if (current) {\n log(`humangl webgl version:${current.getParameter(current.VERSION)} renderer:${current.getParameter(current.RENDERER)}`);\n } else {\n log('error: no current gl context:', current, config.gl);\n return;\n }\n try {\n tf.ENV.set('WEBGL_VERSION', 2);\n } catch (err) {\n log('error: cannot set WebGL backend flags:', err);\n return;\n }\n extensions();\n log('backend registered:', config.name);\n }\n}\n", "/** TFJS backend initialization and customization */\n\nimport { log, now } from '../util/util';\nimport * as humangl from './humangl';\nimport * as env from '../util/env';\nimport * as tf from '../../dist/tfjs.esm.js';\n\nexport async function check(instance, force = false) {\n instance.state = 'backend';\n if (force || env.env.initial || (instance.config.backend && (instance.config.backend.length > 0) && (tf.getBackend() !== instance.config.backend))) {\n const timeStamp = now();\n\n if (instance.config.backend && instance.config.backend.length > 0) {\n // detect web worker\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && instance.config.debug) {\n if (instance.config.debug) log('running inside web worker');\n }\n\n // force browser vs node backend\n if (env.env.browser && instance.config.backend === 'tensorflow') {\n if (instance.config.debug) log('override: backend set to tensorflow while running in browser');\n instance.config.backend = 'humangl';\n }\n if (env.env.node && (instance.config.backend === 'webgl' || instance.config.backend === 'humangl')) {\n if (instance.config.debug) log(`override: backend set to ${instance.config.backend} while running in nodejs`);\n instance.config.backend = 'tensorflow';\n }\n\n // handle webgpu\n if (env.env.browser && instance.config.backend === 'webgpu') {\n if (typeof navigator === 'undefined' || typeof navigator['gpu'] === 'undefined') {\n log('override: backend set to webgpu but browser does not support webgpu');\n instance.config.backend = 'humangl';\n } else {\n const adapter = await navigator['gpu'].requestAdapter();\n if (instance.config.debug) log('enumerated webgpu adapter:', adapter);\n }\n }\n\n // check available backends\n if (instance.config.backend === 'humangl') await humangl.register(instance);\n const available = Object.keys(tf.engine().registryFactory);\n if (instance.config.debug) log('available backends:', available);\n\n if (!available.includes(instance.config.backend)) {\n log(`error: backend ${instance.config.backend} not found in registry`);\n instance.config.backend = env.env.node ? 'tensorflow' : 'webgl';\n if (instance.config.debug) log(`override: setting backend ${instance.config.backend}`);\n }\n\n if (instance.config.debug) log('setting backend:', instance.config.backend);\n\n // handle wasm\n if (instance.config.backend === 'wasm') {\n if (instance.config.debug) log('wasm path:', instance.config.wasmPath);\n if (typeof tf?.setWasmPaths !== 'undefined') await tf.setWasmPaths(instance.config.wasmPath);\n else throw new Error('wasm backend is not loaded');\n const simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT');\n const mt = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT');\n if (instance.config.debug) log(`wasm execution: ${simd ? 'SIMD' : 'no SIMD'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (instance.config.debug && !simd) log('warning: wasm simd support is not enabled');\n }\n\n try {\n await tf.setBackend(instance.config.backend);\n await tf.ready();\n } catch (err) {\n log('error: cannot set backend:', instance.config.backend, err);\n return false;\n }\n }\n\n // handle webgl & humangl\n if (tf.getBackend() === 'humangl') {\n tf.ENV.set('CHECK_COMPUTATION_FOR_ERRORS', false);\n tf.ENV.set('WEBGL_CPU_FORWARD', true);\n tf.ENV.set('WEBGL_PACK_DEPTHWISECONV', false);\n tf.ENV.set('WEBGL_USE_SHAPES_UNIFORMS', true);\n tf.ENV.set('CPU_HANDOFF_SIZE_THRESHOLD', 128);\n // if (!instance.config.object.enabled) tf.ENV.set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (typeof instance.config['deallocate'] !== 'undefined' && instance.config['deallocate']) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n tf.ENV.set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n if (tf.backend().getGPGPUContext) {\n const gl = await tf.backend().getGPGPUContext().gl;\n if (instance.config.debug) log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`);\n }\n }\n\n // handle webgpu\n if (tf.getBackend() === 'webgpu') {\n tf.ENV.set('WEBGPU_USE_GLSL', true);\n }\n\n // wait for ready\n tf.enableProdMode();\n await tf.ready();\n instance.performance.backend = Math.trunc(now() - timeStamp);\n instance.config.backend = tf.getBackend();\n\n env.get(); // update env on backend init\n instance.env = env.env;\n }\n return true;\n}\n\n// register fake missing tfjs ops\nexport function fakeOps(kernelNames: Array, config) {\n // if (config.debug) log('registerKernel:', kernelNames);\n for (const kernelName of kernelNames) {\n const kernelConfig = {\n kernelName,\n backendName: config.backend,\n kernelFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // setupFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // disposeFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n };\n tf.registerKernel(kernelConfig);\n }\n env.env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase()); // re-scan registered ops\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { TRI468 as triangulation } from '../face/facemeshcoords';\nimport { mergeDeep, now } from './util';\nimport type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult, Point } from '../result';\n\n/**\n * Draw Options\n * Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n * -color: draw color\n * -labelColor: color for labels\n * -shadowColor: optional shadow color for labels\n * -font: font for labels\n * -lineHeight: line height for labels, used for multi-line labels,\n * -lineWidth: width of any lines,\n * -pointSize: size of any point,\n * -roundRect: for boxes, round corners by this many pixels,\n * -drawPoints: should points be drawn,\n * -drawLabels: should labels be drawn,\n * -drawBoxes: should boxes be drawn,\n * -drawPolygons: should polygons be drawn,\n * -fillPolygons: should drawn polygons be filled,\n * -useDepth: use z-axis coordinate as color shade,\n * -useCurves: draw polygons as cures or as lines,\n * -bufferedOutput: experimental: allows to call draw methods multiple times for each detection and interpolate results between results thus achieving smoother animations\n */\nexport interface DrawOptions {\n color: string,\n labelColor: string,\n shadowColor: string,\n font: string,\n lineHeight: number,\n lineWidth: number,\n pointSize: number,\n roundRect: number,\n drawPoints: boolean,\n drawLabels: boolean,\n drawBoxes: boolean,\n drawPolygons: boolean,\n drawGaze: boolean,\n fillPolygons: boolean,\n useDepth: boolean,\n useCurves: boolean,\n bufferedOutput: boolean,\n}\n\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)', // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)', // 'lightblue' with dark alpha channel\n shadowColor: 'black',\n font: 'small-caps 14px \"Segoe UI\"',\n lineHeight: 18,\n lineWidth: 4,\n pointSize: 2,\n roundRect: 8,\n drawPoints: false,\n drawLabels: true,\n drawBoxes: true,\n drawPolygons: true,\n drawGaze: true,\n fillPolygons: false,\n useDepth: true,\n useCurves: false,\n bufferedOutput: true,\n};\n\nconst getCanvasContext = (input) => {\n if (input && input.getContext) return input.getContext('2d');\n throw new Error('invalid canvas');\n};\n\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nfunction point(ctx, x, y, z = 0, localOptions) {\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nfunction rect(ctx, x, y, width, height, localOptions) {\n ctx.beginPath();\n if (localOptions.useCurves) {\n const cx = (x + x + width) / 2;\n const cy = (y + y + height) / 2;\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n ctx.lineWidth = localOptions.lineWidth;\n ctx.moveTo(x + localOptions.roundRect, y);\n ctx.lineTo(x + width - localOptions.roundRect, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + localOptions.roundRect);\n ctx.lineTo(x + width, y + height - localOptions.roundRect);\n ctx.quadraticCurveTo(x + width, y + height, x + width - localOptions.roundRect, y + height);\n ctx.lineTo(x + localOptions.roundRect, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - localOptions.roundRect);\n ctx.lineTo(x, y + localOptions.roundRect);\n ctx.quadraticCurveTo(x, y, x + localOptions.roundRect, y);\n ctx.closePath();\n }\n ctx.stroke();\n}\n\nfunction lines(ctx, points: Point[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n const z = pt[2] || 0;\n ctx.strokeStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.fillStyle = localOptions.useDepth && z ? `rgba(${127.5 + (2 * z)}, ${127.5 - (2 * z)}, 255, 0.3)` : localOptions.color;\n ctx.lineTo(pt[0], Math.round(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nfunction curves(ctx, points: Point[] = [], localOptions) {\n if (points === undefined || points.length === 0) return;\n if (!localOptions.useCurves || points.length <= 2) {\n lines(ctx, points, localOptions);\n return;\n }\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 0; i < points.length - 2; i++) {\n const xc = (points[i][0] + points[i + 1][0]) / 2;\n const yc = (points[i][1] + points[i + 1][1]) / 2;\n ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc);\n }\n ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport async function gesture(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.font = localOptions.font;\n ctx.fillStyle = localOptions.color;\n let i = 1;\n for (let j = 0; j < result.length; j++) {\n let where: unknown[] = []; // what&where is a record\n let what: unknown[] = []; // what&where is a record\n [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n const label = `${where[0]} ${who}: ${what[1]}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 8, 2 + (i * localOptions.lineHeight));\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, 6, 0 + (i * localOptions.lineHeight));\n i += 1;\n }\n }\n}\n\nexport async function face(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n for (const f of result) {\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n if (localOptions.drawBoxes) rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n // silly hack since fillText does not suport new line\n const labels:string[] = [];\n labels.push(`face: ${Math.trunc(100 * f.score)}%`);\n if (f.genderScore) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderScore)}%`);\n if (f.age) labels.push(`age: ${f.age || ''}`);\n if (f.iris) labels.push(`distance: ${f.iris}`);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n labels.push(emotion.join(' '));\n }\n if (f.rotation && f.rotation.angle && f.rotation.gaze) {\n if (f.rotation.angle.roll) labels.push(`roll: ${rad2deg(f.rotation.angle.roll)}\u00B0 yaw:${rad2deg(f.rotation.angle.yaw)}\u00B0 pitch:${rad2deg(f.rotation.angle.pitch)}\u00B0`);\n if (f.rotation.gaze.bearing) labels.push(`gaze: ${rad2deg(f.rotation.gaze.bearing)}\u00B0`);\n }\n if (labels.length === 0) labels.push('face');\n ctx.fillStyle = localOptions.color;\n for (let i = labels.length - 1; i >= 0; i--) {\n const x = Math.max(f.box[0], 0);\n const y = i * localOptions.lineHeight + f.box[1];\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(labels[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(labels[i], x + 4, y + 15);\n }\n ctx.lineWidth = 1;\n if (f.mesh && f.mesh.length > 0) {\n if (localOptions.drawPoints) {\n for (const pt of f.mesh) point(ctx, pt[0], pt[1], pt[2], localOptions);\n }\n if (localOptions.drawPolygons) {\n ctx.lineWidth = 1;\n if (f.mesh.length > 450) {\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [\n triangulation[i * 3 + 0],\n triangulation[i * 3 + 1],\n triangulation[i * 3 + 2],\n ].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n }\n // iris: array[center, left, top, right, bottom]\n if (f.annotations && f.annotations['leftEyeIris'] && f.annotations['leftEyeIris'][0]) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['leftEyeIris'][3][0] - f.annotations['leftEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['leftEyeIris'][4][1] - f.annotations['leftEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (f.annotations && f.annotations['rightEyeIris'] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = localOptions.useDepth ? 'rgba(255, 200, 255, 0.3)' : localOptions.color;\n ctx.beginPath();\n const sizeX = Math.abs(f.annotations['rightEyeIris'][3][0] - f.annotations['rightEyeIris'][1][0]) / 2;\n const sizeY = Math.abs(f.annotations['rightEyeIris'][4][1] - f.annotations['rightEyeIris'][2][1]) / 2;\n ctx.ellipse(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1], sizeX, sizeY, 0, 0, 2 * Math.PI);\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.fillStyle = localOptions.useDepth ? 'rgba(255, 255, 200, 0.3)' : localOptions.color;\n ctx.fill();\n }\n }\n if (localOptions.drawGaze && f.rotation?.gaze?.strength && f.rotation?.gaze?.bearing && f.annotations['leftEyeIris'] && f.annotations['rightEyeIris'] && f.annotations['leftEyeIris'][0] && f.annotations['rightEyeIris'][0]) {\n ctx.strokeStyle = 'pink';\n ctx.beginPath();\n\n const leftGaze = [\n f.annotations['leftEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['leftEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['leftEyeIris'][0][0], f.annotations['leftEyeIris'][0][1]);\n ctx.lineTo(leftGaze[0], leftGaze[1]);\n\n const rightGaze = [\n f.annotations['rightEyeIris'][0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations['rightEyeIris'][0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n ctx.moveTo(f.annotations['rightEyeIris'][0][0], f.annotations['rightEyeIris'][0][1]);\n ctx.lineTo(rightGaze[0], rightGaze[1]);\n\n ctx.stroke();\n }\n }\n }\n }\n}\n\nexport async function body(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; i++) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n ctx.lineWidth = localOptions.lineWidth;\n ctx.font = localOptions.font;\n if (localOptions.drawBoxes && result[i].box && result[i].box?.length === 4) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n }\n if (localOptions.drawPoints && result[i].keypoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + (2 * (result[i].keypoints[pt].position[2] || 0))}, ${127.5 - (2 * (result[i].keypoints[pt].position[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels && result[i].keypoints) {\n ctx.font = localOptions.font;\n for (const pt of result[i].keypoints) {\n ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + (2 * pt.position[2])}, ${127.5 - (2 * pt.position[2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4);\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints && result[i].annotations) {\n for (const part of Object.values(result[i].annotations)) {\n for (const connected of part) curves(ctx, connected, localOptions);\n }\n }\n }\n}\n\nexport async function hand(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(`hand:${Math.trunc(100 * h.score)}%`, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]); // can use h.label\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(`hand:${Math.trunc(100 * h.score)}%`, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]); // can use h.label\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * (pt[2] || 0))}, ${127.5 - (2 * (pt[2] || 0))}, 255, 0.5)` : localOptions.color;\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels && h.annotations) {\n const addHandLabel = (part, title) => {\n if (!part || part.length === 0 || !part[0]) return;\n ctx.fillStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[part.length - 1][2])}, ${127.5 - (2 * part[part.length - 1][2])}, 255, 0.5)` : localOptions.color;\n ctx.fillText(title, part[part.length - 1][0] + 4, part[part.length - 1][1] + 4);\n };\n ctx.font = localOptions.font;\n addHandLabel(h.annotations['index'], 'index');\n addHandLabel(h.annotations['middle'], 'middle');\n addHandLabel(h.annotations['ring'], 'ring');\n addHandLabel(h.annotations['pinky'], 'pinky');\n addHandLabel(h.annotations['thumb'], 'thumb');\n addHandLabel(h.annotations['palm'], 'palm');\n }\n if (localOptions.drawPolygons && h.annotations) {\n const addHandLine = (part) => {\n if (!part || part.length === 0 || !part[0]) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n ctx.strokeStyle = localOptions.useDepth ? `rgba(${127.5 + (2 * part[i][2])}, ${127.5 - (2 * part[i][2])}, 255, 0.5)` : localOptions.color;\n ctx.moveTo(part[i > 0 ? i - 1 : 0][0], part[i > 0 ? i - 1 : 0][1]);\n ctx.lineTo(part[i][0], part[i][1]);\n ctx.stroke();\n }\n };\n ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations['index']);\n addHandLine(h.annotations['middle']);\n addHandLine(h.annotations['ring']);\n addHandLine(h.annotations['pinky']);\n addHandLine(h.annotations['thumb']);\n // addPart(h.annotations.palm);\n }\n }\n}\n\nexport async function object(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n for (const h of result) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `${h.label} ${Math.round(100 * h.score)}%`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, h.box[0] + 3, 1 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, h.box[0] + 2, 0 + h.box[1] + localOptions.lineHeight, h.box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function person(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array, drawOptions?: Partial) {\n const localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas);\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels) {\n const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, result[i].box[0] + 3, 1 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\nexport async function canvas(input: HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) {\n if (!input || !output) return;\n const ctx = getCanvasContext(output);\n ctx.drawImage(input, 0, 0);\n}\n\nexport async function all(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Result, drawOptions?: Partial) {\n if (!result || !result.performance || !result || !inCanvas) return null;\n const timestamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n const promise = Promise.all([\n face(inCanvas, result.face, localOptions),\n body(inCanvas, result.body, localOptions),\n hand(inCanvas, result.hand, localOptions),\n object(inCanvas, result.object, localOptions),\n gesture(inCanvas, result.gesture, localOptions), // gestures do not have buffering\n // person(inCanvas, result.persons, localOptions); // already included above\n ]);\n result.performance.draw = Math.trunc(now() - timestamp);\n return promise;\n}\n", "// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nconst rad2deg = (theta) => Math.round((theta * 180) / Math.PI);\n\nconst calculateGaze = (face): { bearing: number, strength: number } => {\n const radians = (pt1, pt2) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations['rightEyeIris'] || !face.annotations['leftEyeIris']) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = face.mesh[33][2] > face.mesh[263][2]; // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n\n const eyeDiff = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] ** 2) + (eyeDiff[1] ** 2)); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n\n return { bearing, strength };\n};\n\nexport const calculateFaceAngle = (face, imageSize): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v) => { // normalize vector\n const length = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] /= length;\n v[1] /= length;\n v[2] /= length;\n return v;\n };\n const subVectors = (a, b) => { // vector subtraction (a - b)\n const x = a[0] - b[0];\n const y = a[1] - b[1];\n const z = a[2] - b[2];\n return [x, y, z];\n };\n const crossVectors = (a, b) => { // vector cross product (a x b)\n const x = a[1] * b[2] - a[2] * b[1];\n const y = a[2] * b[0] - a[0] * b[2];\n const z = a[0] * b[1] - a[1] * b[0];\n return [x, y, z];\n };\n // 3x3 rotation matrix to Euler angles based on https://www.geometrictools.com/Documentation/EulerAngles.pdf\n const rotationMatrixToEulerAngle = (r) => {\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const [r00, r01, r02, r10, r11, r12, r20, r21, r22] = r;\n let thetaX: number;\n let thetaY: number;\n let thetaZ: number;\n if (r10 < 1) { // YZX calculation\n if (r10 > -1) {\n thetaZ = Math.asin(r10);\n thetaY = Math.atan2(-r20, r00);\n thetaX = Math.atan2(-r12, r11);\n } else {\n thetaZ = -Math.PI / 2;\n thetaY = -Math.atan2(r21, r22);\n thetaX = 0;\n }\n } else {\n thetaZ = Math.PI / 2;\n thetaY = Math.atan2(r21, r22);\n thetaX = 0;\n }\n if (isNaN(thetaX)) thetaX = 0;\n if (isNaN(thetaY)) thetaY = 0;\n if (isNaN(thetaZ)) thetaZ = 0;\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n // simple Euler angle calculation based existing 3D mesh\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const meshToEulerAngle = (mesh) => {\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n const angle = {\n // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\n // pitch is face move up/down\n pitch: radians(mesh[10][1], mesh[10][2], mesh[152][1], mesh[152][2]), // looking at y,z of top and bottom points of the face\n // yaw is face turn left/right\n yaw: radians(mesh[33][0], mesh[33][2], mesh[263][0], mesh[263][2]), // looking at x,z of outside corners of leftEye and rightEye\n // roll is face lean left/right\n roll: radians(mesh[33][0], mesh[33][1], mesh[263][0], mesh[263][1]), // looking at x,y of outside corners of leftEye and rightEye\n };\n return angle;\n };\n\n // initialize gaze and mesh\n const mesh = face.meshRaw;\n if (!mesh || mesh.length < 300) return { angle: { pitch: 0, yaw: 0, roll: 0 }, matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [\n // make the xyz coordinates proportional, independent of the image/box size\n pt[0] * imageSize[0] / size,\n pt[1] * imageSize[1] / size,\n pt[2],\n ]);\n\n const y_axis = normalize(subVectors(pts[1], pts[0]));\n let x_axis = normalize(subVectors(pts[3], pts[2]));\n const z_axis = normalize(crossVectors(x_axis, y_axis));\n // adjust x_axis to make sure that all axes are perpendicular to each other\n x_axis = crossVectors(y_axis, z_axis);\n\n // Rotation Matrix from Axis Vectors - http://renderdan.blogspot.com/2006/05/rotation-matrix-from-axis-vectors.html\n // 3x3 rotation matrix is flatten to array in row-major order. Note that the rotation represented by this matrix is inverted.\n const matrix: [number, number, number, number, number, number, number, number, number] = [\n x_axis[0], x_axis[1], x_axis[2],\n y_axis[0], y_axis[1], y_axis[2],\n z_axis[0], z_axis[1], z_axis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n", "/**\n * Face algorithm implementation\n * Uses FaceMesh, Emotion and FaceRes models to create a unified pipeline\n */\n\nimport { log, now } from '../util/util';\nimport * as tf from '../../dist/tfjs.esm.js';\nimport * as facemesh from './facemesh';\nimport * as emotion from '../gear/emotion';\nimport * as faceres from './faceres';\nimport type { FaceResult } from '../result';\nimport type { Tensor } from '../tfjs/types';\nimport { calculateFaceAngle } from './angles';\n\nexport const detectFace = async (parent /* instance of human */, input: Tensor): Promise => {\n // run facemesh, includes blazeface and iris\n // eslint-disable-next-line no-async-promise-executor\n let timeStamp;\n let ageRes;\n let gearRes;\n let genderRes;\n let emotionRes;\n let embeddingRes;\n let descRes;\n const faceRes: Array = [];\n parent.state = 'run:face';\n timeStamp = now();\n\n const faces = await facemesh.predict(input, parent.config);\n parent.performance.face = Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n parent.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefied\n if (!faces[i].tensor || faces[i].tensor['isDisposedInternal']) {\n log('Face object is disposed:', faces[i].tensor);\n continue;\n }\n\n const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Emotion:');\n if (parent.config.async) {\n emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:emotion';\n timeStamp = now();\n emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Emotion:');\n\n // run gear, inherits face from blazeface\n /*\n parent.analyze('Start GEAR:');\n if (parent.config.async) {\n gearRes = parent.config.face.agegenderrace.enabled ? agegenderrace.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n } else {\n parent.state = 'run:gear';\n timeStamp = now();\n gearRes = parent.config.face.agegenderrace.enabled ? await agegenderrace.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};\n parent.performance.emotion = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End GEAR:');\n */\n\n // run emotion, inherits face from blazeface\n parent.analyze('Start Description:');\n if (parent.config.async) {\n descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];\n } else {\n parent.state = 'run:description';\n timeStamp = now();\n descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];\n parent.performance.embedding = Math.trunc(now() - timeStamp);\n }\n parent.analyze('End Description:');\n\n // if async wait for results\n if (parent.config.async) {\n [ageRes, genderRes, emotionRes, embeddingRes, descRes, gearRes] = await Promise.all([ageRes, genderRes, emotionRes, embeddingRes, descRes, gearRes]);\n }\n\n parent.analyze('Finish Face:');\n\n // calculate iris distance\n // iris: array[ center, left, top, right, bottom]\n if (!parent.config.face.iris.enabled && faces[i]?.annotations?.leftEyeIris && faces[i]?.annotations?.rightEyeIris) {\n delete faces[i].annotations.leftEyeIris;\n delete faces[i].annotations.rightEyeIris;\n }\n const irisSize = (faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0]\n && (faces[i].annotations.leftEyeIris.length > 0) && (faces[i].annotations.rightEyeIris.length > 0)\n && (faces[i].annotations.leftEyeIris[0] !== null) && (faces[i].annotations.rightEyeIris[0] !== null))\n ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input.shape[2]\n : 0; // note: average human iris size is 11.7mm\n\n // optionally return tensor\n const tensor = parent.config.face.detector.return ? tf.squeeze(faces[i].tensor) : null;\n // dispose original face tensor\n tf.dispose(faces[i].tensor);\n // delete temp face image\n if (faces[i].tensor) delete faces[i].tensor;\n // combine results\n faceRes.push({\n ...faces[i],\n id: i,\n age: descRes.age,\n gender: descRes.gender,\n genderScore: descRes.genderScore,\n embedding: descRes.descriptor,\n emotion: emotionRes,\n iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,\n rotation,\n tensor,\n });\n parent.analyze('End Face');\n }\n parent.analyze('End FaceMesh:');\n if (parent.config.async) {\n if (parent.performance.face) delete parent.performance.face;\n if (parent.performance.age) delete parent.performance.age;\n if (parent.performance.gender) delete parent.performance.gender;\n if (parent.performance.emotion) delete parent.performance.emotion;\n }\n return faceRes;\n};\n", "/**\n * Gesture detection algorithm\n */\n\nimport type { GestureResult } from '../result';\nimport * as fingerPose from '../hand/fingerpose';\n\n/**\n * @typedef FaceGesture\n */\nexport type FaceGesture =\n `facing ${'left' | 'center' | 'right'}`\n | `blink ${'left' | 'right'} eye`\n | `mouth ${number}% open`\n | `head ${'up' | 'down'}`;\n\n/**\n * @typedef IrisGesture\n */\nexport type IrisGesture =\n 'facing center'\n | `looking ${'left' | 'right' | 'up' | 'down'}`\n | 'looking center';\n\n/**\n * @typedef BodyGesture\n */\nexport type BodyGesture =\n `leaning ${'left' | 'right'}`\n | `raise ${'left' | 'right'} hand`\n | 'i give up';\n\n/**\n * @typedef BodyGesture\n */\nexport type HandGesture =\n `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} forward`\n | `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} up`\n | 'victory'\n | 'thumbs up';\n\nexport const body = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ body: number, gesture: BodyGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n // raising hands\n const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));\n const rightWrist = res[i].keypoints.find((a) => (a.part === 'rightWrist'));\n const nose = res[i].keypoints.find((a) => (a.part === 'nose'));\n if (nose && leftWrist && rightWrist && (leftWrist.position.y < nose.position.y) && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position.y < nose.position.y)) gestures.push({ body: i, gesture: 'raise right hand' });\n\n // leaning\n const leftShoulder = res[i].keypoints.find((a) => (a.part === 'leftShoulder'));\n const rightShoulder = res[i].keypoints.find((a) => (a.part === 'rightShoulder'));\n if (leftShoulder && rightShoulder) gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position.y > rightShoulder.position.y) ? 'left' : 'right'}` });\n }\n return gestures;\n};\n\nexport const face = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ face: number, gesture: FaceGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 450) {\n const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];\n if (Math.abs(eyeFacing) < 10) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${eyeFacing < 0 ? 'left' : 'right'}` });\n const openLeft = Math.abs(res[i].mesh[374][1] - res[i].mesh[386][1]) / Math.abs(res[i].mesh[443][1] - res[i].mesh[450][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openLeft < 0.2) gestures.push({ face: i, gesture: 'blink left eye' });\n const openRight = Math.abs(res[i].mesh[145][1] - res[i].mesh[159][1]) / Math.abs(res[i].mesh[223][1] - res[i].mesh[230][1]); // center of eye inner lid y coord div center of wider eye border y coord\n if (openRight < 0.2) gestures.push({ face: i, gesture: 'blink right eye' });\n const mouthOpen = Math.min(100, 500 * Math.abs(res[i].mesh[13][1] - res[i].mesh[14][1]) / Math.abs(res[i].mesh[10][1] - res[i].mesh[152][1]));\n if (mouthOpen > 10) gestures.push({ face: i, gesture: `mouth ${Math.trunc(mouthOpen)}% open` });\n const chinDepth = res[i].mesh[152][2];\n if (Math.abs(chinDepth) > 10) gestures.push({ face: i, gesture: `head ${chinDepth < 0 ? 'up' : 'down'}` });\n }\n }\n return gestures;\n};\n\nexport const iris = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ iris: number, gesture: IrisGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.leftEyeIris[0] || !res[i].annotations.rightEyeIris || !res[i].annotations.rightEyeIris[0]) continue;\n const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];\n const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1];\n const areaLeft = Math.abs(sizeXLeft * sizeYLeft);\n\n const sizeXRight = res[i].annotations.rightEyeIris[3][0] - res[i].annotations.rightEyeIris[1][0];\n const sizeYRight = res[i].annotations.rightEyeIris[4][1] - res[i].annotations.rightEyeIris[2][1];\n const areaRight = Math.abs(sizeXRight * sizeYRight);\n\n let center = false;\n const difference = Math.abs(areaLeft - areaRight) / Math.max(areaLeft, areaRight);\n if (difference < 0.25) {\n center = true;\n gestures.push({ iris: i, gesture: 'facing center' });\n }\n\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n const leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking right' });\n if (rightIrisCenterX > 0.06) gestures.push({ iris: i, gesture: 'looking left' });\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) gestures.push({ iris: i, gesture: 'looking up' });\n\n // still center;\n if (center) gestures.push({ iris: i, gesture: 'looking center' });\n }\n return gestures;\n};\n\nexport const hand = (res): GestureResult[] => {\n if (!res) return [];\n const gestures: Array<{ hand: number, gesture: HandGesture }> = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: Array<{ name: string, position: number }> = [];\n if (res[i]['annotations']) {\n for (const [finger, pos] of Object.entries(res[i]['annotations'])) {\n if (finger !== 'palmBase' && Array.isArray(pos) && pos[0]) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward` as HandGesture });\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${highest.name} up` as HandGesture });\n }\n if (res[i]['keypoints']) {\n const poses = fingerPose.match(res[i]['keypoints']);\n for (const pose of poses) gestures.push({ hand: i, gesture: pose.name as HandGesture });\n }\n }\n return gestures;\n};\n", "/**\n * Results interpolation for smoothening of video detection results inbetween detected frames\n */\n\nimport type { Result, FaceResult, BodyResult, HandResult, ObjectResult, GestureResult, PersonResult, Box, Point } from '../result';\n\nconst bufferedResult: Result = { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n\nexport function calc(newResult: Result): Result {\n if (!newResult) return { face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0 };\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n // curve fitted: buffer = 8 - ln(delay)\n // interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n // - at 50ms delay buffer = ~4.1 => 28% towards live data\n // - at 250ms delay buffer = ~2.5 => 40% towards live data\n // - at 500ms delay buffer = ~1.8 => 55% towards live data\n // - at 750ms delay buffer = ~1.4 => 71% towards live data\n // - at 1sec delay buffer = 1 which means live data is used\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;\n\n bufferedResult.canvas = newResult.canvas;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body as BodyResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + b) / bufferedFactor) as Box;\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + b) / bufferedFactor) as Box;\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((keypoint, j) => ({\n score: keypoint.score,\n part: keypoint.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[0] + keypoint.position[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].position[1] + keypoint.position[1]) / bufferedFactor : keypoint.position[1],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[0] + keypoint.positionRaw[0]) / bufferedFactor : keypoint.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * bufferedResult.body[i].keypoints[j].positionRaw[1] + keypoint.positionRaw[1]) / bufferedFactor : keypoint.position[1],\n ],\n }))) as Array<{ score: number, part: string, position: [number, number, number?], positionRaw: [number, number, number?] }>;\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand as HandResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; // reset keypoints as previous frame did not have them\n const keypoints = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) as Point)\n : [];\n const annotations = {};\n if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) bufferedResult.hand[i].annotations = newResult.hand[i].annotations; // reset annotations as previous frame did not have them\n if (newResult.hand[i].annotations) {\n for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations\n annotations[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0]\n ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as HandResult['annotations'] }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face as FaceResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.bearing || 0) + (newResult.face[i].rotation?.gaze?.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze?.strength || 0) + (newResult.face[i].rotation?.gaze?.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as ObjectResult[])); // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n if (newResult.persons) {\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons as PersonResult[]));\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as Box;\n }\n }\n }\n\n // just copy latest gestures without interpolation\n if (newResult.gesture) bufferedResult.gesture = newResult.gesture as GestureResult[];\n if (newResult.performance) bufferedResult.performance = newResult.performance;\n\n return bufferedResult;\n}\n", "/** Defines Descriptor type */\nexport type Descriptor = Array\n\n/** Calculates distance between two descriptors\n * - Minkowski distance algorithm of nth order if `order` is different than 2\n * - Euclidean distance if `order` is 2 (default)\n *\n * Options:\n * - `order`\n *\n * Note: No checks are performed for performance reasons so make sure to pass valid number arrays of equal length\n */\nexport function distance(descriptor1: Descriptor, descriptor2: Descriptor, options = { order: 2 }) {\n // general minkowski distance, euclidean distance is limited case where order is 2\n let sum = 0;\n for (let i = 0; i < descriptor1.length; i++) {\n const diff = (options.order === 2) ? (descriptor1[i] - descriptor2[i]) : (Math.abs(descriptor1[i] - descriptor2[i]));\n sum += (options.order === 2) ? (diff * diff) : (diff ** options.order);\n }\n return sum;\n}\n\n/** Calculates normalized similarity between two descriptors based on their `distance`\n */\nexport function similarity(descriptor1: Descriptor, descriptor2: Descriptor, options = { order: 2 }) {\n const dist = distance(descriptor1, descriptor2, options);\n const invert = (options.order === 2) ? Math.sqrt(dist) : dist ** (1 / options.order);\n return Math.max(0, 100 - invert) / 100.0;\n}\n\n/** Matches given descriptor to a closest entry in array of descriptors\n * @param descriptor face descriptor\n * @param descriptors array of face descriptors to commpare given descriptor to\n *\n * Options:\n * - `order` see {@link distance} method\n * - `threshold` match will return result first result for which {@link distance} is below `threshold` even if there may be better results\n *\n * @returns object with index, distance and similarity\n * - `index` index array index where best match was found or -1 if no matches\n * - {@link distance} calculated `distance` of given descriptor to the best match\n * - {@link similarity} calculated normalized `similarity` of given descriptor to the best match\n*/\nexport function match(descriptor: Descriptor, descriptors: Array, options = { order: 2, threshold: 0 }) {\n if (!Array.isArray(descriptor) || !Array.isArray(descriptors) || descriptor.length < 64 || descriptors.length === 0 || descriptor.length !== descriptors[0].length) { // validate input\n return { index: -1, distance: Number.POSITIVE_INFINITY, similarity: 0 };\n }\n let best = Number.MAX_SAFE_INTEGER;\n let index = -1;\n for (let i = 0; i < descriptors.length; i++) {\n const res = distance(descriptor, descriptors[i], { order: options.order });\n if (res < best) {\n best = res;\n index = i;\n }\n if (best < options.threshold) break;\n }\n best = (options.order === 2) ? Math.sqrt(best) : best ** (1 / options.order);\n return { index, distance: best, similarity: Math.max(0, 100 - best) / 100.0 };\n}\n", "/**\n * Analyze detection Results and sort&combine them into per-person view\n */\n\nimport type { FaceResult, BodyResult, HandResult, GestureResult, PersonResult, Box } from '../result';\n\nexport function join(faces: Array, bodies: Array, hands: Array, gestures: Array, shape: Array | undefined): Array {\n let id = 0;\n const persons: Array = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: PersonResult = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures?.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures?.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.left?.id) person.gestures?.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands?.right?.id) person.gestures?.push(gesture);\n }\n\n // create new overarching box from all boxes beloning to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face?.box);\n extractXY(person.body?.box);\n extractXY(person.hands?.left?.box);\n extractXY(person.hands?.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape && shape[1] && shape[2]) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */\n\n// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob\nIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgo\n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MdpUZuKdN99nzvFqPbTVz7nD8OKs+do2/mW3h4D7Xaq\nZnPrtNpqz35aRaYOHY9Zk4pNt9rR+rl6zi+OnS+WN57Rv1lXp/YrNaYtruL6zNPnGO3hxP6O5w/2\nf0HDuun09Yv55Le9afznqcOvO4tBreMTHu30unnva0bWt8on+70nDuE4OHYYx4Kbesz3tPrMuhGO\nIjpDOKrK9YVpsyiGUQnYGOyUgI2SlAIEmwMWMs9kTAMJYzDOYRMArmGErZhhMArlHmzmGMwDE3Ts\nbAbs4swj5pgFkSziVcM4BZEsolXDKAZwyhjCYBkACQhIAAAAAAAJAAAAAAAAAAAAAAAAAAAShIAA\nAAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA\nBAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2\nSbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T\nlBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/\n2Q==`;\n", "/**\n * Warmup algorithm that uses embedded images to excercise loaded models for faster future inference\n */\n\nimport { log, now, mergeDeep } from './util/util';\nimport * as sample from './sample';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as image from './image/image';\nimport type { Config } from './config';\nimport type { Result } from './result';\nimport { env } from './util/env';\n\nasync function warmupBitmap(instance) {\n const b64toBlob = (base64: string, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob;\n let res;\n switch (instance.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'body':\n case 'full': blob = await b64toBlob(sample.body); break;\n default: blob = null;\n }\n if (blob) {\n const bitmap = await createImageBitmap(blob);\n res = await instance.detect(bitmap, instance.config);\n bitmap.close();\n }\n return res;\n}\n\nasync function warmupCanvas(instance) {\n return new Promise((resolve) => {\n let src;\n // let size = 0;\n switch (instance.config.warmup) {\n case 'face':\n // size = 256;\n src = 'data:image/jpeg;base64,' + sample.face;\n break;\n case 'full':\n case 'body':\n // size = 1200;\n src = 'data:image/jpeg;base64,' + sample.body;\n break;\n default:\n src = null;\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n let img;\n if (typeof Image !== 'undefined') img = new Image();\n // @ts-ignore env.image is an external monkey-patch\n else if (env.Image) img = new env.Image();\n img.onload = async () => {\n const canvas = image.canvas(img.naturalWidth, img.naturalHeight);\n if (!canvas) {\n log('Warmup: Canvas not found');\n resolve({});\n } else {\n const ctx = canvas.getContext('2d');\n if (ctx) ctx.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const tensor = await instance.image(canvas);\n const res = await instance.detect(tensor.tensor, instance.config);\n resolve(res);\n }\n };\n if (src) img.src = src;\n else resolve(null);\n });\n}\n\nasync function warmupNode(instance) {\n const atob = (str: string) => Buffer.from(str, 'base64');\n let img;\n if (instance.config.warmup === 'face') img = atob(sample.face);\n if (instance.config.warmup === 'body' || instance.config.warmup === 'full') img = atob(sample.body);\n if (!img) return null;\n let res;\n if (typeof tf['node'] !== 'undefined') {\n const data = tf['node'].decodeJpeg(img);\n const expanded = data.expandDims(0);\n instance.tf.dispose(data);\n // log('Input:', expanded);\n res = await instance.detect(expanded, instance.config);\n instance.tf.dispose(expanded);\n } else {\n if (instance.config.debug) log('Warmup tfjs-node not loaded');\n /*\n const input = await canvasJS.loadImage(img);\n const canvas = canvasJS.createCanvas(input.width, input.height);\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, input.width, input.height);\n res = await instance.detect(input, instance.config);\n */\n }\n return res;\n}\n\n/** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: Config\n*/\nexport async function warmup(instance, userConfig?: Partial): Promise {\n const t0 = now();\n instance.state = 'warmup';\n if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;\n if (!instance.config.warmup || instance.config.warmup === 'none') return { error: 'null' };\n let res;\n return new Promise(async (resolve) => {\n if (typeof createImageBitmap === 'function') res = await warmupBitmap(instance);\n else if (typeof Image !== 'undefined' || env.Canvas !== undefined) res = await warmupCanvas(instance);\n else res = await warmupNode(instance);\n const t1 = now();\n if (instance.config.debug) log('Warmup', instance.config.warmup, Math.round(t1 - t0), 'ms');\n instance.emit('warmup');\n resolve(res);\n });\n}\n", "/**\n * Human main module\n */\n\n// module imports\nimport { log, now, mergeDeep, validate } from './util/util';\nimport { defaults } from './config';\nimport * as tf from '../dist/tfjs.esm.js';\nimport * as app from '../package.json';\nimport * as backend from './tfjs/backend';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as draw from './util/draw';\nimport * as efficientpose from './body/efficientpose';\nimport * as env from './util/env';\nimport * as face from './face/face';\nimport * as facemesh from './face/facemesh';\nimport * as faceres from './face/faceres';\nimport * as gesture from './gesture/gesture';\nimport * as handpose from './handpose/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as humangl from './tfjs/humangl';\nimport * as image from './image/image';\nimport * as interpolate from './util/interpolate';\nimport * as match from './face/match';\nimport * as models from './models';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as persons from './util/persons';\nimport * as posenet from './body/posenet';\nimport * as segmentation from './segmentation/segmentation';\nimport * as warmups from './warmup';\n\n// type definitions\nimport type { Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, PersonResult } from './result';\nimport type { Tensor } from './tfjs/types';\nimport type { DrawOptions } from './util/draw';\nimport type { Input } from './image/image';\nimport type { Config } from './config';\n\n/** Defines configuration options used by all **Human** methods */\nexport * from './config';\n\n/** Defines result types returned by all **Human** methods */\nexport * from './result';\n\n/** Defines DrawOptions used by `human.draw.*` methods */\nexport type { DrawOptions } from './util/draw';\nexport { env, Env } from './util/env';\n\n/** Face descriptor type as number array */\nexport type { Descriptor } from './face/match';\n\n/** Box and Point primitives */\nexport { Box, Point } from './result';\n\n/** Defines all possible models used by **Human** library */\nexport { Models } from './models';\n\n/** Defines all possible input types for **Human** detection */\nexport { Input } from './image/image';\n\n/** Events dispatched by `human.events`\n *\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n */\nexport type Events = 'create' | 'load' | 'image' | 'result' | 'warmup' | 'error';\n\n/** Error message\n * @typedef Error Type\n */\nexport type Error = { error: string };\n\n/** Instance of TensorFlow/JS\n * @external\n */\nexport type TensorFlow = typeof tf;\n\n/** **Human** library main class\n *\n * All methods and properties are available only as members of Human class\n *\n * - Configuration object definition: {@link Config}\n * - Results object definition: {@link Result}\n * - Possible inputs: {@link Input}\n *\n * @param userConfig: {@link Config}\n * @return instance\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n\n /** Current configuration\n * - Definition: {@link Config}\n * - Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L292)\n */\n config: Config;\n\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n * - Definition: {@link Result}\n */\n result: Result;\n\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n\n /** currenty processed image tensor and canvas */\n process: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };\n\n /** Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n * @internal\n *\n * [TFJS API]\n */\n tf: TensorFlow;\n\n /** Object containing environment information used for diagnostics */\n env: env.Env;\n\n /** Draw helper classes that can draw detected objects on canvas using specified draw\n * - options: {@link DrawOptions} global settings for all draw operations, can be overriden for each draw method\n * - face: draw detected faces\n * - body: draw detected people and body parts\n * - hand: draw detected hands and hand parts\n * - canvas: draw processed canvas which is a processed copy of the input\n * - all: meta-function that performs: canvas, face, body, hand\n */\n draw: { canvas, face, body, hand, gesture, object, person, all, options: DrawOptions };\n\n /** Currently loaded models\n * @internal\n * {@link Models}\n */\n models: models.Models;\n\n /** Container for events dispatched by Human\n *\n * Possible events:\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n * - `error`: triggered on some errors\n */\n events: EventTarget | undefined;\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: typeof facemesh.triangulation;\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: typeof facemesh.uvmap;\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n /** WebGL debug info */\n gl: Record;\n // definition end\n\n /** Constructor for **Human** library that is futher used for all operations\n *\n * @param userConfig: {@link Config}\n *\n * @return instance: {@link Human}\n */\n constructor(userConfig?: Partial) {\n env.get();\n this.env = env.env;\n defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`;\n defaults.modelBasePath = this.env.browser ? '../models/' : 'file://models/';\n defaults.backend = this.env.browser ? 'humangl' : 'tensorflow';\n this.version = app.version; // expose version property on instance of class\n Object.defineProperty(this, 'version', { value: app.version }); // expose version property directly on class itself\n this.config = JSON.parse(JSON.stringify(defaults));\n Object.seal(this.config);\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n this.tf = tf;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.performance = { backend: 0, load: 0, image: 0, frames: 0, cached: 0, changed: 0, total: 0, draw: 0 };\n this.events = (typeof EventTarget !== 'undefined') ? new EventTarget() : undefined;\n // object that contains all initialized models\n this.models = new models.Models();\n // reexport draw methods\n this.draw = {\n options: draw.options as DrawOptions,\n canvas: (input: HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | HTMLMediaElement | HTMLVideoElement, output: HTMLCanvasElement) => draw.canvas(input, output),\n face: (output: HTMLCanvasElement | OffscreenCanvas, result: FaceResult[], options?: Partial) => draw.face(output, result, options),\n body: (output: HTMLCanvasElement | OffscreenCanvas, result: BodyResult[], options?: Partial) => draw.body(output, result, options),\n hand: (output: HTMLCanvasElement | OffscreenCanvas, result: HandResult[], options?: Partial) => draw.hand(output, result, options),\n gesture: (output: HTMLCanvasElement | OffscreenCanvas, result: GestureResult[], options?: Partial) => draw.gesture(output, result, options),\n object: (output: HTMLCanvasElement | OffscreenCanvas, result: ObjectResult[], options?: Partial) => draw.object(output, result, options),\n person: (output: HTMLCanvasElement | OffscreenCanvas, result: PersonResult[], options?: Partial) => draw.person(output, result, options),\n all: (output: HTMLCanvasElement | OffscreenCanvas, result: Result, options?: Partial) => draw.all(output, result, options),\n };\n this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] };\n // export access to image processing\n // @ts-ignore eslint-typescript cannot correctly infer type in anonymous function\n this.process = { tensor: null, canvas: null };\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // set gl info\n this.gl = humangl.config;\n // include platform info\n this.emit('create');\n }\n\n // helper function: measure tensor leak\n /** @hidden */\n analyze = (...msg: string[]) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n }\n\n // quick sanity check on inputs\n /** @hidden */\n #sanity = (input: Input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.env.node && !(input instanceof tf.Tensor)) return 'input must be a tensor';\n try {\n this.tf.getBackend();\n } catch {\n return 'backend not loaded';\n }\n return null;\n }\n\n /** Reset configuration to default values */\n reset(): void {\n const currentBackend = this.config.backend; // save backend;\n this.config = JSON.parse(JSON.stringify(defaults));\n this.config.backend = currentBackend;\n }\n\n /** Validate current configuration schema */\n public validate(userConfig?: Partial) {\n return validate(defaults, userConfig || this.config);\n }\n\n /** Exports face matching methods */\n public similarity = match.similarity;\n public distance = match.distance;\n public match = match.match;\n\n /** Process input as return canvas and tensor\n *\n * @param input: {@link Input}\n * @returns { tensor, canvas }\n */\n image(input: Input) {\n return image.process(input, this.config);\n }\n\n /** Segmentation method takes any input and returns processed canvas with body segmentation\n * - Optional parameter background is used to fill the background with specific input\n * - Segmentation is not triggered as part of detect process\n *\n * Returns:\n * - `data` as raw data array with per-pixel segmentation values\n * - `canvas` as canvas which is input image filtered with segementation data and optionally merged with background image. canvas alpha values are set to segmentation values for easy merging\n * - `alpha` as grayscale canvas that represents segmentation alpha values\n *\n * @param input: {@link Input}\n * @param background?: {@link Input}\n * @returns { data, canvas, alpha }\n */\n async segmentation(input: Input, background?: Input): Promise<{ data: number[], canvas: HTMLCanvasElement | OffscreenCanvas | null, alpha: HTMLCanvasElement | OffscreenCanvas | null }> {\n return segmentation.process(input, background, this.config);\n }\n\n /** Enhance method performs additional enhacements to face image previously detected for futher processing\n *\n * @param input: Tensor as provided in human.result.face[n].tensor\n * @returns Tensor\n */\n // eslint-disable-next-line class-methods-use-this\n enhance(input: Tensor): Tensor | null {\n return faceres.enhance(input);\n }\n\n /** Explicit backend initialization\n * - Normally done implicitly during initial load phase\n * - Call to explictly register and initialize TFJS backend without any other operations\n * - Use when changing backend during runtime\n *\n * @return Promise\n */\n async init(): Promise {\n await backend.check(this, true);\n await this.tf.ready();\n env.set(this.env);\n }\n\n /** Load method preloads all configured models on-demand\n * - Not explicitly required as any required model is load implicitly on it's first run\n *\n * @param userConfig?: {@link Config}\n * @return Promise\n */\n async load(userConfig?: Partial): Promise {\n this.state = 'load';\n const timeStamp = now();\n const count = Object.values(this.models).filter((model) => model).length;\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n\n if (env.env.initial) { // print version info on first run and check for correct backend setup\n if (this.config.debug) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version_core}`);\n if (!await backend.check(this)) log('error: backend check failed');\n await tf.ready();\n if (this.env.browser) {\n if (this.config.debug) log('configuration:', this.config);\n if (this.config.debug) log('tf flags:', this.tf.ENV.flags);\n }\n }\n\n await models.load(this); // actually loads models\n if (env.env.initial && this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors'); // print memory stats on first run\n env.env.initial = false;\n\n const loaded = Object.values(this.models).filter((model) => model).length;\n if (loaded !== count) { // number of loaded models changed\n await models.validate(this); // validate kernel ops used by model against current backend\n this.emit('load');\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.load as number || 0)) this.performance.load = current;\n }\n\n // emit event\n /** @hidden */\n emit = (event: string) => {\n if (this.events && this.events.dispatchEvent) this.events?.dispatchEvent(new Event(event));\n }\n\n /** Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result?: {@link Result} optional use specific result set to run interpolation on\n * @returns result: {@link Result}\n */\n next(result: Result = this.result): Result {\n return interpolate.calc(result) as Result;\n }\n\n /** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async warmup(userConfig?: Partial): Promise {\n return warmups.warmup(this, userConfig) as Promise;\n }\n\n /** Main detection method\n * - Analyze configuration: {@link Config}\n * - Pre-process input: {@link Input}\n * - Run inference for all configured models\n * - Process and return result: {@link Result}\n *\n * @param input: {@link Input}\n * @param userConfig?: {@link Config}\n * @returns result: {@link Result}\n */\n async detect(input: Input, userConfig?: Partial): Promise {\n // detection happens inside a promise\n this.state = 'detect';\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n let elapsedTime;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n resolve({ error });\n }\n\n const timeStart = now();\n\n // configure backend if needed\n await backend.check(this);\n\n // load models if enabled\n await this.load();\n\n timeStamp = now();\n this.state = 'image';\n const img = image.process(input, this.config) as { canvas: HTMLCanvasElement | OffscreenCanvas, tensor: Tensor };\n this.process = img;\n this.performance.image = Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n if (!img.tensor) {\n if (this.config.debug) log('could not convert input to tensor');\n resolve({ error: 'could not convert input to tensor' });\n return;\n }\n this.emit('image');\n\n timeStamp = now();\n this.config.skipFrame = await image.skip(this.config, img.tensor);\n if (!this.performance.frames) this.performance.frames = 0;\n if (!this.performance.cached) this.performance.cached = 0;\n (this.performance.frames as number)++;\n if (this.config.skipFrame) this.performance.cached++;\n this.performance.changed = Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes: FaceResult[] | Promise | never[] = [];\n let bodyRes: BodyResult[] | Promise | never[] = [];\n let handRes: HandResult[] | Promise | never[] = [];\n let objectRes: ObjectResult[] | Promise | never[] = [];\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n this.state = 'detect:face';\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, img.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, img.tensor) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.face = elapsedTime;\n }\n\n if (this.config.async && (this.config.body.maxDetected === -1 || this.config.hand.maxDetected === -1)) faceRes = await faceRes; // need face result for auto-detect number of hands or bodies\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n this.state = 'detect:body';\n const bodyConfig = this.config.body.maxDetected === -1 ? mergeDeep(this.config, { body: { maxDetected: this.config.face.enabled ? 1 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of bodies\n if (this.config.async) {\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(img.tensor, bodyConfig) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n timeStamp = now();\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(img.tensor, bodyConfig) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.body = elapsedTime;\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n this.state = 'detect:hand';\n const handConfig = this.config.hand.maxDetected === -1 ? mergeDeep(this.config, { hand: { maxDetected: this.config.face.enabled ? 2 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of hands\n if (this.config.async) {\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? handtrack.predict(img.tensor, handConfig) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n timeStamp = now();\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? await handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? await handtrack.predict(img.tensor, handConfig) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.hand = elapsedTime;\n }\n this.analyze('End Hand:');\n\n // run nanodet\n this.analyze('Start Object:');\n this.state = 'detect:object';\n if (this.config.async) {\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(img.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n timeStamp = now();\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(img.tensor, this.config) : [];\n elapsedTime = Math.trunc(now() - timeStamp);\n if (elapsedTime > 0) this.performance.object = elapsedTime;\n }\n this.analyze('End Object:');\n\n // if async wait for results\n this.state = 'detect:await';\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n this.state = 'detect:gesture';\n let gestureRes: GestureResult[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes), ...gesture.body(bodyRes), ...gesture.hand(handRes), ...gesture.iris(faceRes)];\n if (!this.config.async) this.performance.gesture = Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n this.performance.total = Math.trunc(now() - timeStart);\n const shape = this.process?.tensor?.shape || [];\n this.result = {\n face: faceRes as FaceResult[],\n body: bodyRes as BodyResult[],\n hand: handRes as HandResult[],\n gesture: gestureRes,\n object: objectRes as ObjectResult[],\n performance: this.performance,\n canvas: this.process.canvas,\n timestamp: Date.now(),\n get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(img.tensor);\n\n // log('Result:', result);\n this.emit('detect');\n this.state = 'idle';\n resolve(this.result);\n });\n }\n}\n\n/** Class Human as default export */\nexport { Human as default };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,cAAc,QAAgB,MAAsB;AACzD,QAAM,YAAY,OAAO,SAAS,OAAO,KAAK;AAC9C,QAAM,WAAW,KAAK,WAAW,QAAQ,KAAK,WAAW,QAAQ,KAAK,WAAW,YAAY,KAAK,WAAW,aAAa,KAAK,WAAW;AAC1I,QAAM,OAAO,WAAW,GAAG,SAAS,GAAG,SAAS,YAAY;AAC5D,MAAI,CAAC,KAAK,oBAAoB,SAAS;AAAU,UAAM,IAAI,MAAM,oBAAoB;AACrF,SAAO;AAAA;AAIF,gBAAgB,KAAW;AAChC,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,GAAG,GAAG,WAAW,WAAW,SAAS,GAAG,QAAQ,GAAG,aAAa,WAAW,SAAS,GAAG,QAAQ,GAAG,aAAa,WAAW,SAAS,GAAG,QAAQ,GAAG,kBAAkB,WAAW,SAAS,GAAG;AAErM,MAAI;AAAK,YAAQ,IAAI,IAAI,UAAU,GAAG;AAAA;AAIjC,IAAM,MAAM,MAAM;AACvB,MAAI,OAAO,gBAAgB;AAAa,WAAO,YAAY;AAC3D,SAAO,SAAU,QAAO,QAAQ,OAAO,YAAY,MAAO,KAAM;AAAA;AAI3D,kBAAkB,UAAU,SAAQ,SAAS,UAAU,OAAoE,IAAI;AACpI,aAAW,OAAO,OAAO,KAAK,UAAS;AACrC,QAAI,OAAO,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AA,QAClB,QAAQ,KAAK,QAAQ;AAAA,QACrB,WAAW,KAAK;AAAA,YACZ,UAAU;AAAE,iBAAO,AAAQ,MAAK,SAAyB,SAAyB,SAAyB,YAAY;AAAA;AAAA;AAI7H,MAAG,yBAAQ,IAAI;AAGf,WAAK,KAAK;AACV,WAAK,QAAQ;AACb,cAAQ,KAAK;AAAA;AAAA;AAAA;AA7XjB;AACA;AACA;AAqEA;", "names": [] } diff --git a/dist/human.esm.js b/dist/human.esm.js index a3505f60..03cd64ba 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -4,7 +4,12 @@ author: ' */ +var __create = Object.create; var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { @@ -14,10 +19,24 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require return require.apply(this, arguments); throw new Error('Dynamic require of "' + x + '" is not supported'); }); -var __export = (target, all6) => { +var __commonJS = (cb, mod7) => function __require3() { + return mod7 || (0, cb[Object.keys(cb)[0]])((mod7 = { exports: {} }).exports, mod7), mod7.exports; +}; +var __export = (target, all9) => { __markAsModule(target); - for (var name in all6) - __defProp(target, name, { get: all6[name], enumerable: true }); + for (var name in all9) + __defProp(target, name, { get: all9[name], enumerable: true }); +}; +var __reExport = (target, module, desc) => { + if (module && typeof module === "object" || typeof module === "function") { + for (let key of __getOwnPropNames(module)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module) => { + return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module); }; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); @@ -42,6 +61,2154 @@ var __privateSet = (obj, member, value, setter) => { return value; }; +// node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js +var require_long2 = __commonJS({ + "node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js"(exports, module) { + module.exports = Long3; + var wasm = null; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ + 0, + 97, + 115, + 109, + 1, + 0, + 0, + 0, + 1, + 13, + 2, + 96, + 0, + 1, + 127, + 96, + 4, + 127, + 127, + 127, + 127, + 1, + 127, + 3, + 7, + 6, + 0, + 1, + 1, + 1, + 1, + 1, + 6, + 6, + 1, + 127, + 1, + 65, + 0, + 11, + 7, + 50, + 6, + 3, + 109, + 117, + 108, + 0, + 1, + 5, + 100, + 105, + 118, + 95, + 115, + 0, + 2, + 5, + 100, + 105, + 118, + 95, + 117, + 0, + 3, + 5, + 114, + 101, + 109, + 95, + 115, + 0, + 4, + 5, + 114, + 101, + 109, + 95, + 117, + 0, + 5, + 8, + 103, + 101, + 116, + 95, + 104, + 105, + 103, + 104, + 0, + 0, + 10, + 191, + 1, + 6, + 4, + 0, + 35, + 0, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 126, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 127, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 128, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 129, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 130, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11 + ])), {}).exports; + } catch (e) { + } + function Long3(low, high, unsigned) { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Long3.prototype.__isLong__; + Object.defineProperty(Long3.prototype, "__isLong__", { value: true }); + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + Long3.isLong = isLong; + var INT_CACHE = {}; + var UINT_CACHE = {}; + function fromInt(value, unsigned) { + var obj, cachedObj, cache3; + if (unsigned) { + value >>>= 0; + if (cache3 = 0 <= value && value < 256) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache3) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache3 = -128 <= value && value < 128) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache3) + INT_CACHE[value] = obj; + return obj; + } + } + Long3.fromInt = fromInt; + function fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); + } + Long3.fromNumber = fromNumber; + function fromBits(lowBits, highBits, unsigned) { + return new Long3(lowBits, highBits, unsigned); + } + Long3.fromBits = fromBits; + var pow_dbl = Math.pow; + function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error("empty string"); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === "number") { + radix = unsigned, unsigned = false; + } else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError("radix"); + var p3; + if ((p3 = str.indexOf("-")) > 0) + throw Error("interior hyphen"); + else if (p3 === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size2 = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size2), radix); + if (size2 < 8) { + var power = fromNumber(pow_dbl(radix, size2)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + Long3.fromString = fromString; + function fromValue(val, unsigned) { + if (typeof val === "number") + return fromNumber(val, unsigned); + if (typeof val === "string") + return fromString(val, unsigned); + return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); + } + Long3.fromValue = fromValue; + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + var ZERO = fromInt(0); + Long3.ZERO = ZERO; + var UZERO = fromInt(0, true); + Long3.UZERO = UZERO; + var ONE = fromInt(1); + Long3.ONE = ONE; + var UONE = fromInt(1, true); + Long3.UONE = UONE; + var NEG_ONE = fromInt(-1); + Long3.NEG_ONE = NEG_ONE; + var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); + Long3.MAX_VALUE = MAX_VALUE; + var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); + Long3.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + var MIN_VALUE = fromBits(0, 2147483648 | 0, false); + Long3.MIN_VALUE = MIN_VALUE; + var LongPrototype = Long3.prototype; + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError("radix"); + if (this.isZero()) + return "0"; + if (this.isNegative()) { + if (this.eq(MIN_VALUE)) { + var radixLong = fromNumber(radix), div5 = this.div(radixLong), rem1 = div5.mul(radixLong).sub(this); + return div5.toString(radix) + rem1.toInt().toString(radix); + } else + return "-" + this.neg().toString(radix); + } + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = "0" + digits; + result = "" + digits + result; + } + } + }; + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & 1 << bit) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + LongPrototype.eqz = LongPrototype.isZero; + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + LongPrototype.isEven = function isEven3() { + return (this.low & 1) === 0; + }; + LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + LongPrototype.eq = LongPrototype.equals; + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(other); + }; + LongPrototype.neq = LongPrototype.notEquals; + LongPrototype.ne = LongPrototype.notEquals; + LongPrototype.lessThan = function lessThan(other) { + return this.comp(other) < 0; + }; + LongPrototype.lt = LongPrototype.lessThan; + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(other) <= 0; + }; + LongPrototype.lte = LongPrototype.lessThanOrEqual; + LongPrototype.le = LongPrototype.lessThanOrEqual; + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(other) > 0; + }; + LongPrototype.gt = LongPrototype.greaterThan; + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(other) >= 0; + }; + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + LongPrototype.ge = LongPrototype.greaterThanOrEqual; + LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; + }; + LongPrototype.comp = LongPrototype.compare; + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); + }; + LongPrototype.neg = LongPrototype.negate; + LongPrototype.add = function add8(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + var a48 = this.high >>> 16; + var a322 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = addend.high >>> 16; + var b32 = addend.high & 65535; + var b16 = addend.low >>> 16; + var b00 = addend.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a322 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + LongPrototype.sub = LongPrototype.subtract; + LongPrototype.multiply = function multiply6(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + var a48 = this.high >>> 16; + var a322 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 65535; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a322 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a322 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.mul = LongPrototype.multiply; + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) + return UONE; + res = UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + var log22 = Math.ceil(Math.log(approx) / Math.LN2), delta = log22 <= 48 ? 1 : pow_dbl(2, log22 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + LongPrototype.div = LongPrototype.divide; + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + LongPrototype.mod = LongPrototype.modulo; + LongPrototype.rem = LongPrototype.modulo; + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); + else + return fromBits(0, this.low << numBits - 32, this.unsigned); + }; + LongPrototype.shl = LongPrototype.shiftLeft; + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); + }; + LongPrototype.shr = LongPrototype.shiftRight; + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned); + } else if (numBits === 32) + return fromBits(high, 0, this.unsigned); + else + return fromBits(high >>> numBits - 32, 0, this.unsigned); + } + }; + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); + }; + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); + }; + LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; + }; + LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; + }; + Long3.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long3.fromBytesLE(bytes, unsigned) : Long3.fromBytesBE(bytes, unsigned); + }; + Long3.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long3(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); + }; + Long3.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long3(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); + }; + } +}); + +// (disabled):node_modules/.pnpm/node-fetch@2.6.5/node_modules/node-fetch/browser.js +var require_browser2 = __commonJS({ + "(disabled):node_modules/.pnpm/node-fetch@2.6.5/node_modules/node-fetch/browser.js"() { + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js +var require_alea3 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js"(exports, module) { + (function(global2, module2, define2) { + function Alea(seed) { + var me = this, mash = Mash(); + me.next = function() { + var t = 2091639 * me.s0 + me.c * 23283064365386963e-26; + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + me.c = 1; + me.s0 = mash(" "); + me.s1 = mash(" "); + me.s2 = mash(" "); + me.s0 -= mash(seed); + if (me.s0 < 0) { + me.s0 += 1; + } + me.s1 -= mash(seed); + if (me.s1 < 0) { + me.s1 += 1; + } + me.s2 -= mash(seed); + if (me.s2 < 0) { + me.s2 += 1; + } + mash = null; + } + function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; + } + function impl(seed, opts) { + var xg = new Alea(seed), state = opts && opts.state, prng = xg.next; + prng.int32 = function() { + return xg.next() * 4294967296 | 0; + }; + prng.double = function() { + return prng() + (prng() * 2097152 | 0) * 11102230246251565e-32; + }; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + function Mash() { + var n = 4022871197; + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 4294967296; + } + return (n >>> 0) * 23283064365386963e-26; + }; + return mash; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.alea = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js +var require_xor1283 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.next = function() { + var t = me.x ^ me.x << 11; + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= me.w >>> 19 ^ t ^ t >>> 8; + }; + if (seed === (seed | 0)) { + me.x = seed; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; + } + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xor128 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js +var require_xorwow3 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.next = function() { + var t = me.x ^ me.x >>> 2; + me.x = me.y; + me.y = me.z; + me.z = me.w; + me.w = me.v; + return (me.d = me.d + 362437 | 0) + (me.v = me.v ^ me.v << 4 ^ (t ^ t << 1)) | 0; + }; + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + if (seed === (seed | 0)) { + me.x = seed; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } + } + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; + } + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xorwow = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js +var require_xorshift73 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this; + me.next = function() { + var X = me.x, i = me.i, t, v, w; + t = X[i]; + t ^= t >>> 7; + v = t ^ t << 24; + t = X[i + 1 & 7]; + v ^= t ^ t >>> 10; + t = X[i + 3 & 7]; + v ^= t ^ t >>> 3; + t = X[i + 4 & 7]; + v ^= t ^ t << 7; + t = X[i + 7 & 7]; + t = t ^ t << 13; + v ^= t ^ t << 9; + X[i] = v; + me.i = i + 1 & 7; + return v; + }; + function init2(me2, seed2) { + var j, w, X = []; + if (seed2 === (seed2 | 0)) { + w = X[0] = seed2; + } else { + seed2 = "" + seed2; + for (j = 0; j < seed2.length; ++j) { + X[j & 7] = X[j & 7] << 15 ^ seed2.charCodeAt(j) + X[j + 1 & 7] << 13; + } + } + while (X.length < 8) + X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j) + ; + if (j == 8) + w = X[7] = -1; + else + w = X[j]; + me2.x = X; + me2.i = 0; + for (j = 256; j > 0; --j) { + me2.next(); + } + } + init2(me, seed); + } + function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; + } + function impl(seed, opts) { + if (seed == null) + seed = +new Date(); + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xorshift7 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js +var require_xor40963 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this; + me.next = function() { + var w = me.w, X = me.X, i = me.i, t, v; + me.w = w = w + 1640531527 | 0; + v = X[i + 34 & 127]; + t = X[i = i + 1 & 127]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + v = X[i] = v ^ t; + me.i = i; + return v + (w ^ w >>> 16) | 0; + }; + function init2(me2, seed2) { + var t, v, i, j, w, X = [], limit = 128; + if (seed2 === (seed2 | 0)) { + v = seed2; + seed2 = null; + } else { + seed2 = seed2 + "\0"; + v = 0; + limit = Math.max(limit, seed2.length); + } + for (i = 0, j = -32; j < limit; ++j) { + if (seed2) + v ^= seed2.charCodeAt((j + 32) % seed2.length); + if (j === 0) + w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = w + 1640531527 | 0; + t = X[j & 127] ^= v + w; + i = t == 0 ? i + 1 : 0; + } + } + if (i >= 128) { + X[(seed2 && seed2.length || 0) & 127] = -1; + } + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[i + 34 & 127]; + t = X[i = i + 1 & 127]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + me2.w = w; + me2.X = X; + me2.i = i; + } + init2(me, seed); + } + function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; + } + ; + function impl(seed, opts) { + if (seed == null) + seed = +new Date(); + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xor4096 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js +var require_tychei3 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = b << 25 ^ b >>> 7 ^ c; + c = c - d | 0; + d = d << 24 ^ d >>> 8 ^ a; + a = a - b | 0; + me.b = b = b << 20 ^ b >>> 12 ^ c; + me.c = c = c - d | 0; + me.d = d << 16 ^ c >>> 16 ^ a; + return me.a = a - b | 0; + }; + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + if (seed === Math.floor(seed)) { + me.a = seed / 4294967296 | 0; + me.b = seed | 0; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; + } + ; + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.tychei = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// (disabled):crypto +var require_crypto2 = __commonJS({ + "(disabled):crypto"() { + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js +var require_seedrandom5 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js"(exports, module) { + (function(pool5, math) { + var global2 = this, width = 256, chunks = 6, digits = 52, rngname = "random", startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; + function seedrandom9(seed, options3, callback) { + var key = []; + options3 = options3 == true ? { entropy: true } : options3 || {}; + var shortseed = mixkey(flatten6(options3.entropy ? [seed, tostring(pool5)] : seed == null ? autoseed() : seed, 3), key); + var arc4 = new ARC4(key); + var prng = function() { + var n = arc4.g(chunks), d = startdenom, x = 0; + while (n < significance) { + n = (n + x) * width; + d *= width; + x = arc4.g(1); + } + while (n >= overflow) { + n /= 2; + d /= 2; + x >>>= 1; + } + return (n + x) / d; + }; + prng.int32 = function() { + return arc4.g(4) | 0; + }; + prng.quick = function() { + return arc4.g(4) / 4294967296; + }; + prng.double = prng; + mixkey(tostring(arc4.S), pool5); + return (options3.pass || callback || function(prng2, seed2, is_math_call, state) { + if (state) { + if (state.S) { + copy(state, arc4); + } + prng2.state = function() { + return copy(arc4, {}); + }; + } + if (is_math_call) { + math[rngname] = prng2; + return seed2; + } else + return prng2; + })(prng, shortseed, "global" in options3 ? options3.global : this == math, options3.state); + } + math["seed" + rngname] = seedrandom9; + function ARC4(key) { + var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + if (!keylen) { + key = [keylen++]; + } + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])]; + s[j] = t; + } + (me.g = function(count4) { + var t2, r = 0, i2 = me.i, j2 = me.j, s2 = me.S; + while (count4--) { + t2 = s2[i2 = mask & i2 + 1]; + r = r * width + s2[mask & (s2[i2] = s2[j2 = mask & j2 + t2]) + (s2[j2] = t2)]; + } + me.i = i2; + me.j = j2; + return r; + })(width); + } + function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; + } + ; + function flatten6(obj, depth) { + var result = [], typ = typeof obj, prop; + if (depth && typ == "object") { + for (prop in obj) { + try { + result.push(flatten6(obj[prop], depth - 1)); + } catch (e) { + } + } + } + return result.length ? result : typ == "string" ? obj : obj + "\0"; + } + function mixkey(seed, key) { + var stringseed = seed + "", smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++); + } + return tostring(key); + } + function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + out = out(width); + } else { + out = new Uint8Array(width); + (global2.crypto || global2.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global2.navigator, plugins = browser && browser.plugins; + return [+new Date(), global2, plugins, global2.screen, tostring(pool5)]; + } + } + function tostring(a) { + return String.fromCharCode.apply(0, a); + } + mixkey(math.random(), pool5); + if (typeof module == "object" && module.exports) { + module.exports = seedrandom9; + try { + nodecrypto = require_crypto2(); + } catch (ex) { + } + } else if (typeof define == "function" && define.amd) { + define(function() { + return seedrandom9; + }); + } + })([], Math); + } +}); + +// node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js +var require_seedrandom6 = __commonJS({ + "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js"(exports, module) { + var alea5 = require_alea3(); + var xor128 = require_xor1283(); + var xorwow = require_xorwow3(); + var xorshift7 = require_xorshift73(); + var xor4096 = require_xor40963(); + var tychei = require_tychei3(); + var sr = require_seedrandom5(); + sr.alea = alea5; + sr.xor128 = xor128; + sr.xorwow = xorwow; + sr.xorshift7 = xorshift7; + sr.xor4096 = xor4096; + sr.tychei = tychei; + module.exports = sr; + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js +var require_alea4 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js"(exports, module) { + (function(global2, module2, define2) { + function Alea(seed) { + var me = this, mash = Mash(); + me.next = function() { + var t = 2091639 * me.s0 + me.c * 23283064365386963e-26; + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + me.c = 1; + me.s0 = mash(" "); + me.s1 = mash(" "); + me.s2 = mash(" "); + me.s0 -= mash(seed); + if (me.s0 < 0) { + me.s0 += 1; + } + me.s1 -= mash(seed); + if (me.s1 < 0) { + me.s1 += 1; + } + me.s2 -= mash(seed); + if (me.s2 < 0) { + me.s2 += 1; + } + mash = null; + } + function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; + } + function impl(seed, opts) { + var xg = new Alea(seed), state = opts && opts.state, prng = xg.next; + prng.int32 = function() { + return xg.next() * 4294967296 | 0; + }; + prng.double = function() { + return prng() + (prng() * 2097152 | 0) * 11102230246251565e-32; + }; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + function Mash() { + var n = 4022871197; + var mash = function(data) { + data = String(data); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 4294967296; + } + return (n >>> 0) * 23283064365386963e-26; + }; + return mash; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.alea = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js +var require_xor1284 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.next = function() { + var t = me.x ^ me.x << 11; + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= me.w >>> 19 ^ t ^ t >>> 8; + }; + if (seed === (seed | 0)) { + me.x = seed; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; + } + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xor128 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js +var require_xorwow4 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.next = function() { + var t = me.x ^ me.x >>> 2; + me.x = me.y; + me.y = me.z; + me.z = me.w; + me.w = me.v; + return (me.d = me.d + 362437 | 0) + (me.v = me.v ^ me.v << 4 ^ (t ^ t << 1)) | 0; + }; + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + if (seed === (seed | 0)) { + me.x = seed; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } + } + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; + } + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xorwow = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js +var require_xorshift74 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this; + me.next = function() { + var X = me.x, i = me.i, t, v, w; + t = X[i]; + t ^= t >>> 7; + v = t ^ t << 24; + t = X[i + 1 & 7]; + v ^= t ^ t >>> 10; + t = X[i + 3 & 7]; + v ^= t ^ t >>> 3; + t = X[i + 4 & 7]; + v ^= t ^ t << 7; + t = X[i + 7 & 7]; + t = t ^ t << 13; + v ^= t ^ t << 9; + X[i] = v; + me.i = i + 1 & 7; + return v; + }; + function init2(me2, seed2) { + var j, w, X = []; + if (seed2 === (seed2 | 0)) { + w = X[0] = seed2; + } else { + seed2 = "" + seed2; + for (j = 0; j < seed2.length; ++j) { + X[j & 7] = X[j & 7] << 15 ^ seed2.charCodeAt(j) + X[j + 1 & 7] << 13; + } + } + while (X.length < 8) + X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j) + ; + if (j == 8) + w = X[7] = -1; + else + w = X[j]; + me2.x = X; + me2.i = 0; + for (j = 256; j > 0; --j) { + me2.next(); + } + } + init2(me, seed); + } + function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; + } + function impl(seed, opts) { + if (seed == null) + seed = +new Date(); + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xorshift7 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js +var require_xor40964 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this; + me.next = function() { + var w = me.w, X = me.X, i = me.i, t, v; + me.w = w = w + 1640531527 | 0; + v = X[i + 34 & 127]; + t = X[i = i + 1 & 127]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + v = X[i] = v ^ t; + me.i = i; + return v + (w ^ w >>> 16) | 0; + }; + function init2(me2, seed2) { + var t, v, i, j, w, X = [], limit = 128; + if (seed2 === (seed2 | 0)) { + v = seed2; + seed2 = null; + } else { + seed2 = seed2 + "\0"; + v = 0; + limit = Math.max(limit, seed2.length); + } + for (i = 0, j = -32; j < limit; ++j) { + if (seed2) + v ^= seed2.charCodeAt((j + 32) % seed2.length); + if (j === 0) + w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = w + 1640531527 | 0; + t = X[j & 127] ^= v + w; + i = t == 0 ? i + 1 : 0; + } + } + if (i >= 128) { + X[(seed2 && seed2.length || 0) & 127] = -1; + } + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[i + 34 & 127]; + t = X[i = i + 1 & 127]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + me2.w = w; + me2.X = X; + me2.i = i; + } + init2(me, seed); + } + function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; + } + ; + function impl(seed, opts) { + if (seed == null) + seed = +new Date(); + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.xor4096 = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js +var require_tychei4 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js"(exports, module) { + (function(global2, module2, define2) { + function XorGen(seed) { + var me = this, strseed = ""; + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = b << 25 ^ b >>> 7 ^ c; + c = c - d | 0; + d = d << 24 ^ d >>> 8 ^ a; + a = a - b | 0; + me.b = b = b << 20 ^ b >>> 12 ^ c; + me.c = c = c - d | 0; + me.d = d << 16 ^ c >>> 16 ^ a; + return me.a = a - b | 0; + }; + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + if (seed === Math.floor(seed)) { + me.a = seed / 4294967296 | 0; + me.b = seed | 0; + } else { + strseed += seed; + } + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; + } + ; + function impl(seed, opts) { + var xg = new XorGen(seed), state = opts && opts.state, prng = function() { + return (xg.next() >>> 0) / 4294967296; + }; + prng.double = function() { + do { + var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 4294967296, result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof state == "object") + copy(state, xg); + prng.state = function() { + return copy(xg, {}); + }; + } + return prng; + } + if (module2 && module2.exports) { + module2.exports = impl; + } else if (define2 && define2.amd) { + define2(function() { + return impl; + }); + } else { + this.tychei = impl; + } + })(exports, typeof module == "object" && module, typeof define == "function" && define); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js +var require_seedrandom7 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js"(exports, module) { + (function(global2, pool5, math) { + var width = 256, chunks = 6, digits = 52, rngname = "random", startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; + function seedrandom9(seed, options3, callback) { + var key = []; + options3 = options3 == true ? { entropy: true } : options3 || {}; + var shortseed = mixkey(flatten6(options3.entropy ? [seed, tostring(pool5)] : seed == null ? autoseed() : seed, 3), key); + var arc4 = new ARC4(key); + var prng = function() { + var n = arc4.g(chunks), d = startdenom, x = 0; + while (n < significance) { + n = (n + x) * width; + d *= width; + x = arc4.g(1); + } + while (n >= overflow) { + n /= 2; + d /= 2; + x >>>= 1; + } + return (n + x) / d; + }; + prng.int32 = function() { + return arc4.g(4) | 0; + }; + prng.quick = function() { + return arc4.g(4) / 4294967296; + }; + prng.double = prng; + mixkey(tostring(arc4.S), pool5); + return (options3.pass || callback || function(prng2, seed2, is_math_call, state) { + if (state) { + if (state.S) { + copy(state, arc4); + } + prng2.state = function() { + return copy(arc4, {}); + }; + } + if (is_math_call) { + math[rngname] = prng2; + return seed2; + } else + return prng2; + })(prng, shortseed, "global" in options3 ? options3.global : this == math, options3.state); + } + function ARC4(key) { + var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + if (!keylen) { + key = [keylen++]; + } + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])]; + s[j] = t; + } + (me.g = function(count4) { + var t2, r = 0, i2 = me.i, j2 = me.j, s2 = me.S; + while (count4--) { + t2 = s2[i2 = mask & i2 + 1]; + r = r * width + s2[mask & (s2[i2] = s2[j2 = mask & j2 + t2]) + (s2[j2] = t2)]; + } + me.i = i2; + me.j = j2; + return r; + })(width); + } + function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; + } + ; + function flatten6(obj, depth) { + var result = [], typ = typeof obj, prop; + if (depth && typ == "object") { + for (prop in obj) { + try { + result.push(flatten6(obj[prop], depth - 1)); + } catch (e) { + } + } + } + return result.length ? result : typ == "string" ? obj : obj + "\0"; + } + function mixkey(seed, key) { + var stringseed = seed + "", smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++); + } + return tostring(key); + } + function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + out = out(width); + } else { + out = new Uint8Array(width); + (global2.crypto || global2.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global2.navigator, plugins = browser && browser.plugins; + return [+new Date(), global2, plugins, global2.screen, tostring(pool5)]; + } + } + function tostring(a) { + return String.fromCharCode.apply(0, a); + } + mixkey(math.random(), pool5); + if (typeof module == "object" && module.exports) { + module.exports = seedrandom9; + try { + nodecrypto = require_crypto2(); + } catch (ex) { + } + } else if (typeof define == "function" && define.amd) { + define(function() { + return seedrandom9; + }); + } else { + math["seed" + rngname] = seedrandom9; + } + })(typeof self !== "undefined" ? self : exports, [], Math); + } +}); + +// node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js +var require_seedrandom8 = __commonJS({ + "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js"(exports, module) { + var alea5 = require_alea4(); + var xor128 = require_xor1284(); + var xorwow = require_xorwow4(); + var xorshift7 = require_xorshift74(); + var xor4096 = require_xor40964(); + var tychei = require_tychei4(); + var sr = require_seedrandom7(); + sr.alea = alea5; + sr.xor128 = xor128; + sr.xorwow = xorwow; + sr.xorshift7 = xorshift7; + sr.xor4096 = xor4096; + sr.tychei = tychei; + module.exports = sr; + } +}); + +// (disabled):node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js +var require_string_decoder2 = __commonJS({ + "(disabled):node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js"() { + } +}); + // src/util/util.ts function join(folder, file) { const separator = folder.endsWith("/") ? "" : "/"; @@ -169,7 +2336,7 @@ var config = { }, maxDetected: -1, minConfidence: 0.2, - skipFrames: 1 + skipFrames: 5 }, hand: { enabled: true, @@ -690,12 +2857,12 @@ __export(tfjs_esm_exports, { zeros: () => zeros, zerosLike: () => zerosLike }); -var __create = Object.create; +var __create2 = Object.create; var __defProp2 = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; +var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; +var __getOwnPropNames2 = Object.getOwnPropertyNames; +var __getProtoOf2 = Object.getPrototypeOf; +var __hasOwnProp2 = Object.prototype.hasOwnProperty; var __markAsModule2 = (target) => __defProp2(target, "__esModule", { value: true }); var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b] @@ -704,28 +2871,28 @@ var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __re return __require.apply(this, arguments); throw new Error('Dynamic require of "' + x + '" is not supported'); }); -var __commonJS = (cb, mod4) => function __require22() { - return mod4 || (0, cb[Object.keys(cb)[0]])((mod4 = { exports: {} }).exports, mod4), mod4.exports; +var __commonJS2 = (cb, mod42) => function __require22() { + return mod42 || (0, cb[Object.keys(cb)[0]])((mod42 = { exports: {} }).exports, mod42), mod42.exports; }; var __export2 = (target, all52) => { __markAsModule2(target); for (var name in all52) __defProp2(target, name, { get: all52[name], enumerable: true }); }; -var __reExport = (target, module, desc) => { +var __reExport2 = (target, module, desc) => { if (module && typeof module === "object" || typeof module === "function") { - for (let key of __getOwnPropNames(module)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp2(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable }); + for (let key of __getOwnPropNames2(module)) + if (!__hasOwnProp2.call(target, key) && key !== "default") + __defProp2(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc2(module, key)) || desc.enumerable }); } return target; }; -var __toModule = (module) => { - return __reExport(__markAsModule2(__defProp2(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module); +var __toModule2 = (module) => { + return __reExport2(__markAsModule2(__defProp2(module != null ? __create2(__getProtoOf2(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module); }; -var require_long = __commonJS({ +var require_long = __commonJS2({ "node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js"(exports, module) { - module.exports = Long2; + module.exports = Long22; var wasm = null; try { wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ @@ -1018,46 +3185,46 @@ var require_long = __commonJS({ ])), {}).exports; } catch (e) { } - function Long2(low, high, unsigned) { + function Long22(low, high, unsigned) { this.low = low | 0; this.high = high | 0; this.unsigned = !!unsigned; } - Long2.prototype.__isLong__; - Object.defineProperty(Long2.prototype, "__isLong__", { value: true }); + Long22.prototype.__isLong__; + Object.defineProperty(Long22.prototype, "__isLong__", { value: true }); function isLong(obj) { return (obj && obj["__isLong__"]) === true; } - Long2.isLong = isLong; + Long22.isLong = isLong; var INT_CACHE = {}; var UINT_CACHE = {}; function fromInt(value, unsigned) { - var obj, cachedObj, cache2; + var obj, cachedObj, cache3; if (unsigned) { value >>>= 0; - if (cache2 = 0 <= value && value < 256) { + if (cache3 = 0 <= value && value < 256) { cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); - if (cache2) + if (cache3) UINT_CACHE[value] = obj; return obj; } else { value |= 0; - if (cache2 = -128 <= value && value < 128) { + if (cache3 = -128 <= value && value < 128) { cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache2) + if (cache3) INT_CACHE[value] = obj; return obj; } } - Long2.fromInt = fromInt; + Long22.fromInt = fromInt; function fromNumber(value, unsigned) { if (isNaN(value)) return unsigned ? UZERO : ZERO; @@ -1076,11 +3243,11 @@ var require_long = __commonJS({ return fromNumber(-value, unsigned).neg(); return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); } - Long2.fromNumber = fromNumber; + Long22.fromNumber = fromNumber; function fromBits(lowBits, highBits, unsigned) { - return new Long2(lowBits, highBits, unsigned); + return new Long22(lowBits, highBits, unsigned); } - Long2.fromBits = fromBits; + Long22.fromBits = fromBits; var pow_dbl = Math.pow; function fromString(str, unsigned, radix) { if (str.length === 0) @@ -1095,10 +3262,10 @@ var require_long = __commonJS({ radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError("radix"); - var p2; - if ((p2 = str.indexOf("-")) > 0) + var p22; + if ((p22 = str.indexOf("-")) > 0) throw Error("interior hyphen"); - else if (p2 === 0) { + else if (p22 === 0) { return fromString(str.substring(1), unsigned, radix).neg(); } var radixToPower = fromNumber(pow_dbl(radix, 8)); @@ -1116,7 +3283,7 @@ var require_long = __commonJS({ result.unsigned = unsigned; return result; } - Long2.fromString = fromString; + Long22.fromString = fromString; function fromValue(val, unsigned) { if (typeof val === "number") return fromNumber(val, unsigned); @@ -1124,7 +3291,7 @@ var require_long = __commonJS({ return fromString(val, unsigned); return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); } - Long2.fromValue = fromValue; + Long22.fromValue = fromValue; var TWO_PWR_16_DBL = 1 << 16; var TWO_PWR_24_DBL = 1 << 24; var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; @@ -1132,22 +3299,22 @@ var require_long = __commonJS({ var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); var ZERO = fromInt(0); - Long2.ZERO = ZERO; + Long22.ZERO = ZERO; var UZERO = fromInt(0, true); - Long2.UZERO = UZERO; + Long22.UZERO = UZERO; var ONE = fromInt(1); - Long2.ONE = ONE; + Long22.ONE = ONE; var UONE = fromInt(1, true); - Long2.UONE = UONE; + Long22.UONE = UONE; var NEG_ONE = fromInt(-1); - Long2.NEG_ONE = NEG_ONE; + Long22.NEG_ONE = NEG_ONE; var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); - Long2.MAX_VALUE = MAX_VALUE; + Long22.MAX_VALUE = MAX_VALUE; var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); - Long2.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + Long22.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; var MIN_VALUE = fromBits(0, 2147483648 | 0, false); - Long2.MIN_VALUE = MIN_VALUE; - var LongPrototype = Long2.prototype; + Long22.MIN_VALUE = MIN_VALUE; + var LongPrototype = Long22.prototype; LongPrototype.toInt = function toInt() { return this.unsigned ? this.low >>> 0 : this.low; }; @@ -1164,8 +3331,8 @@ var require_long = __commonJS({ return "0"; if (this.isNegative()) { if (this.eq(MIN_VALUE)) { - var radixLong = fromNumber(radix), div3 = this.div(radixLong), rem1 = div3.mul(radixLong).sub(this); - return div3.toString(radix) + rem1.toInt().toString(radix); + var radixLong = fromNumber(radix), div32 = this.div(radixLong), rem1 = div32.mul(radixLong).sub(this); + return div32.toString(radix) + rem1.toInt().toString(radix); } else return "-" + this.neg().toString(radix); } @@ -1217,7 +3384,7 @@ var require_long = __commonJS({ LongPrototype.isOdd = function isOdd() { return (this.low & 1) === 1; }; - LongPrototype.isEven = function isEven2() { + LongPrototype.isEven = function isEven22() { return (this.low & 1) === 0; }; LongPrototype.equals = function equals(other) { @@ -1272,11 +3439,11 @@ var require_long = __commonJS({ return this.not().add(ONE); }; LongPrototype.neg = LongPrototype.negate; - LongPrototype.add = function add5(addend) { + LongPrototype.add = function add52(addend) { if (!isLong(addend)) addend = fromValue(addend); var a48 = this.high >>> 16; - var a32 = this.high & 65535; + var a322 = this.high & 65535; var a16 = this.low >>> 16; var a00 = this.low & 65535; var b48 = addend.high >>> 16; @@ -1290,7 +3457,7 @@ var require_long = __commonJS({ c16 += a16 + b16; c32 += c16 >>> 16; c16 &= 65535; - c32 += a32 + b32; + c32 += a322 + b32; c48 += c32 >>> 16; c32 &= 65535; c48 += a48 + b48; @@ -1303,7 +3470,7 @@ var require_long = __commonJS({ return this.add(subtrahend.neg()); }; LongPrototype.sub = LongPrototype.subtract; - LongPrototype.multiply = function multiply4(multiplier) { + LongPrototype.multiply = function multiply42(multiplier) { if (this.isZero()) return ZERO; if (!isLong(multiplier)) @@ -1328,7 +3495,7 @@ var require_long = __commonJS({ if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); var a48 = this.high >>> 16; - var a32 = this.high & 65535; + var a322 = this.high & 65535; var a16 = this.low >>> 16; var a00 = this.low & 65535; var b48 = multiplier.high >>> 16; @@ -1345,7 +3512,7 @@ var require_long = __commonJS({ c16 += a00 * b16; c32 += c16 >>> 16; c16 &= 65535; - c32 += a32 * b00; + c32 += a322 * b00; c48 += c32 >>> 16; c32 &= 65535; c32 += a16 * b16; @@ -1354,7 +3521,7 @@ var require_long = __commonJS({ c32 += a00 * b32; c48 += c32 >>> 16; c32 &= 65535; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 += a48 * b00 + a322 * b16 + a16 * b32 + a00 * b48; c48 &= 65535; return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); }; @@ -1535,22 +3702,22 @@ var require_long = __commonJS({ lo & 255 ]; }; - Long2.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long2.fromBytesLE(bytes, unsigned) : Long2.fromBytesBE(bytes, unsigned); + Long22.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long22.fromBytesLE(bytes, unsigned) : Long22.fromBytesBE(bytes, unsigned); }; - Long2.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long2(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); + Long22.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long22(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); }; - Long2.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long2(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); + Long22.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long22(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); }; } }); -var require_browser = __commonJS({ +var require_browser = __commonJS2({ "(disabled):node_modules/.pnpm/node-fetch@2.6.5/node_modules/node-fetch/browser.js"() { } }); -var require_alea = __commonJS({ +var require_alea = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js"(exports, module) { (function(global2, module2, define2) { function Alea(seed) { @@ -1634,7 +3801,7 @@ var require_alea = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xor128 = __commonJS({ +var require_xor128 = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -1700,7 +3867,7 @@ var require_xor128 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xorwow = __commonJS({ +var require_xorwow = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -1773,7 +3940,7 @@ var require_xorwow = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xorshift7 = __commonJS({ +var require_xorshift7 = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -1862,7 +4029,7 @@ var require_xorshift7 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xor4096 = __commonJS({ +var require_xor4096 = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -1966,7 +4133,7 @@ var require_xor4096 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_tychei = __commonJS({ +var require_tychei = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2038,18 +4205,18 @@ var require_tychei = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_crypto = __commonJS({ +var require_crypto = __commonJS2({ "(disabled):crypto"() { } }); -var require_seedrandom = __commonJS({ +var require_seedrandom = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js"(exports, module) { - (function(pool3, math) { + (function(pool32, math) { var global2 = this, width = 256, chunks = 6, digits = 52, rngname = "random", startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; - function seedrandom5(seed, options3, callback) { + function seedrandom52(seed, options3, callback) { var key = []; options3 = options3 == true ? { entropy: true } : options3 || {}; - var shortseed = mixkey(flatten4(options3.entropy ? [seed, tostring(pool3)] : seed == null ? autoseed() : seed, 3), key); + var shortseed = mixkey(flatten42(options3.entropy ? [seed, tostring(pool32)] : seed == null ? autoseed() : seed, 3), key); var arc4 = new ARC4(key); var prng = function() { var n = arc4.g(chunks), d = startdenom, x = 0; @@ -2072,7 +4239,7 @@ var require_seedrandom = __commonJS({ return arc4.g(4) / 4294967296; }; prng.double = prng; - mixkey(tostring(arc4.S), pool3); + mixkey(tostring(arc4.S), pool32); return (options3.pass || callback || function(prng2, seed2, is_math_call, state) { if (state) { if (state.S) { @@ -2089,7 +4256,7 @@ var require_seedrandom = __commonJS({ return prng2; })(prng, shortseed, "global" in options3 ? options3.global : this == math, options3.state); } - math["seed" + rngname] = seedrandom5; + math["seed" + rngname] = seedrandom52; function ARC4(key) { var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; if (!keylen) { @@ -2120,12 +4287,12 @@ var require_seedrandom = __commonJS({ return t; } ; - function flatten4(obj, depth) { + function flatten42(obj, depth) { var result = [], typ = typeof obj, prop; if (depth && typ == "object") { for (prop in obj) { try { - result.push(flatten4(obj[prop], depth - 1)); + result.push(flatten42(obj[prop], depth - 1)); } catch (e) { } } @@ -2151,28 +4318,28 @@ var require_seedrandom = __commonJS({ return tostring(out); } catch (e) { var browser = global2.navigator, plugins = browser && browser.plugins; - return [+new Date(), global2, plugins, global2.screen, tostring(pool3)]; + return [+new Date(), global2, plugins, global2.screen, tostring(pool32)]; } } function tostring(a) { return String.fromCharCode.apply(0, a); } - mixkey(math.random(), pool3); + mixkey(math.random(), pool32); if (typeof module == "object" && module.exports) { - module.exports = seedrandom5; + module.exports = seedrandom52; try { nodecrypto = require_crypto(); } catch (ex) { } } else if (typeof define == "function" && define.amd) { define(function() { - return seedrandom5; + return seedrandom52; }); } })([], Math); } }); -var require_seedrandom2 = __commonJS({ +var require_seedrandom2 = __commonJS2({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js"(exports, module) { var alea5 = require_alea(); var xor128 = require_xor128(); @@ -2190,7 +4357,7 @@ var require_seedrandom2 = __commonJS({ module.exports = sr; } }); -var require_alea2 = __commonJS({ +var require_alea2 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js"(exports, module) { (function(global2, module2, define2) { function Alea(seed) { @@ -2274,7 +4441,7 @@ var require_alea2 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xor1282 = __commonJS({ +var require_xor1282 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2340,7 +4507,7 @@ var require_xor1282 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xorwow2 = __commonJS({ +var require_xorwow2 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2413,7 +4580,7 @@ var require_xorwow2 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xorshift72 = __commonJS({ +var require_xorshift72 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2502,7 +4669,7 @@ var require_xorshift72 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_xor40962 = __commonJS({ +var require_xor40962 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2606,7 +4773,7 @@ var require_xor40962 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_tychei2 = __commonJS({ +var require_tychei2 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js"(exports, module) { (function(global2, module2, define2) { function XorGen(seed) { @@ -2678,14 +4845,14 @@ var require_tychei2 = __commonJS({ })(exports, typeof module == "object" && module, typeof define == "function" && define); } }); -var require_seedrandom3 = __commonJS({ +var require_seedrandom3 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js"(exports, module) { - (function(global2, pool3, math) { + (function(global2, pool32, math) { var width = 256, chunks = 6, digits = 52, rngname = "random", startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; - function seedrandom5(seed, options3, callback) { + function seedrandom52(seed, options3, callback) { var key = []; options3 = options3 == true ? { entropy: true } : options3 || {}; - var shortseed = mixkey(flatten4(options3.entropy ? [seed, tostring(pool3)] : seed == null ? autoseed() : seed, 3), key); + var shortseed = mixkey(flatten42(options3.entropy ? [seed, tostring(pool32)] : seed == null ? autoseed() : seed, 3), key); var arc4 = new ARC4(key); var prng = function() { var n = arc4.g(chunks), d = startdenom, x = 0; @@ -2708,7 +4875,7 @@ var require_seedrandom3 = __commonJS({ return arc4.g(4) / 4294967296; }; prng.double = prng; - mixkey(tostring(arc4.S), pool3); + mixkey(tostring(arc4.S), pool32); return (options3.pass || callback || function(prng2, seed2, is_math_call, state) { if (state) { if (state.S) { @@ -2755,12 +4922,12 @@ var require_seedrandom3 = __commonJS({ return t; } ; - function flatten4(obj, depth) { + function flatten42(obj, depth) { var result = [], typ = typeof obj, prop; if (depth && typ == "object") { for (prop in obj) { try { - result.push(flatten4(obj[prop], depth - 1)); + result.push(flatten42(obj[prop], depth - 1)); } catch (e) { } } @@ -2786,30 +4953,30 @@ var require_seedrandom3 = __commonJS({ return tostring(out); } catch (e) { var browser = global2.navigator, plugins = browser && browser.plugins; - return [+new Date(), global2, plugins, global2.screen, tostring(pool3)]; + return [+new Date(), global2, plugins, global2.screen, tostring(pool32)]; } } function tostring(a) { return String.fromCharCode.apply(0, a); } - mixkey(math.random(), pool3); + mixkey(math.random(), pool32); if (typeof module == "object" && module.exports) { - module.exports = seedrandom5; + module.exports = seedrandom52; try { nodecrypto = require_crypto(); } catch (ex) { } } else if (typeof define == "function" && define.amd) { define(function() { - return seedrandom5; + return seedrandom52; }); } else { - math["seed" + rngname] = seedrandom5; + math["seed" + rngname] = seedrandom52; } })(typeof self !== "undefined" ? self : exports, [], Math); } }); -var require_seedrandom4 = __commonJS({ +var require_seedrandom4 = __commonJS2({ "node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js"(exports, module) { var alea5 = require_alea2(); var xor128 = require_xor1282(); @@ -2827,23 +4994,23 @@ var require_seedrandom4 = __commonJS({ module.exports = sr; } }); -var require_string_decoder = __commonJS({ +var require_string_decoder = __commonJS2({ "(disabled):node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js"() { } }); -var require_path = __commonJS({ +var require_path = __commonJS2({ "(disabled):path"() { } }); -var require_worker_threads = __commonJS({ +var require_worker_threads = __commonJS2({ "(disabled):worker_threads"() { } }); -var require_perf_hooks = __commonJS({ +var require_perf_hooks = __commonJS2({ "(disabled):perf_hooks"() { } }); -var require_tfjs_backend_wasm_threaded_simd = __commonJS({ +var require_tfjs_backend_wasm_threaded_simd = __commonJS2({ "node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js"(exports, module) { var WasmBackendModuleThreadedSimd = function() { var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : void 0; @@ -2852,31 +5019,31 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ return function(WasmBackendModuleThreadedSimd2) { WasmBackendModuleThreadedSimd2 = WasmBackendModuleThreadedSimd2 || {}; function GROWABLE_HEAP_I8() { - if (wasmMemory.buffer != buffer2) { + if (wasmMemory.buffer != buffer22) { updateGlobalBufferAndViews(wasmMemory.buffer); } return HEAP8; } function GROWABLE_HEAP_U8() { - if (wasmMemory.buffer != buffer2) { + if (wasmMemory.buffer != buffer22) { updateGlobalBufferAndViews(wasmMemory.buffer); } return HEAPU8; } function GROWABLE_HEAP_I32() { - if (wasmMemory.buffer != buffer2) { + if (wasmMemory.buffer != buffer22) { updateGlobalBufferAndViews(wasmMemory.buffer); } return HEAP32; } function GROWABLE_HEAP_U32() { - if (wasmMemory.buffer != buffer2) { + if (wasmMemory.buffer != buffer22) { updateGlobalBufferAndViews(wasmMemory.buffer); } return HEAPU32; } function GROWABLE_HEAP_F64() { - if (wasmMemory.buffer != buffer2) { + if (wasmMemory.buffer != buffer22) { updateGlobalBufferAndViews(wasmMemory.buffer); } return HEAPF64; @@ -2909,7 +5076,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; if (ENVIRONMENT_IS_PTHREAD) { - buffer2 = Module["buffer"]; + buffer22 = Module["buffer"]; } var scriptDirectory = ""; function locateFile(path) { @@ -2940,7 +5107,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ if (!ret.buffer) { ret = new Uint8Array(ret); } - assert3(ret.buffer); + assert32(ret.buffer); return ret; }; if (process["argv"].length > 1) { @@ -2979,7 +5146,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ return new Uint8Array(readbuffer(f)); } data = read(f, "binary"); - assert3(typeof data === "object"); + assert32(typeof data === "object"); return data; }; if (typeof scriptArgs != "undefined") { @@ -3026,7 +5193,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ if (!ret.buffer) { ret = new Uint8Array(ret); } - assert3(ret.buffer); + assert32(ret.buffer); return ret; }; } else { @@ -3098,15 +5265,15 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ var wasmModule; var ABORT = false; var EXITSTATUS; - function assert3(condition, text) { + function assert32(condition, text) { if (!condition) { abort("Assertion failed: " + text); } } function getCFunc(ident) { - var func2 = Module["_" + ident]; - assert3(func2, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func2; + var func22 = Module["_" + ident]; + assert32(func22, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func22; } function ccall(ident, returnType, argTypes, args, opts) { var toC = { "string": function(str) { @@ -3129,25 +5296,25 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ return Boolean(ret2); return ret2; } - var func2 = getCFunc(ident); + var func22 = getCFunc(ident); var cArgs = []; - var stack2 = 0; + var stack22 = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { - if (stack2 === 0) - stack2 = stackSave(); + if (stack22 === 0) + stack22 = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } - var ret = func2.apply(null, cArgs); + var ret = func22.apply(null, cArgs); ret = convertReturnValue(ret); - if (stack2 !== 0) - stackRestore(stack2); + if (stack22 !== 0) + stackRestore(stack22); return ret; } function cwrap(ident, returnType, argTypes, opts) { @@ -3255,8 +5422,8 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ } return len; } - function writeArrayToMemory(array2, buffer3) { - GROWABLE_HEAP_I8().set(array2, buffer3); + function writeArrayToMemory(array22, buffer3) { + GROWABLE_HEAP_I8().set(array22, buffer3); } function alignUp(x, multiple) { if (x % multiple > 0) { @@ -3264,9 +5431,9 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ } return x; } - var buffer2, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + var buffer22, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateGlobalBufferAndViews(buf) { - buffer2 = buf; + buffer22 = buf; Module["HEAP8"] = HEAP8 = new Int8Array(buf); Module["HEAP16"] = HEAP16 = new Int16Array(buf); Module["HEAP32"] = HEAP32 = new Int32Array(buf); @@ -3279,7 +5446,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; if (ENVIRONMENT_IS_PTHREAD) { wasmMemory = Module["wasmMemory"]; - buffer2 = Module["buffer"]; + buffer22 = Module["buffer"]; } else { if (Module["wasmMemory"]) { wasmMemory = Module["wasmMemory"]; @@ -3295,10 +5462,10 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ } } if (wasmMemory) { - buffer2 = wasmMemory.buffer; + buffer22 = wasmMemory.buffer; } - INITIAL_MEMORY = buffer2.byteLength; - updateGlobalBufferAndViews(buffer2); + INITIAL_MEMORY = buffer22.byteLength; + updateGlobalBufferAndViews(buffer22); var wasmTable; var __ATPRERUN__ = []; var __ATINIT__ = []; @@ -3361,7 +5528,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ var runDependencyWatcher = null; var dependenciesFulfilled = null; function addRunDependency(id) { - assert3(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + assert32(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); @@ -3522,22 +5689,22 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ function initPthreadsJS() { PThread.initRuntime(); } - function callRuntimeCallbacks(callbacks2) { - while (callbacks2.length > 0) { - var callback = callbacks2.shift(); + function callRuntimeCallbacks(callbacks22) { + while (callbacks22.length > 0) { + var callback = callbacks22.shift(); if (typeof callback == "function") { callback(Module); continue; } - var func2 = callback.func; - if (typeof func2 === "number") { + var func22 = callback.func; + if (typeof func22 === "number") { if (callback.arg === void 0) { - wasmTable.get(func2)(); + wasmTable.get(func22)(); } else { - wasmTable.get(func2)(callback.arg); + wasmTable.get(func22)(callback.arg); } } else { - func2(callback.arg === void 0 ? null : callback.arg); + func22(callback.arg === void 0 ? null : callback.arg); } } } @@ -3686,10 +5853,10 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ PThread.freeThreadData(worker.pthread); worker.pthread = void 0; }); - }, runWithoutMainThreadQueuedCalls: function(func2) { + }, runWithoutMainThreadQueuedCalls: function(func22) { GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls >> 2] = 0; try { - func2(); + func22(); } finally { GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls >> 2] = 1; } @@ -3802,8 +5969,8 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ return wasmTable.get(ptr)(arg); } Module["invokeEntryPoint"] = invokeEntryPoint; - function ___assert_fail(condition, filename, line, func2) { - abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func2 ? UTF8ToString(func2) : "unknown function"]); + function ___assert_fail(condition, filename, line, func22) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func22 ? UTF8ToString(func22) : "unknown function"]); } function ___call_main(argc, argv) { var returnCode = _main(argc, argv); @@ -3828,9 +5995,9 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ GROWABLE_HEAP_I32()[___errno_location() >> 2] = value; return value; } - function _atexit(func2, arg) { + function _atexit(func22, arg) { if (ENVIRONMENT_IS_PTHREAD) - return _emscripten_proxy_to_main_thread_js(1, 1, func2, arg); + return _emscripten_proxy_to_main_thread_js(1, 1, func22, arg); } function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { if (targetThreadId == mainThreadId) { @@ -3904,7 +6071,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ } function _emscripten_proxy_to_main_thread_js(index, sync) { var numCallArgs = arguments.length - 2; - var stack2 = stackSave(); + var stack22 = stackSave(); var serializedNumCallArgs = numCallArgs; var args = stackAlloc(serializedNumCallArgs * 8); var b = args >> 3; @@ -3913,7 +6080,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ GROWABLE_HEAP_F64()[b + i] = arg; } var ret = _emscripten_run_in_main_runtime_thread_js(index, serializedNumCallArgs, args, sync); - stackRestore(stack2); + stackRestore(stack22); return ret; } var _emscripten_receive_on_main_thread_js_callArgs = []; @@ -3938,15 +6105,15 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i]; } var isEmAsmConst = index < 0; - var func2 = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; - return func2.apply(null, _emscripten_receive_on_main_thread_js_callArgs); + var func22 = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + return func22.apply(null, _emscripten_receive_on_main_thread_js_callArgs); } function _emscripten_get_heap_size() { return GROWABLE_HEAP_U8().length; } function emscripten_realloc_buffer(size2) { try { - wasmMemory.grow(size2 - buffer2.byteLength + 65535 >>> 16); + wasmMemory.grow(size2 - buffer22.byteLength + 65535 >>> 16); updateGlobalBufferAndViews(wasmMemory.buffer); return 1; } catch (e) { @@ -4218,11 +6385,11 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ table[i] = null; } return ret; - }, getSource: function(shader, count22, string3, length) { + }, getSource: function(shader, count22, string32, length) { var source = ""; for (var i = 0; i < count22; ++i) { var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; - source += UTF8ToString(GROWABLE_HEAP_I32()[string3 + i * 4 >> 2], len < 0 ? void 0 : len); + source += UTF8ToString(GROWABLE_HEAP_I32()[string32 + i * 4 >> 2], len < 0 ? void 0 : len); } return source; }, createContext: function(canvas3, webGLContextAttributes) { @@ -4276,25 +6443,25 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ } }); }, populateUniformTable: function(program) { - var p2 = GL.programs[program]; + var p22 = GL.programs[program]; var ptable = GL.programInfos[program] = { uniforms: {}, maxUniformLength: 0, maxAttributeLength: -1, maxUniformBlockNameLength: -1 }; var utable = ptable.uniforms; - var numUniforms = GLctx.getProgramParameter(p2, 35718); + var numUniforms = GLctx.getProgramParameter(p22, 35718); for (var i = 0; i < numUniforms; ++i) { - var u = GLctx.getActiveUniform(p2, i); + var u = GLctx.getActiveUniform(p22, i); var name = u.name; ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); if (name.slice(-1) == "]") { name = name.slice(0, name.lastIndexOf("[")); } - var loc = GLctx.getUniformLocation(p2, name); + var loc = GLctx.getUniformLocation(p22, name); if (loc) { var id = GL.getNewId(GL.uniforms); utable[name] = [u.size, id]; GL.uniforms[id] = loc; for (var j = 1; j < u.size; ++j) { var n = name + "[" + j + "]"; - loc = GLctx.getUniformLocation(p2, n); + loc = GLctx.getUniformLocation(p22, n); id = GL.getNewId(GL.uniforms); GL.uniforms[id] = loc; } @@ -4316,8 +6483,8 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ var contextHandle = GL.createContext(canvas3, contextAttributes); return contextHandle; } - function _emscripten_webgl_create_context(a0, a12) { - return _emscripten_webgl_do_create_context(a0, a12); + function _emscripten_webgl_create_context(a0, a122) { + return _emscripten_webgl_do_create_context(a0, a122); } var SYSCALLS = { mappings: {}, buffers: [null, [], []], printChar: function(stream, curr) { var buffer3 = SYSCALLS.buffers[stream]; @@ -4361,9 +6528,9 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ GROWABLE_HEAP_I32()[pnum >> 2] = num; return 0; } - function _pthread_cleanup_pop(execute2) { + function _pthread_cleanup_pop(execute22) { var routine = PThread.threadExitHandlers.pop(); - if (execute2) + if (execute22) routine(); } function _pthread_cleanup_push(routine, arg) { @@ -4441,7 +6608,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ stackBase = _memalign(16, stackSize); } else { stackBase -= stackSize; - assert3(stackBase > 0); + assert32(stackBase > 0); } var threadInfoStruct = _malloc(228); for (var i = 0; i < 228 >> 2; ++i) @@ -5053,7 +7220,7 @@ var require_tfjs_backend_wasm_threaded_simd = __commonJS({ exports["WasmBackendModuleThreadedSimd"] = WasmBackendModuleThreadedSimd; } }); -var require_tfjs_backend_wasm = __commonJS({ +var require_tfjs_backend_wasm = __commonJS2({ "node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(exports, module) { var WasmBackendModule = function() { var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : void 0; @@ -5116,7 +7283,7 @@ var require_tfjs_backend_wasm = __commonJS({ if (!ret.buffer) { ret = new Uint8Array(ret); } - assert3(ret.buffer); + assert32(ret.buffer); return ret; }; if (process["argv"].length > 1) { @@ -5147,7 +7314,7 @@ var require_tfjs_backend_wasm = __commonJS({ return new Uint8Array(readbuffer(f)); } data = read(f, "binary"); - assert3(typeof data === "object"); + assert32(typeof data === "object"); return data; }; if (typeof scriptArgs != "undefined") { @@ -5240,15 +7407,15 @@ var require_tfjs_backend_wasm = __commonJS({ var wasmMemory; var ABORT = false; var EXITSTATUS; - function assert3(condition, text) { + function assert32(condition, text) { if (!condition) { abort("Assertion failed: " + text); } } function getCFunc(ident) { - var func2 = Module["_" + ident]; - assert3(func2, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func2; + var func22 = Module["_" + ident]; + assert32(func22, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func22; } function ccall(ident, returnType, argTypes, args, opts) { var toC = { "string": function(str) { @@ -5271,25 +7438,25 @@ var require_tfjs_backend_wasm = __commonJS({ return Boolean(ret2); return ret2; } - var func2 = getCFunc(ident); + var func22 = getCFunc(ident); var cArgs = []; - var stack2 = 0; + var stack22 = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { - if (stack2 === 0) - stack2 = stackSave(); + if (stack22 === 0) + stack22 = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } - var ret = func2.apply(null, cArgs); + var ret = func22.apply(null, cArgs); ret = convertReturnValue(ret); - if (stack2 !== 0) - stackRestore(stack2); + if (stack22 !== 0) + stackRestore(stack22); return ret; } function cwrap(ident, returnType, argTypes, opts) { @@ -5386,8 +7553,8 @@ var require_tfjs_backend_wasm = __commonJS({ function stringToUTF8(str, outPtr, maxBytesToWrite) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); } - function writeArrayToMemory(array2, buffer3) { - HEAP8.set(array2, buffer3); + function writeArrayToMemory(array22, buffer3) { + HEAP8.set(array22, buffer3); } function alignUp(x, multiple) { if (x % multiple > 0) { @@ -5395,9 +7562,9 @@ var require_tfjs_backend_wasm = __commonJS({ } return x; } - var buffer2, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + var buffer22, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateGlobalBufferAndViews(buf) { - buffer2 = buf; + buffer22 = buf; Module["HEAP8"] = HEAP8 = new Int8Array(buf); Module["HEAP16"] = HEAP16 = new Int16Array(buf); Module["HEAP32"] = HEAP32 = new Int32Array(buf); @@ -5593,22 +7760,22 @@ var require_tfjs_backend_wasm = __commonJS({ instantiateAsync().catch(readyPromiseReject); return {}; } - function callRuntimeCallbacks(callbacks2) { - while (callbacks2.length > 0) { - var callback = callbacks2.shift(); + function callRuntimeCallbacks(callbacks22) { + while (callbacks22.length > 0) { + var callback = callbacks22.shift(); if (typeof callback == "function") { callback(Module); continue; } - var func2 = callback.func; - if (typeof func2 === "number") { + var func22 = callback.func; + if (typeof func22 === "number") { if (callback.arg === void 0) { - wasmTable.get(func2)(); + wasmTable.get(func22)(); } else { - wasmTable.get(func2)(callback.arg); + wasmTable.get(func22)(callback.arg); } } else { - func2(callback.arg === void 0 ? null : callback.arg); + func22(callback.arg === void 0 ? null : callback.arg); } } } @@ -5623,7 +7790,7 @@ var require_tfjs_backend_wasm = __commonJS({ } function emscripten_realloc_buffer(size2) { try { - wasmMemory.grow(size2 - buffer2.byteLength + 65535 >>> 16); + wasmMemory.grow(size2 - buffer22.byteLength + 65535 >>> 16); updateGlobalBufferAndViews(wasmMemory.buffer); return 1; } catch (e) { @@ -6274,30 +8441,30 @@ var KernelBackend = class { function notYetImplemented(kernelName) { throw new Error(`'${kernelName}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`); } -function shuffle(array2) { - let counter = array2.length; +function shuffle(array22) { + let counter = array22.length; let index = 0; while (counter > 0) { index = Math.random() * counter | 0; counter--; - swap(array2, counter, index); - } -} -function shuffleCombo(array2, array22) { - if (array2.length !== array22.length) { - throw new Error(`Array sizes must match to be shuffled together First array length was ${array2.length}Second array length was ${array22.length}`); - } - let counter = array2.length; - let index = 0; - while (counter > 0) { - index = Math.random() * counter | 0; - counter--; - swap(array2, counter, index); swap(array22, counter, index); } } -function clamp(min6, x, max6) { - return Math.max(min6, Math.min(x, max6)); +function shuffleCombo(array22, array222) { + if (array22.length !== array222.length) { + throw new Error(`Array sizes must match to be shuffled together First array length was ${array22.length}Second array length was ${array222.length}`); + } + let counter = array22.length; + let index = 0; + while (counter > 0) { + index = Math.random() * counter | 0; + counter--; + swap(array22, counter, index); + swap(array222, counter, index); + } +} +function clamp(min62, x, max62) { + return Math.max(min62, Math.min(x, max62)); } function nearestLargerEven(val) { return val % 2 === 0 ? val : val + 1; @@ -6308,11 +8475,11 @@ function swap(object2, left, right) { object2[right] = temp; } function sum(arr) { - let sum6 = 0; + let sum62 = 0; for (let i = 0; i < arr.length; i++) { - sum6 += arr[i]; + sum62 += arr[i]; } - return sum6; + return sum62; } function randUniform(a, b) { const r = Math.random(); @@ -6653,11 +8820,11 @@ function toNestedArray(shape, a, isComplex = false) { return createNestedArray(0, shape, a, isComplex); } function makeOnesTypedArray(size2, dtype) { - const array2 = makeZerosTypedArray(size2, dtype); - for (let i = 0; i < array2.length; i++) { - array2[i] = 1; + const array22 = makeZerosTypedArray(size2, dtype); + for (let i = 0; i < array22.length; i++) { + array22[i] = 1; } - return array2; + return array22; } function makeZerosTypedArray(size2, dtype) { if (dtype == null || dtype === "float32" || dtype === "complex64") { @@ -7171,7 +9338,7 @@ __export2(util_exports, { toNestedArray: () => toNestedArray, toTypedArray: () => toTypedArray }); -var LongExports = __toModule(require_long()); +var LongExports = __toModule2(require_long()); var Long = LongExports.default || LongExports; function hexToLong(hex) { return Long.fromString(hex, true, 16); @@ -7195,12 +9362,12 @@ function fetch32(s, offset) { function rotate64(val, shift) { return shift === 0 ? val : val.shru(shift).or(val.shl(64 - shift)); } -function hashLen16(u, v, mul2 = hexToLong("9ddfea08eb382d69")) { - let a = u.xor(v).mul(mul2); +function hashLen16(u, v, mul22 = hexToLong("9ddfea08eb382d69")) { + let a = u.xor(v).mul(mul22); a = a.xor(a.shru(47)); - let b = v.xor(a).mul(mul2); + let b = v.xor(a).mul(mul22); b = b.xor(b.shru(47)); - b = b.mul(mul2); + b = b.mul(mul22); return b; } function weakHashLen32WithSeeds(w, x, y, z, a, b) { @@ -7217,17 +9384,17 @@ function weakHashLen32WithSeedsStr(s, offset, a, b) { } function hashLen0to16(s, len = s.length) { if (len >= 8) { - const mul2 = k2.add(len * 2); + const mul22 = k2.add(len * 2); const a = fetch64(s, 0).add(k2); const b = fetch64(s, len - 8); - const c = rotate64(b, 37).mul(mul2).add(a); - const d = rotate64(a, 25).add(b).mul(mul2); - return hashLen16(c, d, mul2); + const c = rotate64(b, 37).mul(mul22).add(a); + const d = rotate64(a, 25).add(b).mul(mul22); + return hashLen16(c, d, mul22); } if (len >= 4) { - const mul2 = k2.add(len * 2); + const mul22 = k2.add(len * 2); const a = fetch32(s, 0); - return hashLen16(a.shl(3).add(len), fetch32(s, len - 4), mul2); + return hashLen16(a.shl(3).add(len), fetch32(s, len - 4), mul22); } if (len > 0) { const a = s[0]; @@ -7240,26 +9407,26 @@ function hashLen0to16(s, len = s.length) { return k2; } function hashLen17to32(s, len = s.length) { - const mul2 = k2.add(len * 2); + const mul22 = k2.add(len * 2); const a = fetch64(s, 0).mul(k1); const b = fetch64(s, 8); - const c = fetch64(s, len - 8).mul(mul2); + const c = fetch64(s, len - 8).mul(mul22); const d = fetch64(s, len - 16).mul(k2); - return hashLen16(rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d), a.add(rotate64(b.add(k2), 18)).add(c), mul2); + return hashLen16(rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d), a.add(rotate64(b.add(k2), 18)).add(c), mul22); } function hashLen33to64(s, len = s.length) { - const mul2 = k2.add(len * 2); + const mul22 = k2.add(len * 2); const a = fetch64(s, 0).mul(k2); const b = fetch64(s, 8); - const c = fetch64(s, len - 8).mul(mul2); + const c = fetch64(s, len - 8).mul(mul22); const d = fetch64(s, len - 16).mul(k2); const y = rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d); - const z = hashLen16(y, a.add(rotate64(b.add(k2), 18)).add(c), mul2); - const e = fetch64(s, 16).mul(mul2); + const z = hashLen16(y, a.add(rotate64(b.add(k2), 18)).add(c), mul22); + const e = fetch64(s, 16).mul(mul22); const f = fetch64(s, 24); - const g = y.add(fetch64(s, len - 32)).mul(mul2); - const h = z.add(fetch64(s, len - 24)).mul(mul2); - return hashLen16(rotate64(e.add(f), 43).add(rotate64(g, 30)).add(h), e.add(rotate64(f.add(a), 18)).add(g), mul2); + const g = y.add(fetch64(s, len - 32)).mul(mul22); + const h = z.add(fetch64(s, len - 24)).mul(mul22); + return hashLen16(rotate64(e.add(f), 43).add(rotate64(g, 30)).add(h), e.add(rotate64(f.add(a), 18)).add(g), mul22); } function fingerPrint64(s, len = s.length) { const seed = Long.fromNumber(81, true); @@ -7292,20 +9459,20 @@ function fingerPrint64(s, len = s.length) { [z, x] = [x, z]; offset += 64; } while (offset !== end); - const mul2 = k1.add(z.and(255).shl(1)); + const mul22 = k1.add(z.and(255).shl(1)); offset = last64; w[0] = w[0].add(len - 1 & 63); v[0] = v[0].add(w[0]); w[0] = w[0].add(v[0]); - x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(mul2); - y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(mul2); + x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(mul22); + y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(mul22); x = x.xor(w[1].mul(9)); y = y.add(v[0].mul(9).add(fetch64(s, offset + 40))); - z = rotate64(z.add(w[0]), 33).mul(mul2); - v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(mul2), x.add(w[0])); + z = rotate64(z.add(w[0]), 33).mul(mul22); + v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(mul22), x.add(w[0])); w = weakHashLen32WithSeedsStr(s, offset + 32, z.add(w[1]), y.add(fetch64(s, offset + 16))); [z, x] = [x, z]; - return hashLen16(hashLen16(v[0], w[0], mul2).add(shiftMix(y).mul(k0)).add(z), hashLen16(v[1], w[1], mul2).add(x), mul2); + return hashLen16(hashLen16(v[0], w[0], mul22).add(shiftMix(y).mul(k0)).add(z), hashLen16(v[1], w[1], mul22).add(x), mul22); } function createScalarValue(value, dtype) { if (dtype === "string") { @@ -7431,9 +9598,9 @@ var Logger = class { const shape = rightPad(result.shape.toString(), 14); let inputShapesDescription = ""; for (const name2 in inputs) { - const input2 = inputs[name2]; - if (input2 != null) { - const inputShape = input2.shape || result.shape; + const input22 = inputs[name2]; + if (input22 != null) { + const inputShape = input22.shape || result.shape; const inputRank = inputShape.length; inputShapesDescription += `${name2}: ${inputRank}D ${inputRank > 0 ? inputShape : ""} `; } @@ -7451,10 +9618,10 @@ function getFilteredNodesXToY(tape, xs, y) { const node2 = tape[i]; const nodeInputs = node2.inputs; for (const inputName in nodeInputs) { - const input2 = nodeInputs[inputName]; + const input22 = nodeInputs[inputName]; let anyInputFromX = false; for (let j = 0; j < xs.length; j++) { - if (tensorsFromX[input2.id]) { + if (tensorsFromX[input22.id]) { node2.outputs.forEach((output) => tensorsFromX[output.id] = true); anyInputFromX = true; nodesFromX[node2.id] = true; @@ -7501,7 +9668,7 @@ function getFilteredNodesXToY(tape, xs, y) { } return filteredTape; } -function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy2, add5) { +function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy22, add52) { for (let i = filteredTape.length - 1; i >= 0; i--) { const node2 = filteredTape[i]; const dys = []; @@ -7521,7 +9688,7 @@ function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy if (!(inputName in inputGradients)) { throw new Error(`Cannot backprop through input ${inputName}. Available gradients found: ${Object.keys(inputGradients)}.`); } - const dx = tidy2(() => inputGradients[inputName]()); + const dx = tidy22(() => inputGradients[inputName]()); if (dx.dtype !== "float32") { throw new Error(`Error in gradient for op ${node2.kernelName}. The gradient of input ${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); } @@ -7533,7 +9700,7 @@ function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy tensorAccumulatedGradientMap[x.id] = dx; } else { const curGradient = tensorAccumulatedGradientMap[x.id]; - tensorAccumulatedGradientMap[x.id] = add5(curGradient, dx); + tensorAccumulatedGradientMap[x.id] = add52(curGradient, dx); curGradient.dispose(); } } @@ -7573,7 +9740,7 @@ function computeMaxSizePerColumn(vals, shape, dtype, strides) { } return padPerCol; } -function valToString(val, pad3, dtype) { +function valToString(val, pad32, dtype) { let valStr; if (Array.isArray(val)) { valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; @@ -7584,7 +9751,7 @@ function valToString(val, pad3, dtype) { } else { valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); } - return rightPad(valStr, pad3); + return rightPad(valStr, pad32); } function boolNumToString(v) { return v === 0 ? "false" : "true"; @@ -7893,42 +10060,42 @@ __export2(tensor_util_exports, { makeTypesMatch: () => makeTypesMatch }); var Rank; -(function(Rank2) { - Rank2["R0"] = "R0"; - Rank2["R1"] = "R1"; - Rank2["R2"] = "R2"; - Rank2["R3"] = "R3"; - Rank2["R4"] = "R4"; - Rank2["R5"] = "R5"; - Rank2["R6"] = "R6"; +(function(Rank22) { + Rank22["R0"] = "R0"; + Rank22["R1"] = "R1"; + Rank22["R2"] = "R2"; + Rank22["R3"] = "R3"; + Rank22["R4"] = "R4"; + Rank22["R5"] = "R5"; + Rank22["R6"] = "R6"; })(Rank || (Rank = {})); var UpcastInt32AndMap; -(function(UpcastInt32AndMap2) { - UpcastInt32AndMap2["float32"] = "float32"; - UpcastInt32AndMap2["int32"] = "int32"; - UpcastInt32AndMap2["bool"] = "int32"; - UpcastInt32AndMap2["complex64"] = "complex64"; +(function(UpcastInt32AndMap22) { + UpcastInt32AndMap22["float32"] = "float32"; + UpcastInt32AndMap22["int32"] = "int32"; + UpcastInt32AndMap22["bool"] = "int32"; + UpcastInt32AndMap22["complex64"] = "complex64"; })(UpcastInt32AndMap || (UpcastInt32AndMap = {})); var UpcastBoolAndMap; -(function(UpcastBoolAndMap2) { - UpcastBoolAndMap2["float32"] = "float32"; - UpcastBoolAndMap2["int32"] = "int32"; - UpcastBoolAndMap2["bool"] = "bool"; - UpcastBoolAndMap2["complex64"] = "complex64"; +(function(UpcastBoolAndMap22) { + UpcastBoolAndMap22["float32"] = "float32"; + UpcastBoolAndMap22["int32"] = "int32"; + UpcastBoolAndMap22["bool"] = "bool"; + UpcastBoolAndMap22["complex64"] = "complex64"; })(UpcastBoolAndMap || (UpcastBoolAndMap = {})); var UpcastFloat32AndMap; -(function(UpcastFloat32AndMap2) { - UpcastFloat32AndMap2["float32"] = "float32"; - UpcastFloat32AndMap2["int32"] = "float32"; - UpcastFloat32AndMap2["bool"] = "float32"; - UpcastFloat32AndMap2["complex64"] = "complex64"; +(function(UpcastFloat32AndMap22) { + UpcastFloat32AndMap22["float32"] = "float32"; + UpcastFloat32AndMap22["int32"] = "float32"; + UpcastFloat32AndMap22["bool"] = "float32"; + UpcastFloat32AndMap22["complex64"] = "complex64"; })(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); var UpcastComplex64AndMap; -(function(UpcastComplex64AndMap2) { - UpcastComplex64AndMap2["float32"] = "complex64"; - UpcastComplex64AndMap2["int32"] = "complex64"; - UpcastComplex64AndMap2["bool"] = "complex64"; - UpcastComplex64AndMap2["complex64"] = "complex64"; +(function(UpcastComplex64AndMap22) { + UpcastComplex64AndMap22["float32"] = "complex64"; + UpcastComplex64AndMap22["int32"] = "complex64"; + UpcastComplex64AndMap22["bool"] = "complex64"; + UpcastComplex64AndMap22["complex64"] = "complex64"; })(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); var upcastTypeMap = { "float32": UpcastFloat32AndMap, @@ -7958,8 +10125,8 @@ function makeTypesMatch(a, b) { function assertTypesMatch(a, b) { assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and second(${b.dtype}) input must match`); } -function isTensorInList(tensor2, tensorList) { - return tensorList.some((x) => x.id === tensor2.id); +function isTensorInList(tensor22, tensorList) { + return tensorList.some((x) => x.id === tensor22.id); } function getTensorsInContainer(result) { const list = []; @@ -8026,8 +10193,8 @@ var EngineState = class { } }; var Engine = class { - constructor(ENV5) { - this.ENV = ENV5; + constructor(ENV52) { + this.ENV = ENV52; this.registry = {}; this.registryFactory = {}; this.pendingBackendInitId = 0; @@ -8346,7 +10513,7 @@ var Engine = class { if (!isTapeOn) { return; } - saved = tensors.map((tensor2) => this.keep(this.clone(tensor2))); + saved = tensors.map((tensor22) => this.keep(this.clone(tensor22))); }; kernelFunc3 = () => { const numDataIdsBefore = this.backend.numDataIds(); @@ -8391,7 +10558,7 @@ var Engine = class { return Array.isArray(out) ? outputs : outputs[0]; } saveTensorsForBackwardMode(tensors) { - const saved = tensors.map((tensor2) => this.keep(this.clone(tensor2))); + const saved = tensors.map((tensor22) => this.keep(this.clone(tensor22))); return saved; } getTensorsForGradient(kernelName, inputs, outputs) { @@ -8597,16 +10764,16 @@ var Engine = class { const tensorsToTrackInParent = getTensorsInContainer(result); const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map((t) => t.id)); for (let i = 0; i < this.state.activeScope.track.length; i++) { - const tensor2 = this.state.activeScope.track[i]; - if (!tensor2.kept && !tensorsToTrackInParentSet.has(tensor2.id)) { - tensor2.dispose(); + const tensor22 = this.state.activeScope.track[i]; + if (!tensor22.kept && !tensorsToTrackInParentSet.has(tensor22.id)) { + tensor22.dispose(); } } const oldScope = this.state.scopeStack.pop(); this.state.activeScope = this.state.scopeStack.length === 0 ? null : this.state.scopeStack[this.state.scopeStack.length - 1]; - tensorsToTrackInParent.forEach((tensor2) => { - if (!tensor2.kept && tensor2.scopeId === oldScope.id) { - this.track(tensor2); + tensorsToTrackInParent.forEach((tensor22) => { + if (!tensor22.kept && tensor22.scopeId === oldScope.id) { + this.track(tensor22); } }); } @@ -8628,8 +10795,8 @@ var Engine = class { const grads2 = xs.map((x) => accumulatedGradientMap[x.id]); if (this.state.gradientDepth === 0) { this.state.activeTape.forEach((node2) => { - for (const tensor2 of node2.saved) { - tensor2.dispose(); + for (const tensor22 of node2.saved) { + tensor22.dispose(); } }); this.state.activeTape = null; @@ -8643,8 +10810,8 @@ var Engine = class { assert(inputs.every((t) => t instanceof Tensor), () => "The args passed in customGrad(f)(x1, x2,...) must all be tensors"); let res; const inputMap = {}; - inputs.forEach((input2, i) => { - inputMap[i] = input2; + inputs.forEach((input22, i) => { + inputMap[i] = input22; }); const forwardFunc = (_, save) => { res = f(...[...inputs, save]); @@ -8873,9 +11040,9 @@ function op(f) { Object.defineProperty(f2, "name", { value: opName, configurable: true }); return f2; } -function complex_(real4, imag4) { - const $real = convertToTensor(real4, "real", "complex"); - const $imag = convertToTensor(imag4, "imag", "complex"); +function complex_(real42, imag42) { + const $real = convertToTensor(real42, "real", "complex"); + const $imag = convertToTensor(imag42, "imag", "complex"); assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, must match in call to tf.complex().`); const inputs = { real: $real, imag: $imag }; return ENGINE.runKernel(Complex, inputs); @@ -8926,7 +11093,7 @@ var NUM_BYTES_STRING_LENGTH = 4; async function encodeWeights(tensors, group) { const specs = []; const dataPromises = []; - const names = Array.isArray(tensors) ? tensors.map((tensor2) => tensor2.name) : Object.keys(tensors); + const names = Array.isArray(tensors) ? tensors.map((tensor22) => tensor22.name) : Object.keys(tensors); for (let i = 0; i < names.length; ++i) { const name = names[i]; const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name]; @@ -8937,7 +11104,7 @@ async function encodeWeights(tensors, group) { if (t.dtype === "string") { const utf8bytes = new Promise(async (resolve) => { const vals = await t.bytes(); - const totalNumBytes = vals.reduce((p2, c) => p2 + c.length, 0) + NUM_BYTES_STRING_LENGTH * vals.length; + const totalNumBytes = vals.reduce((p22, c) => p22 + c.length, 0) + NUM_BYTES_STRING_LENGTH * vals.length; const bytes = new Uint8Array(totalNumBytes); let offset = 0; for (let i2 = 0; i2 < vals.length; i2++) { @@ -8962,7 +11129,7 @@ async function encodeWeights(tensors, group) { const tensorValues = await Promise.all(dataPromises); return { data: concatenateTypedArrays(tensorValues), specs }; } -function decodeWeights(buffer2, specs) { +function decodeWeights(buffer22, specs) { const out = {}; let float16Decode; let offset = 0; @@ -8986,7 +11153,7 @@ function decodeWeights(buffer2, specs) { throw new Error(`Weight ${spec.name} has unknown quantization dtype ${quantization.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`); } const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype]; - const byteBuffer = buffer2.slice(offset, offset + size2 * quantizationSizeFactor); + const byteBuffer = buffer22.slice(offset, offset + size2 * quantizationSizeFactor); const quantizedArray = quantization.dtype === "uint8" ? new Uint8Array(byteBuffer) : new Uint16Array(byteBuffer); if (dtype === "float32") { if (quantization.dtype === "uint8" || quantization.dtype === "uint16") { @@ -9020,15 +11187,15 @@ function decodeWeights(buffer2, specs) { const size22 = sizeFromShape(spec.shape); values = []; for (let i = 0; i < size22; i++) { - const byteLength = new Uint32Array(buffer2.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0]; + const byteLength = new Uint32Array(buffer22.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0]; offset += NUM_BYTES_STRING_LENGTH; - const bytes = new Uint8Array(buffer2.slice(offset, offset + byteLength)); + const bytes = new Uint8Array(buffer22.slice(offset, offset + byteLength)); values.push(bytes); offset += byteLength; } } else { const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype]; - const byteBuffer = buffer2.slice(offset, offset + size2 * dtypeFactor); + const byteBuffer = buffer22.slice(offset, offset + size2 * dtypeFactor); if (dtype === "float32") { values = new Float32Array(byteBuffer); } else if (dtype === "int32") { @@ -9037,13 +11204,13 @@ function decodeWeights(buffer2, specs) { values = new Uint8Array(byteBuffer); } else if (dtype === "complex64") { values = new Float32Array(byteBuffer); - const real4 = new Float32Array(values.length / 2); + const real42 = new Float32Array(values.length / 2); const image32 = new Float32Array(values.length / 2); - for (let i = 0; i < real4.length; i++) { - real4[i] = values[i * 2]; + for (let i = 0; i < real42.length; i++) { + real42[i] = values[i * 2]; image32[i] = values[i * 2 + 1]; } - const realTensor = tensor(real4, shape, "float32"); + const realTensor = tensor(real42, shape, "float32"); const imageTensor = tensor(image32, shape, "float32"); out[name] = complex(realTensor, imageTensor); realTensor.dispose(); @@ -9087,11 +11254,11 @@ function stringByteLength(str) { } return new Blob([str]).size; } -function arrayBufferToBase64String(buffer2) { +function arrayBufferToBase64String(buffer22) { if (useNodeBuffer) { - return Buffer.from(buffer2).toString("base64"); + return Buffer.from(buffer22).toString("base64"); } - const buf = new Uint8Array(buffer2); + const buf = new Uint8Array(buffer22); let s = ""; for (let i = 0, l = buf.length; i < l; i++) { s += String.fromCharCode(buf[i]); @@ -9104,25 +11271,25 @@ function base64StringToArrayBuffer(str) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); } const s = atob(str); - const buffer2 = new Uint8Array(s.length); + const buffer22 = new Uint8Array(s.length); for (let i = 0; i < s.length; ++i) { - buffer2.set([s.charCodeAt(i)], i); + buffer22.set([s.charCodeAt(i)], i); } - return buffer2.buffer; + return buffer22.buffer; } function concatenateArrayBuffers(buffers) { if (buffers.length === 1) { return buffers[0]; } let totalByteLength = 0; - buffers.forEach((buffer2) => { - totalByteLength += buffer2.byteLength; + buffers.forEach((buffer22) => { + totalByteLength += buffer22.byteLength; }); const temp = new Uint8Array(totalByteLength); let offset = 0; - buffers.forEach((buffer2) => { - temp.set(new Uint8Array(buffer2), offset); - offset += buffer2.byteLength; + buffers.forEach((buffer22) => { + temp.set(new Uint8Array(buffer22), offset); + offset += buffer22.byteLength; }); return temp.buffer; } @@ -9157,7 +11324,7 @@ function getModelJSONForModelArtifacts(artifacts, manifest) { } return result; } -async function getModelArtifactsForJSON(modelJSON, loadWeights2) { +async function getModelArtifactsForJSON(modelJSON, loadWeights22) { const modelArtifacts = { modelTopology: modelJSON.modelTopology, format: modelJSON.format, @@ -9168,7 +11335,7 @@ async function getModelArtifactsForJSON(modelJSON, loadWeights2) { modelArtifacts.trainingConfig = modelJSON.trainingConfig; } if (modelJSON.weightsManifest != null) { - const [weightSpecs, weightData] = await loadWeights2(modelJSON.weightsManifest); + const [weightSpecs, weightData] = await loadWeights22(modelJSON.weightsManifest); modelArtifacts.weightSpecs = weightSpecs; modelArtifacts.weightData = weightData; } @@ -9244,14 +11411,14 @@ function getFloat16Decoder() { const exponentTable = computeFloat16ExponentTable(); const offsetTable = computeFloat16OffsetTable(); return (quantizedArray) => { - const buffer2 = new ArrayBuffer(4 * quantizedArray.length); - const bufferUint32View = new Uint32Array(buffer2); + const buffer22 = new ArrayBuffer(4 * quantizedArray.length); + const bufferUint32View = new Uint32Array(buffer22); for (let index = 0; index < quantizedArray.length; index++) { const float16Bits = quantizedArray[index]; const float32Bits = mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 1023)] + exponentTable[float16Bits >> 10]; bufferUint32View[index] = float32Bits; } - return new Float32Array(buffer2); + return new Float32Array(buffer22); }; } var IORouterRegistry = class { @@ -10065,8 +12232,8 @@ async function loadWeightsAsArrayBuffer(fetchURLs, loadOptions) { } async function loadWeights(manifest, filePathPrefix = "", weightNames, requestInit) { const fetchWeights = (fetchUrls) => loadWeightsAsArrayBuffer(fetchUrls, { requestInit }); - const loadWeights2 = weightsLoaderFactory(fetchWeights); - return loadWeights2(manifest, filePathPrefix, weightNames); + const loadWeights22 = weightsLoaderFactory(fetchWeights); + return loadWeights22(manifest, filePathPrefix, weightNames); } function weightsLoaderFactory(fetchWeightsFunction) { return async (manifest, filePathPrefix = "", weightNames) => { @@ -10135,9 +12302,9 @@ Manifest JSON has weights with names: ${allManifestWeightNames.join(", ")}.`); const groupByteBuffer = new Uint8Array(groupBuffer); let groupBufferOffset = 0; for (let i2 = 0; i2 < numBuffers; i2++) { - const buffer2 = new Uint8Array(buffers[bufferIndexOffset + i2]); - groupByteBuffer.set(buffer2, groupBufferOffset); - groupBufferOffset += buffer2.byteLength; + const buffer22 = new Uint8Array(buffers[bufferIndexOffset + i2]); + groupByteBuffer.set(buffer22, groupBufferOffset); + groupBufferOffset += buffer22.byteLength; } const weightsEntries = groupWeightsToFetch[i]; weightsEntries.forEach((weightsEntry) => { @@ -10576,8 +12743,8 @@ var gather_nd_util_exports = {}; __export2(gather_nd_util_exports, { prepareAndValidate: () => prepareAndValidate }); -function prepareAndValidate(tensor2, indices) { - const tensorRank = tensor2.shape.length; +function prepareAndValidate(tensor22, indices) { + const tensorRank = tensor22.shape.length; const indicesRank = indices.shape.length; if (tensorRank < 1) { throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${tensorRank}.`); @@ -10591,8 +12758,8 @@ function prepareAndValidate(tensor2, indices) { if (indices.shape[indicesRank - 1] > tensorRank) { throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${indices.shape[indicesRank - 1]} vs. ${tensorRank}`); } - if (sizeFromShape(tensor2.shape) === 0) { - throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${tensor2.shape}.`); + if (sizeFromShape(tensor22.shape) === 0) { + throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${tensor22.shape}.`); } const indicesShape = indices.shape; const sliceRank = indicesShape[indicesShape.length - 1]; @@ -10600,7 +12767,7 @@ function prepareAndValidate(tensor2, indices) { for (let i = 0; i < indicesShape.length - 1; ++i) { nResult *= indicesShape[i]; } - const inputShape = tensor2.shape; + const inputShape = tensor22.shape; const resultShape = indicesShape.slice(); resultShape.pop(); let sliceSize = 1; @@ -10609,7 +12776,7 @@ function prepareAndValidate(tensor2, indices) { resultShape.push(inputShape[i]); } const strides = [ - ...computeStrides(tensor2.shape).map((stride) => stride / sliceSize), + ...computeStrides(tensor22.shape).map((stride) => stride / sliceSize), 1 ].slice(0, sliceRank); return [resultShape, nResult, sliceSize, strides]; @@ -10678,8 +12845,8 @@ function calculateShapes(updates, indices, shape) { const safeSliceDim = sliceRank < 1 ? 1 : sliceRank; const numUpdates = sizeFromShape(indices.shape) / safeSliceDim; const strides = [...computeStrides(shape.slice(0, sliceRank)), 1]; - const outputSize3 = sizeFromShape(shape); - return { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize3 }; + const outputSize2 = sizeFromShape(shape); + return { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 }; } var slice_util_exports = {}; __export2(slice_util_exports, { @@ -10698,12 +12865,12 @@ __export2(slice_util_exports, { stridesForAxis: () => stridesForAxis, stridesWithElidedDims: () => stridesWithElidedDims }); -function assertParamsValid(input2, begin, size2) { - const inputRank = input2.shape.length; +function assertParamsValid(input22, begin, size2) { + const inputRank = input22.shape.length; assert(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must match the rank of the array (${inputRank}).`); assert(inputRank === size2.length, () => `Error in slice${inputRank}D: Length of size ${size2} must match the rank of the array (${inputRank}).`); for (let i = 0; i < inputRank; ++i) { - assert(begin[i] + size2[i] <= input2.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] (${begin[i] + size2[i]}) would overflow input.shape[${i}] (${input2.shape[i]})`); + assert(begin[i] + size2[i] <= input22.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] (${begin[i] + size2[i]}) would overflow input.shape[${i}] (${input22.shape[i]})`); } } function maskToAxes(mask) { @@ -11003,11 +13170,11 @@ __export2(test_util_exports, { }); var TEST_EPSILON_FLOAT32 = 1e-3; var TEST_EPSILON_FLOAT16 = 0.1; -function expectArraysClose(actual, expected, epsilon3) { - if (epsilon3 == null) { - epsilon3 = testEpsilon(); +function expectArraysClose(actual, expected, epsilon32) { + if (epsilon32 == null) { + epsilon32 = testEpsilon(); } - return expectArraysPredicate(actual, expected, (a, b) => areClose(a, b, epsilon3)); + return expectArraysPredicate(actual, expected, (a, b) => areClose(a, b, epsilon32)); } function testEpsilon() { return ENGINE.backend.floatPrecision() === 32 ? TEST_EPSILON_FLOAT32 : TEST_EPSILON_FLOAT16; @@ -11055,25 +13222,25 @@ function expectPromiseToFail(fn, done) { fn().then(() => done.fail(), () => done()); } function expectArraysEqual(actual, expected) { - const exp4 = typeof expected === "string" || typeof expected === "number" || typeof expected === "boolean" ? [expected] : expected; + const exp42 = typeof expected === "string" || typeof expected === "number" || typeof expected === "boolean" ? [expected] : expected; if (isString(actual) || isString(actual[0]) || isString(expected) || isString(expected[0])) { - return expectArraysPredicate(actual, exp4, (a, b) => a == b); + return expectArraysPredicate(actual, exp42, (a, b) => a == b); } return expectArraysPredicate(actual, expected, (a, b) => areClose(a, b, 0)); } -function expectNumbersClose(a, e, epsilon3) { - if (epsilon3 == null) { - epsilon3 = testEpsilon(); +function expectNumbersClose(a, e, epsilon32) { + if (epsilon32 == null) { + epsilon32 = testEpsilon(); } - if (!areClose(a, e, epsilon3)) { + if (!areClose(a, e, epsilon32)) { throw new Error(`Numbers differ: actual === ${a}, expected === ${e}`); } } -function areClose(a, e, epsilon3) { +function areClose(a, e, epsilon32) { if (!isFinite(a) && !isFinite(e)) { return true; } - if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon3) { + if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon32) { return false; } return true; @@ -11133,7 +13300,7 @@ function tidy(nameOrFn, fn) { } function dispose(container) { const tensors = getTensorsInContainer(container); - tensors.forEach((tensor2) => tensor2.dispose()); + tensors.forEach((tensor22) => tensor22.dispose()); } function keep(result) { return ENGINE.keep(result); @@ -11306,13 +13473,13 @@ function atanh_(x) { return ENGINE.runKernel(Atanh, inputs); } var atanh = op({ atanh_ }); -function computeDilation2DInfo(inputShape, filterShape, strides, pad3, dataFormat = "NHWC", dilations) { +function computeDilation2DInfo(inputShape, filterShape, strides, pad32, dataFormat = "NHWC", dilations) { const inputChannels = inputShape[3]; const $filterShape = [...filterShape, inputChannels]; const $dataFormat = convertConv2DDataFormat(dataFormat); - return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad3, null, null, $dataFormat); + return computeConv2DInfo(inputShape, $filterShape, strides, dilations, pad32, null, null, $dataFormat); } -function computePool2DInfo(inShape, filterSize, strides, dilations, pad3, roundingMode, dataFormat = "channelsLast") { +function computePool2DInfo(inShape, filterSize, strides, dilations, pad32, roundingMode, dataFormat = "channelsLast") { const [filterHeight, filterWidth] = parseTupleParam(filterSize); let filterShape; if (dataFormat === "channelsLast") { @@ -11322,9 +13489,9 @@ function computePool2DInfo(inShape, filterSize, strides, dilations, pad3, roundi } else { throw new Error(`Unknown dataFormat ${dataFormat}`); } - return computeConv2DInfo(inShape, filterShape, strides, dilations, pad3, roundingMode, false, dataFormat); + return computeConv2DInfo(inShape, filterShape, strides, dilations, pad32, roundingMode, false, dataFormat); } -function computePool3DInfo(inShape, filterSize, strides, dilations, pad3, roundingMode, dataFormat = "NDHWC") { +function computePool3DInfo(inShape, filterSize, strides, dilations, pad32, roundingMode, dataFormat = "NDHWC") { const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize); let filterShape; let $dataFormat; @@ -11337,9 +13504,9 @@ function computePool3DInfo(inShape, filterSize, strides, dilations, pad3, roundi } else { throw new Error(`Unknown dataFormat ${dataFormat}`); } - return computeConv3DInfo(inShape, filterShape, strides, dilations, pad3, false, $dataFormat, roundingMode); + return computeConv3DInfo(inShape, filterShape, strides, dilations, pad32, false, $dataFormat, roundingMode); } -function computeConv2DInfo(inShape, filterShape, strides, dilations, pad3, roundingMode, depthwise = false, dataFormat = "channelsLast") { +function computeConv2DInfo(inShape, filterShape, strides, dilations, pad32, roundingMode, depthwise = false, dataFormat = "channelsLast") { let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; if (dataFormat === "channelsLast") { [batchSize, inHeight, inWidth, inChannels] = inShape; @@ -11353,7 +13520,7 @@ function computeConv2DInfo(inShape, filterShape, strides, dilations, pad3, round const [dilationHeight, dilationWidth] = parseTupleParam(dilations); const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad3, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); + const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad32, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); const outChannels = depthwise ? filterChannels * inChannels : filterChannels; let outShape; if (dataFormat === "channelsFirst") { @@ -11384,7 +13551,7 @@ function computeConv2DInfo(inShape, filterShape, strides, dilations, pad3, round filterShape }; } -function computeConv3DInfo(inShape, filterShape, strides, dilations, pad3, depthwise = false, dataFormat = "channelsLast", roundingMode) { +function computeConv3DInfo(inShape, filterShape, strides, dilations, pad32, depthwise = false, dataFormat = "channelsLast", roundingMode) { let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1]; if (dataFormat === "channelsLast") { [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape; @@ -11399,7 +13566,7 @@ function computeConv3DInfo(inShape, filterShape, strides, dilations, pad3, depth const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth); const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); - const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad3, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode); + const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad32, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode); const outChannels = depthwise ? filterChannels * inChannels : filterChannels; let outShape; if (dataFormat === "channelsFirst") { @@ -11480,17 +13647,17 @@ function getEffectiveFilterSize(filterSize, dilation) { } return filterSize + (filterSize - 1) * (dilation - 1); } -function getPadAndOutInfo(pad3, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { +function getPadAndOutInfo(pad32, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { let padInfo; let outHeight; let outWidth; - if (typeof pad3 === "number") { - const padType = pad3 === 0 ? "VALID" : "NUMBER"; - padInfo = { top: pad3, bottom: pad3, left: pad3, right: pad3, type: padType }; - const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad3, roundingMode); + if (typeof pad32 === "number") { + const padType = pad32 === 0 ? "VALID" : "NUMBER"; + padInfo = { top: pad32, bottom: pad32, left: pad32, right: pad32, type: padType }; + const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad32, roundingMode); outHeight = outShape[0]; outWidth = outShape[1]; - } else if (pad3 === "same") { + } else if (pad32 === "same") { outHeight = Math.ceil(inHeight / strideHeight); outWidth = Math.ceil(inWidth / strideWidth); const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); @@ -11500,45 +13667,45 @@ function getPadAndOutInfo(pad3, inHeight, inWidth, strideHeight, strideWidth, fi const left = Math.floor(padAlongWidth / 2); const right = padAlongWidth - left; padInfo = { top, bottom, left, right, type: "SAME" }; - } else if (pad3 === "valid") { + } else if (pad32 === "valid") { padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }; outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); - } else if (typeof pad3 === "object") { - const top = dataFormat === "channelsLast" ? pad3[1][0] : pad3[2][0]; - const bottom = dataFormat === "channelsLast" ? pad3[1][1] : pad3[2][1]; - const left = dataFormat === "channelsLast" ? pad3[2][0] : pad3[3][0]; - const right = dataFormat === "channelsLast" ? pad3[2][1] : pad3[3][1]; + } else if (typeof pad32 === "object") { + const top = dataFormat === "channelsLast" ? pad32[1][0] : pad32[2][0]; + const bottom = dataFormat === "channelsLast" ? pad32[1][1] : pad32[2][1]; + const left = dataFormat === "channelsLast" ? pad32[2][0] : pad32[3][0]; + const right = dataFormat === "channelsLast" ? pad32[2][1] : pad32[3][1]; const padType = top === 0 && bottom === 0 && left === 0 && right === 0 ? "VALID" : "EXPLICIT"; padInfo = { top, bottom, left, right, type: padType }; outHeight = round((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); outWidth = round((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); } else { - throw Error(`Unknown padding parameter: ${pad3}`); + throw Error(`Unknown padding parameter: ${pad32}`); } return { padInfo, outHeight, outWidth }; } -function get3DPadAndOutInfo(pad3, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) { +function get3DPadAndOutInfo(pad32, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) { let padInfo; let outDepth; let outHeight; let outWidth; - if (typeof pad3 === "number") { - const padType = pad3 === 0 ? "VALID" : "NUMBER"; + if (typeof pad32 === "number") { + const padType = pad32 === 0 ? "VALID" : "NUMBER"; padInfo = { - top: pad3, - bottom: pad3, - left: pad3, - right: pad3, - front: pad3, - back: pad3, + top: pad32, + bottom: pad32, + left: pad32, + right: pad32, + front: pad32, + back: pad32, type: padType }; - const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad3, roundingMode); + const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad32, roundingMode); outDepth = outShape[0]; outHeight = outShape[1]; outWidth = outShape[2]; - } else if (pad3 === "same") { + } else if (pad32 === "same") { outDepth = Math.ceil(inDepth / strideDepth); outHeight = Math.ceil(inHeight / strideHeight); outWidth = Math.ceil(inWidth / strideWidth); @@ -11552,7 +13719,7 @@ function get3DPadAndOutInfo(pad3, inDepth, inHeight, inWidth, strideDepth, strid const left = Math.floor(padAlongWidth / 2); const right = padAlongWidth - left; padInfo = { top, bottom, left, right, front, back, type: "SAME" }; - } else if (pad3 === "valid") { + } else if (pad32 === "valid") { padInfo = { top: 0, bottom: 0, @@ -11566,7 +13733,7 @@ function get3DPadAndOutInfo(pad3, inDepth, inHeight, inWidth, strideDepth, strid outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); } else { - throw Error(`Unknown padding parameter: ${pad3}`); + throw Error(`Unknown padding parameter: ${pad32}`); } return { padInfo, outDepth, outHeight, outWidth }; } @@ -11608,7 +13775,7 @@ function reshape_(x, shape) { return ENGINE.runKernel(Reshape, inputs, attrs); } var reshape = op({ reshape_ }); -function avgPool_(x, filterSize, strides, pad3, dimRoundingMode) { +function avgPool_(x, filterSize, strides, pad32, dimRoundingMode) { const $x = convertToTensor(x, "x", "avgPool", "float32"); const dilations = 1; assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); @@ -11620,10 +13787,10 @@ function avgPool_(x, filterSize, strides, pad3, dimRoundingMode) { } assert(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in avgPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in avgPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode }; let res = ENGINE.runKernel(AvgPool, inputs, attrs); res = cast(res, $x.dtype); if (reshapedTo4D) { @@ -11632,7 +13799,7 @@ function avgPool_(x, filterSize, strides, pad3, dimRoundingMode) { return res; } var avgPool = op({ avgPool_ }); -function avgPool3d_(x, filterSize, strides, pad3, dimRoundingMode, dataFormat = "NDHWC") { +function avgPool3d_(x, filterSize, strides, pad32, dimRoundingMode, dataFormat = "NDHWC") { const $x = convertToTensor(x, "x", "avgPool3d", "float32"); let x5D = $x; let reshapedTo5D = false; @@ -11643,10 +13810,10 @@ function avgPool3d_(x, filterSize, strides, pad3, dimRoundingMode, dataFormat = assert(x5D.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${x5D.rank}.`); assert(dataFormat === "NDHWC", () => `Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${dataFormat}`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x5D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode, dataFormat }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode, dataFormat }; let res = ENGINE.runKernel(AvgPool3D, inputs, attrs); res = cast(res, x5D.dtype); if (reshapedTo5D) { @@ -11659,10 +13826,10 @@ function concat_(tensors, axis = 0) { assert(tensors.length >= 1, () => "Pass at least one tensor to concat"); const $tensors = convertToTensorArray(tensors, "tensors", "concat", "string_or_numeric"); if ($tensors[0].dtype === "complex64") { - $tensors.forEach((tensor2) => { - if (tensor2.dtype !== "complex64") { + $tensors.forEach((tensor22) => { + if (tensor22.dtype !== "complex64") { throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${tensor2.dtype}. `); + with dtype ${tensor22.dtype}. `); } }); } @@ -11720,10 +13887,10 @@ function basicLSTMCell_(forgetBias, lstmKernel, lstmBias, data, c, h) { var basicLSTMCell = op({ basicLSTMCell_ }); function batchToSpaceND_(x, blockShape, crops) { const $x = convertToTensor(x, "x", "batchToSpaceND"); - const prod5 = blockShape.reduce((a, b) => a * b); + const prod52 = blockShape.reduce((a, b) => a * b); assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); - assert($x.shape[0] % prod5 === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of the elements of blockShape ${blockShape.join(" * ")} === ${prod5}`); + assert($x.shape[0] % prod52 === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of the elements of blockShape ${blockShape.join(" * ")} === ${prod52}`); const inputs = { x: $x }; const attrs = { blockShape, crops }; return ENGINE.runKernel(BatchToSpaceND, inputs, attrs); @@ -11742,12 +13909,12 @@ function xAs4D(x) { } return x4D; } -function batchNorm_(x, mean4, variance, offset, scale22, varianceEpsilon) { +function batchNorm_(x, mean42, variance, offset, scale22, varianceEpsilon) { if (varianceEpsilon == null) { varianceEpsilon = 1e-3; } const $x = convertToTensor(x, "x", "batchNorm"); - const $mean = convertToTensor(mean4, "mean", "batchNorm"); + const $mean = convertToTensor(mean42, "mean", "batchNorm"); const $variance = convertToTensor(variance, "variance", "batchNorm"); let $scale; if (scale22 != null) { @@ -11773,9 +13940,9 @@ function batchNorm_(x, mean4, variance, offset, scale22, varianceEpsilon) { return reshape(res, $x.shape); } var batchNorm = op({ batchNorm_ }); -function batchNorm2d_(x, mean4, variance, offset, scale22, varianceEpsilon) { +function batchNorm2d_(x, mean42, variance, offset, scale22, varianceEpsilon) { const $x = convertToTensor(x, "x", "batchNorm"); - const $mean = convertToTensor(mean4, "mean", "batchNorm"); + const $mean = convertToTensor(mean42, "mean", "batchNorm"); const $variance = convertToTensor(variance, "variance", "batchNorm"); let $scale; if (scale22 != null) { @@ -11797,9 +13964,9 @@ function batchNorm2d_(x, mean4, variance, offset, scale22, varianceEpsilon) { return batchNorm($x, $mean, $variance, $offset, $scale, varianceEpsilon); } var batchNorm2d = op({ batchNorm2d_ }); -function batchNorm3d_(x, mean4, variance, offset, scale22, varianceEpsilon) { +function batchNorm3d_(x, mean42, variance, offset, scale22, varianceEpsilon) { const $x = convertToTensor(x, "x", "batchNorm"); - const $mean = convertToTensor(mean4, "mean", "batchNorm"); + const $mean = convertToTensor(mean42, "mean", "batchNorm"); const $variance = convertToTensor(variance, "variance", "batchNorm"); let $scale; if (scale22 != null) { @@ -11821,9 +13988,9 @@ function batchNorm3d_(x, mean4, variance, offset, scale22, varianceEpsilon) { return batchNorm($x, $mean, $variance, $offset, $scale, varianceEpsilon); } var batchNorm3d = op({ batchNorm3d_ }); -function batchNorm4d_(x, mean4, variance, offset, scale22, varianceEpsilon) { +function batchNorm4d_(x, mean42, variance, offset, scale22, varianceEpsilon) { const $x = convertToTensor(x, "x", "batchNorm"); - const $mean = convertToTensor(mean4, "mean", "batchNorm"); + const $mean = convertToTensor(mean42, "mean", "batchNorm"); const $variance = convertToTensor(variance, "variance", "batchNorm"); let $scale; if (scale22 != null) { @@ -11870,35 +14037,35 @@ function broadcastArgs_(s0, s1) { } var broadcastArgs = op({ broadcastArgs_ }); function broadcastTo_(x, shape) { - let input2 = convertToTensor(x, "broadcastTo", "x"); - const xShape = input2.shape; + let input22 = convertToTensor(x, "broadcastTo", "x"); + const xShape = input22.shape; if (shape.some((d) => !(d > 0) || d % 1 !== 0)) { throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); } - if (shape.length < input2.rank) { - throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input2.rank}.`); + if (shape.length < input22.rank) { + throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input22.rank}.`); } - if (shape.length > input2.rank) { - const newShape = input2.shape.slice(); + if (shape.length > input22.rank) { + const newShape = input22.shape.slice(); while (newShape.length < shape.length) { newShape.unshift(1); } - input2 = reshape(input2, newShape); + input22 = reshape(input22, newShape); } - const inputShape = input2.shape; + const inputShape = input22.shape; const reps = Array.from(shape); for (let i = shape.length - 1; i >= 0; i--) { if (inputShape[i] === shape[i]) { reps[i] = 1; - } else if (input2.shape[i] !== 1) { + } else if (input22.shape[i] !== 1) { throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); } } const axes = reps.map((n, i) => n > 1 ? i : -1).filter((i) => i >= 0); if (axes.length === 0) { - return clone(input2); + return clone(input22); } - const inputs = { x: input2 }; + const inputs = { x: input22 }; const attrs = { reps }; return ENGINE.runKernel(Tile, inputs, attrs); } @@ -11933,7 +14100,7 @@ function concat4d_(tensors, axis) { return concat(tensors, axis); } var concat4d = op({ concat4d_ }); -function conv2d_(x, filter, strides, pad3, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { +function conv2d_(x, filter, strides, pad32, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { const $x = convertToTensor(x, "x", "conv2d"); const $filter = convertToTensor(filter, "filter", "conv2d"); let x4D = $x; @@ -11945,13 +14112,13 @@ function conv2d_(x, filter, strides, pad3, dataFormat = "NHWC", dilations = [1, assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${$filter.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inDepth = dataFormat === "NHWC" ? x4D.shape[3] : x4D.shape[1]; assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match input depth for filter ${$filter.shape[2]}.`); assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad: pad3, dataFormat, dilations, dimRoundingMode }; + const attrs = { strides, pad: pad32, dataFormat, dilations, dimRoundingMode }; const res = ENGINE.runKernel(Conv2D, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -11959,7 +14126,7 @@ function conv2d_(x, filter, strides, pad3, dataFormat = "NHWC", dilations = [1, return res; } var conv2d = op({ conv2d_ }); -function conv1d_(x, filter, stride, pad3, dataFormat = "NWC", dilation = 1, dimRoundingMode) { +function conv1d_(x, filter, stride, pad32, dataFormat = "NWC", dilation = 1, dimRoundingMode) { const $x = convertToTensor(x, "x", "conv1d"); const $filter = convertToTensor(filter, "filter", "conv1d"); let x3D = $x; @@ -11971,7 +14138,7 @@ function conv1d_(x, filter, stride, pad3, dataFormat = "NWC", dilation = 1, dimR assert(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); assert($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ${$filter.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in conv1d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in conv1d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } assert(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match input depth for filter ${$filter.shape[1]}.`); assert(eitherStridesOrDilationsAreOne(stride, dilation), () => `Error in conv1D: Either stride or dilation must be 1. Got stride ${stride} and dilation '${dilation}'`); @@ -11981,14 +14148,14 @@ function conv1d_(x, filter, stride, pad3, dataFormat = "NWC", dilation = 1, dimR const strides = [1, stride]; const dilations = [1, dilation]; const conv2dDataFormat = "NHWC"; - const res = conv2d(input4D, filter4D, strides, pad3, conv2dDataFormat, dilations, dimRoundingMode); + const res = conv2d(input4D, filter4D, strides, pad32, conv2dDataFormat, dilations, dimRoundingMode); if (reshapedTo3D) { return reshape(res, [res.shape[2], res.shape[3]]); } return reshape(res, [res.shape[0], res.shape[2], res.shape[3]]); } var conv1d = op({ conv1d_ }); -function conv2DBackpropInput_(xShape, dy, filter, strides, pad3, dataFormat = "NHWC", dimRoundingMode) { +function conv2DBackpropInput_(xShape, dy, filter, strides, pad32, dataFormat = "NHWC", dimRoundingMode) { assert(xShape.length === dy.rank, () => `Length of inShape (${xShape.length}) and rank of dy (${dy.rank}) must match`); let xShape4D = xShape; let dy4D = dy; @@ -12006,10 +14173,10 @@ function conv2DBackpropInput_(xShape, dy, filter, strides, pad3, dataFormat = "N assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must match input depth for filter ${filter.shape[2]}.`); assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must match output depth for filter ${filter.shape[3]}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad: pad3, dataFormat, dimRoundingMode, inputShape: xShape4D }; + const attrs = { strides, pad: pad32, dataFormat, dimRoundingMode, inputShape: xShape4D }; const res = ENGINE.runKernel(Conv2DBackpropInput, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -12017,13 +14184,13 @@ function conv2DBackpropInput_(xShape, dy, filter, strides, pad3, dataFormat = "N return res; } var conv2DBackpropInput = op({ conv2DBackpropInput_ }); -function conv2dTranspose_(x, filter, outputShape, strides, pad3, dimRoundingMode) { +function conv2dTranspose_(x, filter, outputShape, strides, pad32, dimRoundingMode) { const $x = convertToTensor(x, "x", "conv2dTranspose"); const $filter = convertToTensor(filter, "filter", "conv2dTranspose"); - return conv2DBackpropInput(outputShape, $x, $filter, strides, pad3, "NHWC", dimRoundingMode); + return conv2DBackpropInput(outputShape, $x, $filter, strides, pad32, "NHWC", dimRoundingMode); } var conv2dTranspose = op({ conv2dTranspose_ }); -function conv3d_(x, filter, strides, pad3, dataFormat = "NDHWC", dilations = [1, 1, 1]) { +function conv3d_(x, filter, strides, pad32, dataFormat = "NDHWC", dilations = [1, 1, 1]) { const $x = convertToTensor(x, "x", "conv3d"); const $filter = convertToTensor(filter, "filter", "conv3d"); let x5D = $x; @@ -12038,7 +14205,7 @@ function conv3d_(x, filter, strides, pad3, dataFormat = "NDHWC", dilations = [1, assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in conv3D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); assert(dataFormat === "NDHWC", () => `Error in conv3d: got dataFormat of ${dataFormat} but only NDHWC is currently supported.`); const inputs = { x: x5D, filter: $filter }; - const attrs = { strides, pad: pad3, dataFormat, dilations }; + const attrs = { strides, pad: pad32, dataFormat, dilations }; const res = ENGINE.runKernel(Conv3D, inputs, attrs); if (reshapedTo5D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); @@ -12046,7 +14213,7 @@ function conv3d_(x, filter, strides, pad3, dataFormat = "NDHWC", dilations = [1, return res; } var conv3d = op({ conv3d_ }); -function conv3DBackpropInput_(xShape, dy, filter, strides, pad3) { +function conv3DBackpropInput_(xShape, dy, filter, strides, pad32) { assert(xShape.length === dy.rank, () => `Length of inShape (${xShape.length}) and rank of dy (${dy.rank}) must match`); let xShape5D = xShape; let dy5D = dy; @@ -12064,7 +14231,7 @@ function conv3DBackpropInput_(xShape, dy, filter, strides, pad3) { assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must match input depth for filter ${filter.shape[3]}.`); assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must match output depth for filter ${filter.shape[4]}.`); const inputs = { dy: dy5D, filter }; - const attrs = { pad: pad3, strides, inputShape: xShape5D }; + const attrs = { pad: pad32, strides, inputShape: xShape5D }; const res = ENGINE.runKernel(Conv3DBackpropInputV2, inputs, attrs); if (reshapedTo5D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); @@ -12072,10 +14239,10 @@ function conv3DBackpropInput_(xShape, dy, filter, strides, pad3) { return res; } var conv3DBackpropInput = op({ conv3DBackpropInput_ }); -function conv3dTranspose_(x, filter, outputShape, strides, pad3) { +function conv3dTranspose_(x, filter, outputShape, strides, pad32) { const $x = convertToTensor(x, "x", "conv3dTranspose"); const $filter = convertToTensor(filter, "filter", "conv3dTranspose"); - return conv3DBackpropInput(outputShape, $x, $filter, strides, pad3); + return conv3DBackpropInput(outputShape, $x, $filter, strides, pad32); } var conv3dTranspose = op({ conv3dTranspose_ }); function cos_(x) { @@ -12090,10 +14257,10 @@ function cosh_(x) { return ENGINE.runKernel(Cosh, inputs); } var cosh = op({ cosh_ }); -function cumsum_(x, axis = 0, exclusive = false, reverse5 = false) { +function cumsum_(x, axis = 0, exclusive = false, reverse52 = false) { const $x = convertToTensor(x, "x", "cumsum"); const inputs = { x: $x }; - const attrs = { axis, exclusive, reverse: reverse5 }; + const attrs = { axis, exclusive, reverse: reverse52 }; return ENGINE.runKernel(Cumsum, inputs, attrs); } var cumsum = op({ cumsum_ }); @@ -12126,7 +14293,7 @@ function depthToSpace_(x, blockSize, dataFormat = "NHWC") { return ENGINE.runKernel(DepthToSpace, inputs, attrs); } var depthToSpace = op({ depthToSpace_ }); -function depthwiseConv2d_(x, filter, strides, pad3, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { +function depthwiseConv2d_(x, filter, strides, pad32, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { const $x = convertToTensor(x, "x", "depthwiseConv2d"); const $filter = convertToTensor(filter, "filter", "depthwiseConv2d"); let x4D = $x; @@ -12139,10 +14306,10 @@ function depthwiseConv2d_(x, filter, strides, pad3, dataFormat = "NHWC", dilatio assert($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ${$filter.rank}.`); assert(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels (${x4D.shape[3]}) must match the inChannels dimension in filter ${$filter.shape[2]}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad: pad3, dataFormat, dilations, dimRoundingMode }; + const attrs = { strides, pad: pad32, dataFormat, dilations, dimRoundingMode }; const res = ENGINE.runKernel(DepthwiseConv2dNative, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -12156,7 +14323,7 @@ function diag_(x) { return ENGINE.runKernel(Diag, inputs); } var diag = op({ diag_ }); -function dilation2d_(x, filter, strides, pad3, dilations = [1, 1], dataFormat = "NHWC") { +function dilation2d_(x, filter, strides, pad32, dilations = [1, 1], dataFormat = "NHWC") { const $x = convertToTensor(x, "x", "dilation2d"); const $filter = convertToTensor(filter, "filter", "dilation2d"); assert($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ${$x.rank}.`); @@ -12169,7 +14336,7 @@ function dilation2d_(x, filter, strides, pad3, dilations = [1, 1], dataFormat = reshapedTo4D = true; } const inputs = { x: x4D, filter: $filter }; - const attrs = { strides, pad: pad3, dilations }; + const attrs = { strides, pad: pad32, dilations }; const res = ENGINE.runKernel(Dilation2D, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -12263,9 +14430,9 @@ function divNoNan_(a, b) { let $b = convertToTensor(b, "b", "div"); [$a, $b] = makeTypesMatch($a, $b); const divResult = div($a, $b); - const zeros4 = zerosLike(divResult); - const bEqualsZero = equal($b, zeros4); - return where(bEqualsZero, zeros4, divResult); + const zeros42 = zerosLike(divResult); + const bEqualsZero = equal($b, zeros42); + return where(bEqualsZero, zeros42, divResult); } var divNoNan = op({ divNoNan_ }); function dot_(t1, t2) { @@ -12413,8 +14580,8 @@ function greaterEqual_(a, b) { return ENGINE.runKernel(GreaterEqual, inputs); } var greaterEqual = op({ greaterEqual_ }); -function imag_(input2) { - const $input = convertToTensor(input2, "input", "imag"); +function imag_(input22) { + const $input = convertToTensor(input22, "input", "imag"); const inputs = { input: $input }; return ENGINE.runKernel(Imag, inputs); } @@ -12566,9 +14733,9 @@ function variableGrads(f, varList) { varList.push(ENGINE.registeredVariables[varName]); } } - const specifiedNonTrainable = specifiedVarList ? varList.filter((variable2) => !variable2.trainable) : null; + const specifiedNonTrainable = specifiedVarList ? varList.filter((variable22) => !variable22.trainable) : null; const originalVarCount = varList.length; - varList = varList.filter((variable2) => variable2.trainable); + varList = varList.filter((variable22) => variable22.trainable); assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to be trainable, but none of the ${originalVarCount} variables is trainable.`); const allowNoGradients = true; const { value, grads: grads2 } = ENGINE.gradients(f, varList, null, allowNoGradients); @@ -12662,8 +14829,8 @@ function logSoftmax_(logits, axis = -1) { const gradFunc = (dy, saved) => { const [value2] = saved; const keepDims2 = true; - const softmax6 = exp(value2); - return sub(dy, mul(sum2(dy, axis, keepDims2), softmax6)); + const softmax62 = exp(value2); + return sub(dy, mul(sum2(dy, axis, keepDims2), softmax62)); }; return { value, gradFunc }; }); @@ -12778,7 +14945,7 @@ function logicalXor_(a, b) { return logicalAnd(logicalOr(a, b), logicalNot(logicalAnd(a, b))); } var logicalXor = op({ logicalXor_ }); -function maxPool_(x, filterSize, strides, pad3, dimRoundingMode) { +function maxPool_(x, filterSize, strides, pad32, dimRoundingMode) { const $x = convertToTensor(x, "x", "maxPool"); const dilations = 1; let x4D = $x; @@ -12790,10 +14957,10 @@ function maxPool_(x, filterSize, strides, pad3, dimRoundingMode) { assert(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in maxPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in maxPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x4D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode }; const res = ENGINE.runKernel(MaxPool, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -12801,7 +14968,7 @@ function maxPool_(x, filterSize, strides, pad3, dimRoundingMode) { return res; } var maxPool = op({ maxPool_ }); -function maxPool3d_(x, filterSize = [1, 1, 1], strides, pad3, dimRoundingMode, dataFormat = "NDHWC") { +function maxPool3d_(x, filterSize = [1, 1, 1], strides, pad32, dimRoundingMode, dataFormat = "NDHWC") { const $x = convertToTensor(x, "x", "maxPool3d"); let x5D = $x; let reshapedTo5D = false; @@ -12812,10 +14979,10 @@ function maxPool3d_(x, filterSize = [1, 1, 1], strides, pad3, dimRoundingMode, d assert(x5D.rank === 5, () => `Error in maxPool3d: x must be rank 5 but got rank ${x5D.rank}.`); assert(dataFormat === "NDHWC", () => `Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${dataFormat}`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x5D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode, dataFormat }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode, dataFormat }; const res = ENGINE.runKernel(MaxPool3D, inputs, attrs); if (reshapedTo5D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); @@ -12823,10 +14990,10 @@ function maxPool3d_(x, filterSize = [1, 1, 1], strides, pad3, dimRoundingMode, d return res; } var maxPool3d = op({ maxPool3d_ }); -function maxPoolWithArgmax_(x, filterSize, strides, pad3, includeBatchInIndex = false) { +function maxPoolWithArgmax_(x, filterSize, strides, pad32, includeBatchInIndex = false) { const $x = convertToTensor(x, "x", "maxPoolWithArgmax"); const inputs = { x: $x }; - const attrs = { filterSize, strides, pad: pad3, includeBatchInIndex }; + const attrs = { filterSize, strides, pad: pad32, includeBatchInIndex }; const result = ENGINE.runKernel(MaxPoolWithArgmax, inputs, attrs); return { result: result[0], indexes: result[1] }; } @@ -12853,18 +15020,18 @@ function mean_(x, axis = null, keepDims = false) { var mean = op({ mean_ }); function zeros(shape, dtype = "float32") { if (dtype === "complex64") { - const real4 = zeros(shape, "float32"); - const imag4 = zeros(shape, "float32"); - return complex(real4, imag4); + const real42 = zeros(shape, "float32"); + const imag42 = zeros(shape, "float32"); + return complex(real42, imag42); } const values = makeZerosTypedArray(sizeFromShape(shape), dtype); return ENGINE.makeTensor(values, shape, dtype); } function ones2(shape, dtype = "float32") { if (dtype === "complex64") { - const real4 = ones2(shape, "float32"); - const imag4 = zeros(shape, "float32"); - return complex(real4, imag4); + const real42 = ones2(shape, "float32"); + const imag42 = zeros(shape, "float32"); + return complex(real42, imag42); } const values = makeOnesTypedArray(sizeFromShape(shape), dtype); return ENGINE.makeTensor(values, shape, dtype); @@ -12966,13 +15133,13 @@ function multiRNNCell_(lstmCells, data, c, h) { const $data = convertToTensor(data, "data", "multiRNNCell"); const $c = convertToTensorArray(c, "c", "multiRNNCell"); const $h = convertToTensorArray(h, "h", "multiRNNCell"); - let input2 = $data; + let input22 = $data; const newStates = []; for (let i = 0; i < lstmCells.length; i++) { - const output = lstmCells[i](input2, $c[i], $h[i]); + const output = lstmCells[i](input22, $c[i], $h[i]); newStates.push(output[0]); newStates.push(output[1]); - input2 = output[1]; + input22 = output[1]; } const newC = []; const newH = []; @@ -13070,17 +15237,17 @@ function spaceToBatchND_(x, blockShape, paddings) { return ENGINE.runKernel(SpaceToBatchND, inputs, attrs); } var spaceToBatchND = op({ spaceToBatchND_ }); -function pool_(input2, windowShape, poolingType, pad3, dilations, strides) { +function pool_(input22, windowShape, poolingType, pad32, dilations, strides) { if (dilations == null) { dilations = [1, 1]; } if (strides == null) { strides = 1; } - if (pad3 === 0) { - pad3 = "valid"; + if (pad32 === 0) { + pad32 = "valid"; } - const $x = convertToTensor(input2, "x", "maxPool"); + const $x = convertToTensor(input22, "x", "maxPool"); let x4D = $x; let reshapedTo4D = false; if ($x.rank === 3) { @@ -13088,17 +15255,17 @@ function pool_(input2, windowShape, poolingType, pad3, dilations, strides) { x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); } assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in pool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad3); + const convInfo = computePool2DInfo(x4D.shape, windowShape, strides, dilations, pad32); const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; let basePadding; - if (pad3 === "same") { + if (pad32 === "same") { basePadding = withSpaceToBatchBasePaddings([convInfo.filterHeight, convInfo.filterWidth], dilation); } else { basePadding = [[0, 0], [0, 0]]; } const isDilationOne = dilation[0] === 1 && dilation[1] === 1; const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); - const convertedPad = isDilationOne ? pad3 : "valid"; + const convertedPad = isDilationOne ? pad32 : "valid"; const convertedX = isDilationOne ? x4D : spaceToBatchND(x4D, dilation, adjustedPadding); const forwardOp = poolingType === "avg" ? () => avgPool(convertedX, windowShape, strides, convertedPad) : () => maxPool(convertedX, windowShape, strides, convertedPad); const y = forwardOp(); @@ -13130,9 +15297,9 @@ function withSpaceToBatchBasePaddings(filterShape, dilation) { }); } var pool = op({ pool_ }); -function pow_(base2, exp4) { +function pow_(base2, exp42) { let $base = convertToTensor(base2, "base", "pow"); - let $exp = convertToTensor(exp4, "exp", "pow"); + let $exp = convertToTensor(exp42, "exp", "pow"); [$base, $exp] = makeTypesMatch($base, $exp); const inputs = { a: $base, b: $exp }; return ENGINE.runKernel(Pow, inputs); @@ -13173,10 +15340,10 @@ function rand_(shape, randFunction, dtype) { return ENGINE.makeTensor(values, shape, dtype); } var rand = op({ rand_ }); -var seedrandom = __toModule(require_seedrandom2()); +var seedrandom = __toModule2(require_seedrandom2()); var MPRandGauss = class { - constructor(mean4, stdDeviation, dtype, truncated, seed) { - this.mean = mean4; + constructor(mean42, stdDeviation, dtype, truncated, seed) { + this.mean = mean42; this.stdDev = stdDeviation; this.dtype = dtype; this.nextVal = NaN; @@ -13203,9 +15370,9 @@ var MPRandGauss = class { v2 = 2 * this.random() - 1; s = v1 * v1 + v2 * v2; } while (s >= 1 || s === 0); - const mul2 = Math.sqrt(-2 * Math.log(s) / s); - resultX = this.mean + this.stdDev * v1 * mul2; - resultY = this.mean + this.stdDev * v2 * mul2; + const mul22 = Math.sqrt(-2 * Math.log(s) / s); + resultX = this.mean + this.stdDev * v1 * mul22; + resultY = this.mean + this.stdDev * v2 * mul22; if (!this.truncated || this.isValidTruncated(resultX)) { isValid = true; } @@ -13270,10 +15437,10 @@ var RandGamma = class { } }; var UniformRandom = class { - constructor(min6 = 0, max6 = 1, dtype, seed) { + constructor(min62 = 0, max62 = 1, dtype, seed) { this.canReturnFloat = () => this.dtype == null || this.dtype === "float32"; - this.min = min6; - this.range = max6 - min6; + this.min = min62; + this.range = max62 - min62; this.dtype = dtype; if (seed == null) { seed = Math.random(); @@ -13282,7 +15449,7 @@ var UniformRandom = class { seed = seed.toString(); } if (!this.canReturnFloat() && this.range <= 1) { - throw new Error(`The difference between ${min6} - ${max6} <= 1 and dtype is not float`); + throw new Error(`The difference between ${min62} - ${max62} <= 1 and dtype is not float`); } this.random = seedrandom.alea(seed); } @@ -13314,11 +15481,11 @@ function randomGamma_(shape, alpha, beta = 1, dtype = "float32", seed) { return res.toTensor(); } var randomGamma = op({ randomGamma_ }); -function randomNormal_(shape, mean4 = 0, stdDev = 1, dtype, seed) { +function randomNormal_(shape, mean42 = 0, stdDev = 1, dtype, seed) { if (dtype != null && dtype === "bool") { throw new Error(`Unsupported data type ${dtype}`); } - const randGauss = new MPRandGauss(mean4, stdDev, dtype, false, seed); + const randGauss = new MPRandGauss(mean42, stdDev, dtype, false, seed); const res = buffer(shape, dtype); for (let i = 0; i < res.values.length; i++) { res.values[i] = randGauss.nextValue(); @@ -13335,15 +15502,15 @@ function randomUniform_(shape, minval = 0, maxval = 1, dtype = "float32", seed) return res.toTensor(); } var randomUniform = op({ randomUniform_ }); -function range(start, stop, step5 = 1, dtype = "float32") { - if (step5 === 0) { +function range(start, stop, step52 = 1, dtype = "float32") { + if (step52 === 0) { throw new Error("Cannot have a step of zero"); } - const attrs = { start, stop, step: step5, dtype }; + const attrs = { start, stop, step: step52, dtype }; return ENGINE.runKernel(Range, {}, attrs); } -function real_(input2) { - const $input = convertToTensor(input2, "input", "real"); +function real_(input22) { + const $input = convertToTensor(input22, "input", "real"); const inputs = { input: $input }; return ENGINE.runKernel(Real, inputs); } @@ -13426,7 +15593,7 @@ function selu_(x) { return ENGINE.runKernel(Selu, inputs); } var selu = op({ selu_ }); -function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad3, dilation = [1, 1], dataFormat = "NHWC") { +function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad32, dilation = [1, 1], dataFormat = "NHWC") { const $x = convertToTensor(x, "x", "separableConv2d"); const $depthwiseFilter = convertToTensor(depthwiseFilter, "depthwiseFilter", "separableConv2d"); const $pointwiseFilter = convertToTensor(pointwiseFilter, "pointwiseFilter", "separableConv2d"); @@ -13447,7 +15614,7 @@ function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad3, di const inChannels = $depthwiseFilter.shape[2]; const channelMultiplier = $depthwiseFilter.shape[3]; assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter must be ${inChannels * channelMultiplier}, but got ${$pointwiseFilter.shape[2]}.`); - const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad3, dataFormat, dilation); + const depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad32, dataFormat, dilation); const pointwiseStride = 1; const res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, "valid", dataFormat); if (reshapedTo4D) { @@ -13465,22 +15632,22 @@ async function setdiff1dAsync_(x, y) { const xVals = await $x.data(); const yVals = await $y.data(); const ySet = new Set(yVals); - let outputSize3 = 0; + let outputSize2 = 0; for (let i = 0; i < xVals.length; i++) { if (!ySet.has(xVals[i])) { - outputSize3++; + outputSize2++; } } - const buffer2 = new TensorBuffer([outputSize3], $x.dtype); - const indices = new TensorBuffer([outputSize3], "int32"); - for (let i = 0, p2 = 0; i < xVals.length; i++) { + const buffer22 = new TensorBuffer([outputSize2], $x.dtype); + const indices = new TensorBuffer([outputSize2], "int32"); + for (let i = 0, p22 = 0; i < xVals.length; i++) { if (!ySet.has(xVals[i])) { - buffer2.values[p2] = xVals[i]; - indices.values[p2] = i; - p2++; + buffer22.values[p22] = xVals[i]; + indices.values[p22] = i; + p22++; } } - return [buffer2.toTensor(), indices.toTensor()]; + return [buffer22.toTensor(), indices.toTensor()]; } var setdiff1dAsync = setdiff1dAsync_; function sign_(x) { @@ -13538,29 +15705,29 @@ function softmax_(logits, dim = -1) { return ENGINE.runKernel(Softmax, inputs, attrs); } var softmax = op({ softmax_ }); -function fft_(input2) { - assert(input2.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${input2.dtype}.`); - const inputs = { input: input2 }; +function fft_(input22) { + assert(input22.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${input22.dtype}.`); + const inputs = { input: input22 }; return ENGINE.runKernel(FFT, inputs); } var fft = op({ fft_ }); -function ifft_(input2) { - assert(input2.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${input2.dtype}.`); - const inputs = { input: input2 }; +function ifft_(input22) { + assert(input22.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${input22.dtype}.`); + const inputs = { input: input22 }; return ENGINE.runKernel(IFFT, inputs); } var ifft = op({ ifft_ }); -function irfft_(input2) { - const innerDimensionSize = input2.shape[input2.shape.length - 1]; - const batch = input2.size / innerDimensionSize; +function irfft_(input22) { + const innerDimensionSize = input22.shape[input22.shape.length - 1]; + const batch = input22.size / innerDimensionSize; let ret; if (innerDimensionSize <= 2) { - const complexInput = reshape(input2, [batch, innerDimensionSize]); + const complexInput = reshape(input22, [batch, innerDimensionSize]); ret = ifft(complexInput); } else { const outputShape = [batch, 2 * (innerDimensionSize - 1)]; - const realInput = reshape(real(input2), [batch, innerDimensionSize]); - const imagInput = reshape(imag(input2), [batch, innerDimensionSize]); + const realInput = reshape(real(input22), [batch, innerDimensionSize]); + const imagInput = reshape(imag(input22), [batch, innerDimensionSize]); const realConjugate = reverse(slice(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); const imagConjugate = mul(reverse(slice(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar(-1)); const r = concat([realInput, realConjugate], 1); @@ -13569,9 +15736,9 @@ function irfft_(input2) { ret = ifft(complexInput); } ret = real(ret); - if (input2.rank === 3 && input2.shape[0] !== 0) { + if (input22.rank === 3 && input22.shape[0] !== 0) { const temp = ret; - const batch2 = input2.shape[0]; + const batch2 = input22.shape[0]; ret = reshape(ret, [batch2, ret.shape[0] / batch2, ret.shape[1]]); temp.dispose(); } @@ -13585,24 +15752,24 @@ function split_(x, numOrSizeSplits, axis = 0) { return ENGINE.runKernel(SplitV, inputs, attr); } var split = op({ split_ }); -function rfft_(input2, fftLength) { - assert(input2.dtype === "float32", () => `The dtype for rfft() must be real value but got ${input2.dtype}`); - let innerDimensionSize = input2.shape[input2.shape.length - 1]; - const batch = input2.size / innerDimensionSize; +function rfft_(input22, fftLength) { + assert(input22.dtype === "float32", () => `The dtype for rfft() must be real value but got ${input22.dtype}`); + let innerDimensionSize = input22.shape[input22.shape.length - 1]; + const batch = input22.size / innerDimensionSize; let adjustedInput; if (fftLength != null && fftLength < innerDimensionSize) { - const begin = input2.shape.map((v) => 0); - const size2 = input2.shape.map((v) => v); - size2[input2.shape.length - 1] = fftLength; - adjustedInput = slice(input2, begin, size2); + const begin = input22.shape.map((v) => 0); + const size2 = input22.shape.map((v) => v); + size2[input22.shape.length - 1] = fftLength; + adjustedInput = slice(input22, begin, size2); innerDimensionSize = fftLength; } else if (fftLength != null && fftLength > innerDimensionSize) { - const zerosShape = input2.shape.map((v) => v); - zerosShape[input2.shape.length - 1] = fftLength - innerDimensionSize; - adjustedInput = concat([input2, zeros(zerosShape)], input2.shape.length - 1); + const zerosShape = input22.shape.map((v) => v); + zerosShape[input22.shape.length - 1] = fftLength - innerDimensionSize; + adjustedInput = concat([input22, zeros(zerosShape)], input22.shape.length - 1); innerDimensionSize = fftLength; } else { - adjustedInput = input2; + adjustedInput = input22; } const zerosInput = zerosLike(adjustedInput); const complexInput = reshape(complex(adjustedInput, zerosInput), [batch, innerDimensionSize]); @@ -13762,11 +15929,11 @@ function topk_(x, k = 1, sorted = true) { return { values, indices }; } var topk = op({ topk_ }); -function truncatedNormal_(shape, mean4 = 0, stdDev = 1, dtype, seed) { +function truncatedNormal_(shape, mean42 = 0, stdDev = 1, dtype, seed) { if (dtype != null && dtype === "bool") { throw new Error(`Unsupported data type $ { dtype }`); } - const randGauss = new MPRandGauss(mean4, stdDev, dtype, true, seed); + const randGauss = new MPRandGauss(mean42, stdDev, dtype, true, seed); const res = buffer(shape, dtype); for (let i = 0; i < res.values.length; i++) { res.values[i] = randGauss.nextValue(); @@ -13829,8 +15996,8 @@ async function whereAsync_(condition) { return res; } var whereAsync = whereAsync_; -async function booleanMaskAsync_(tensor2, mask, axis) { - const $tensor = convertToTensor(tensor2, "tensor", "boolMask"); +async function booleanMaskAsync_(tensor22, mask, axis) { + const $tensor = convertToTensor(tensor22, "tensor", "boolMask"); const $mask = convertToTensor(mask, "mask", "boolMask", "bool"); const axisFrom = axis == null ? 0 : axis; const maskDim = $mask.rank; @@ -13847,7 +16014,7 @@ async function booleanMaskAsync_(tensor2, mask, axis) { const positivePositions = await whereAsync(reshapedMask); const indices = squeeze(positivePositions, [1]); const res = gather(reshapedTensor, indices, axisFrom); - if (tensor2 !== $tensor) { + if (tensor22 !== $tensor) { $tensor.dispose(); } if (mask !== $mask) { @@ -13862,55 +16029,55 @@ async function booleanMaskAsync_(tensor2, mask, axis) { var booleanMaskAsync = booleanMaskAsync_; function norm_(x, ord = "euclidean", axis = null, keepDims = false) { x = convertToTensor(x, "x", "norm"); - const norm2 = normImpl(x, ord, axis); - let keepDimsShape = norm2.shape; + const norm22 = normImpl(x, ord, axis); + let keepDimsShape = norm22.shape; if (keepDims) { const axes = parseAxisParam(axis, x.shape); - keepDimsShape = expandShapeToKeepDim(norm2.shape, axes); + keepDimsShape = expandShapeToKeepDim(norm22.shape, axes); } - return reshape(norm2, keepDimsShape); + return reshape(norm22, keepDimsShape); } -function normImpl(x, p2, axis = null) { +function normImpl(x, p22, axis = null) { if (x.rank === 0) { return abs(x); } if (x.rank !== 1 && axis === null) { - return normImpl(reshape(x, [-1]), p2, axis); + return normImpl(reshape(x, [-1]), p22, axis); } if (x.rank === 1 || typeof axis === "number" || Array.isArray(axis) && axis.length === 1) { - if (p2 === 1) { + if (p22 === 1) { return sum2(abs(x), axis); } - if (p2 === Infinity) { + if (p22 === Infinity) { return max(abs(x), axis); } - if (p2 === -Infinity) { + if (p22 === -Infinity) { return min(abs(x), axis); } - if (p2 === "euclidean" || p2 === 2) { + if (p22 === "euclidean" || p22 === 2) { return sqrt(sum2(pow(abs(x), scalar(2, "int32")), axis)); } - throw new Error(`Error in norm: invalid ord value: ${p2}`); + throw new Error(`Error in norm: invalid ord value: ${p22}`); } if (Array.isArray(axis) && axis.length === 2) { - if (p2 === 1) { + if (p22 === 1) { return max(sum2(abs(x), axis[0]), axis[1] - 1); } - if (p2 === Infinity) { + if (p22 === Infinity) { return max(sum2(abs(x), axis[1]), axis[0]); } - if (p2 === -Infinity) { + if (p22 === -Infinity) { return min(sum2(abs(x), axis[1]), axis[0]); } - if (p2 === "fro" || p2 === "euclidean") { + if (p22 === "fro" || p22 === "euclidean") { return sqrt(sum2(square(x), axis)); } - throw new Error(`Error in norm: invalid ord value: ${p2}`); + throw new Error(`Error in norm: invalid ord value: ${p22}`); } throw new Error(`Error in norm: invalid axis: ${axis}`); } var norm = op({ norm_ }); -function movingAverage_(v, x, decay, step5, zeroDebias = true) { +function movingAverage_(v, x, decay, step52, zeroDebias = true) { const $v = convertToTensor(v, "v", "movingAverage"); const $x = convertToTensor(x, "x", "movingAverage"); const $decay = convertToTensor(decay, "decay", "movingAverage"); @@ -13920,8 +16087,8 @@ function movingAverage_(v, x, decay, step5, zeroDebias = true) { const oneMinusDecay = sub(one, $decay); let update = mul(sub($x, $v), oneMinusDecay); if (zeroDebias) { - assert(step5 != null, () => "When using zeroDebias: true, step is required."); - const $step = convertToTensor(step5, "step", "movingAverage"); + assert(step52 != null, () => "When using zeroDebias: true, step is required."); + const $step = convertToTensor(step52, "step", "movingAverage"); update = div(update, sub(one, pow($decay, $step))); } return add2($v, update); @@ -14033,7 +16200,7 @@ async function inTopKAsync_(predictions, targets, k = 1) { const predictionsVals = await $predictions.data(); const targetsVals = await $targets.data(); const [batch, size2] = [predictionsVals.length / lastDim, lastDim]; - const precision3 = getTypedArrayFromDType("bool", batch); + const precision32 = getTypedArrayFromDType("bool", batch); for (let b = 0; b < batch; b++) { const offset = b * size2; const vals = predictionsVals.subarray(offset, offset + size2); @@ -14042,10 +16209,10 @@ async function inTopKAsync_(predictions, targets, k = 1) { valAndInd.push({ value: vals[i], index: i }); } valAndInd.sort((a, b2) => b2.value - a.value); - precision3[b] = 0; + precision32[b] = 0; for (let i = 0; i < k; i++) { if (valAndInd[i].index === targetsVals[b]) { - precision3[b] = 1; + precision32[b] = 1; break; } } @@ -14056,7 +16223,7 @@ async function inTopKAsync_(predictions, targets, k = 1) { if (targets !== $targets) { $targets.dispose(); } - return tensor(precision3, $targets.shape, "bool"); + return tensor(precision32, $targets.shape, "bool"); } var inTopKAsync = inTopKAsync_; var fused_ops_exports = {}; @@ -14065,7 +16232,7 @@ __export2(fused_ops_exports, { depthwiseConv2d: () => depthwiseConv2d2, matMul: () => matMul2 }); -function conv2DBackpropFilter_(x, dy, filterShape, strides, pad3, dataFormat = "NHWC", dimRoundingMode) { +function conv2DBackpropFilter_(x, dy, filterShape, strides, pad32, dataFormat = "NHWC", dimRoundingMode) { let x4D = x; if (x.rank === 3) { x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); @@ -14082,10 +16249,10 @@ function conv2DBackpropFilter_(x, dy, filterShape, strides, pad3, dataFormat = " assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must match input depth in filter (${filterShape[2]}.`); assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must match output depth for filter (${filterShape[3]}).`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad: pad3, dataFormat, dimRoundingMode, filterShape }; + const attrs = { strides, pad: pad32, dataFormat, dimRoundingMode, filterShape }; return ENGINE.runKernel(Conv2DBackpropFilter, inputs, attrs); } var conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); @@ -14128,10 +16295,10 @@ var shouldFuse = (gradientDepth, activation2) => { const gradientMode = gradientDepth > 0; return !gradientMode || activation2 === "linear"; }; -function fusedConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { +function fusedConv2d_({ x, filter, strides, pad: pad32, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { activation2 = activation2 || "linear"; if (shouldFuse(ENGINE.state.gradientDepth, activation2) === false) { - let result = conv2d(x, filter, strides, pad3, dataFormat, dilations, dimRoundingMode); + let result = conv2d(x, filter, strides, pad32, dataFormat, dilations, dimRoundingMode); if (bias != null) { result = add2(result, bias); } @@ -14148,12 +16315,12 @@ function fusedConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dila assert(x4D.rank === 4, () => `Error in fused conv2d: input must be rank 4, but got rank ${x4D.rank}.`); assert($filter.rank === 4, () => `Error in fused conv2d: filter must be rank 4, but got rank ${$filter.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } assert(x4D.shape[3] === $filter.shape[2], () => `Error in conv2d: depth of input (${x4D.shape[3]}) must match input depth for filter ${$filter.shape[2]}.`); assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); assert(dataFormat === "NHWC", () => `Error in conv2d: got dataFormat of ${dataFormat} but only NHWC is currently supported.`); - const convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad3, dimRoundingMode); + const convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad32, dimRoundingMode); let $bias; if (bias != null) { $bias = convertToTensor(bias, "bias", "fused conv2d"); @@ -14168,8 +16335,8 @@ function fusedConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dila const [$filter2, x4D2, y, $bias2] = saved; const dyActivation = getFusedDyActivation(dy, y, activation2); assert(tupleValuesAreOne(dilations), () => `Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); - const xDer = conv2DBackpropInput(x4D2.shape, dyActivation, $filter2, strides, pad3); - const filterDer = conv2DBackpropFilter(x4D2, dyActivation, $filter2.shape, strides, pad3); + const xDer = conv2DBackpropInput(x4D2.shape, dyActivation, $filter2, strides, pad32); + const filterDer = conv2DBackpropFilter(x4D2, dyActivation, $filter2.shape, strides, pad32); const der = [xDer, filterDer]; if ($bias2 != null) { const biasDer = getFusedBiasGradient($bias2, dyActivation); @@ -14185,7 +16352,7 @@ function fusedConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dila }; const attrs = { strides, - pad: pad3, + pad: pad32, dataFormat, dilations, dimRoundingMode, @@ -14215,7 +16382,7 @@ function fusedConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dila } } var conv2d2 = op({ fusedConv2d_ }); -function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad3, dilations = [1, 1], dimRoundingMode) { +function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad32, dilations = [1, 1], dimRoundingMode) { let x4D = x; if (x.rank === 3) { x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); @@ -14225,11 +16392,11 @@ function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, strides, pad3, dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); } const inputs = { x: x4D, dy: dy4D }; - const attrs = { strides, pad: pad3, dimRoundingMode, dilations, filterShape }; + const attrs = { strides, pad: pad32, dimRoundingMode, dilations, filterShape }; return ENGINE.runKernel(DepthwiseConv2dNativeBackpropFilter, inputs, attrs); } var depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); -function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad3, dilations = [1, 1], dimRoundingMode) { +function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad32, dilations = [1, 1], dimRoundingMode) { let dy4D = dy; let reshapedTo4D = false; if (dy.rank === 3) { @@ -14237,7 +16404,7 @@ function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad3, dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); } const inputs = { dy: dy4D, filter }; - const attrs = { strides, pad: pad3, dimRoundingMode, dilations, inputShape: xShape }; + const attrs = { strides, pad: pad32, dimRoundingMode, dilations, inputShape: xShape }; const res = ENGINE.runKernel(DepthwiseConv2dNativeBackpropInput, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -14245,9 +16412,9 @@ function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, strides, pad3, return res; } var depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); -function fusedDepthwiseConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { +function fusedDepthwiseConv2d_({ x, filter, strides, pad: pad32, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { if (shouldFuse(ENGINE.state.gradientDepth, activation2) === false) { - let result = depthwiseConv2d(x, filter, strides, pad3, dataFormat, dilations, dimRoundingMode); + let result = depthwiseConv2d(x, filter, strides, pad32, dataFormat, dilations, dimRoundingMode); if (bias != null) { result = add2(result, bias); } @@ -14269,9 +16436,9 @@ function fusedDepthwiseConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NH } assert(eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } - const convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad3, dimRoundingMode, true); + const convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad32, dimRoundingMode, true); let $bias; if (bias != null) { $bias = convertToTensor(bias, "bias", "fused conv2d"); @@ -14286,8 +16453,8 @@ function fusedDepthwiseConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NH assert(tupleValuesAreOne(dilations), () => `Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${dilations}'`); const [$filter2, x4D2, y, bias2] = saved; const dyActivation = getFusedDyActivation(dy, y, activation2); - const xDer = depthwiseConv2dNativeBackpropInput(x4D2.shape, dyActivation, $filter2, strides, pad3, dilations, dimRoundingMode); - const filterDer = depthwiseConv2dNativeBackpropFilter(x4D2, dyActivation, $filter2.shape, strides, pad3, dilations, dimRoundingMode); + const xDer = depthwiseConv2dNativeBackpropInput(x4D2.shape, dyActivation, $filter2, strides, pad32, dilations, dimRoundingMode); + const filterDer = depthwiseConv2dNativeBackpropFilter(x4D2, dyActivation, $filter2.shape, strides, pad32, dilations, dimRoundingMode); if (bias2 != null) { const biasDer = getFusedBiasGradient($bias, dyActivation); return [xDer, filterDer, biasDer]; @@ -14302,7 +16469,7 @@ function fusedDepthwiseConv2d_({ x, filter, strides, pad: pad3, dataFormat = "NH }; const attrs = { strides, - pad: pad3, + pad: pad32, dataFormat, dilations, dimRoundingMode, @@ -14434,11 +16601,11 @@ function frame_(signal2, frameLength, frameStep, padEnd = false, padValue = 0) { if (padEnd) { while (start < signal2.size) { const padLen = start + frameLength - signal2.size; - const pad3 = concat([ + const pad32 = concat([ slice(signal2, start, frameLength - padLen), fill([padLen], padValue) ]); - output.push(pad3); + output.push(pad32); start += frameStep; } } @@ -15102,7 +17269,7 @@ function huberLoss_(labels2, predictions, weights, delta = 1, reduction2 = Reduc return computeWeightedLoss(losses4, $weights, reduction2); } var huberLoss = op({ huberLoss_ }); -function logLoss_(labels2, predictions, weights, epsilon3 = 1e-7, reduction2 = Reduction.SUM_BY_NONZERO_WEIGHTS) { +function logLoss_(labels2, predictions, weights, epsilon32 = 1e-7, reduction2 = Reduction.SUM_BY_NONZERO_WEIGHTS) { const $labels = convertToTensor(labels2, "labels", "logLoss"); const $predictions = convertToTensor(predictions, "predictions", "logLoss"); let $weights = null; @@ -15111,10 +17278,10 @@ function logLoss_(labels2, predictions, weights, epsilon3 = 1e-7, reduction2 = R } assertShapesMatch($labels.shape, $predictions.shape, "Error in logLoss: "); const one = scalar(1); - const epsilonScalar = scalar(epsilon3); - const l13 = neg(mul($labels, log5(add2($predictions, epsilonScalar)))); - const l23 = mul(sub(one, $labels), log5(add2(sub(one, $predictions), epsilonScalar))); - const losses4 = sub(l13, l23); + const epsilonScalar = scalar(epsilon32); + const l132 = neg(mul($labels, log5(add2($predictions, epsilonScalar)))); + const l232 = mul(sub(one, $labels), log5(add2(sub(one, $predictions), epsilonScalar))); + const losses4 = sub(l132, l232); return computeWeightedLoss(losses4, $weights, reduction2); } var logLoss = op({ logLoss_ }); @@ -15303,7 +17470,7 @@ function sparseSegmentSum_(data, indices, segmentIds) { return ENGINE.runKernel(SparseSegmentSum, inputs); } var sparseSegmentSum = op({ sparseSegmentSum_ }); -function stringNGrams_(data, dataSplits, separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences) { +function stringNGrams_(data, dataSplits, separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences) { const $data = convertToTensor(data, "data", "stringNGrams", "string"); if ($data.dtype !== "string") { throw new Error("Data must be of datatype string"); @@ -15319,7 +17486,7 @@ function stringNGrams_(data, dataSplits, separator, nGramWidths, leftPad, rightP separator, nGramWidths, leftPad, - rightPad: rightPad2, + rightPad: rightPad22, padWidth, preserveShortSequences }; @@ -15328,8 +17495,8 @@ function stringNGrams_(data, dataSplits, separator, nGramWidths, leftPad, rightP return { nGrams: result[0], nGramsSplits: result[1] }; } var stringNGrams = op({ stringNGrams_ }); -function stringSplit_(input2, delimiter, skipEmpty = true) { - const $input = convertToTensor(input2, "input", "stringSplit", "string"); +function stringSplit_(input22, delimiter, skipEmpty = true) { + const $input = convertToTensor(input22, "input", "stringSplit", "string"); const $delimiter = convertToTensor(delimiter, "delimiter", "stringSplit", "string"); if ($input.rank !== 1) { throw new Error(`Input should be Tensor1D but received shape ${$input.shape}`); @@ -15343,8 +17510,8 @@ function stringSplit_(input2, delimiter, skipEmpty = true) { return { indices: result[0], values: result[1], shape: result[2] }; } var stringSplit = op({ stringSplit_ }); -function stringToHashBucketFast_(input2, numBuckets) { - const $input = convertToTensor(input2, "input", "stringToHashBucketFast", "string"); +function stringToHashBucketFast_(input22, numBuckets) { + const $input = convertToTensor(input22, "input", "stringToHashBucketFast", "string"); const attrs = { numBuckets }; if (numBuckets <= 0) { throw new Error(`Number of buckets must be at least 1`); @@ -15468,14 +17635,14 @@ Object.defineProperty(Optimizer, Symbol.hasInstance, { } }); var AdadeltaOptimizer = class extends Optimizer { - constructor(learningRate, rho, epsilon3 = null) { + constructor(learningRate, rho, epsilon32 = null) { super(); this.learningRate = learningRate; this.rho = rho; - this.epsilon = epsilon3; + this.epsilon = epsilon32; this.accumulatedGrads = []; this.accumulatedUpdates = []; - if (epsilon3 == null) { + if (epsilon32 == null) { this.epsilon = ENGINE.backend.epsilon(); } } @@ -15608,19 +17775,19 @@ var AdagradOptimizer = class extends Optimizer { AdagradOptimizer.className = "Adagrad"; registerClass(AdagradOptimizer); var AdamOptimizer = class extends Optimizer { - constructor(learningRate, beta1, beta2, epsilon3 = null) { + constructor(learningRate, beta1, beta2, epsilon32 = null) { super(); this.learningRate = learningRate; this.beta1 = beta1; this.beta2 = beta2; - this.epsilon = epsilon3; + this.epsilon = epsilon32; this.accumulatedFirstMoment = []; this.accumulatedSecondMoment = []; tidy(() => { this.accBeta1 = scalar(beta1).variable(); this.accBeta2 = scalar(beta2).variable(); }); - if (epsilon3 == null) { + if (epsilon32 == null) { this.epsilon = ENGINE.backend.epsilon(); } } @@ -15710,12 +17877,12 @@ var AdamOptimizer = class extends Optimizer { AdamOptimizer.className = "Adam"; registerClass(AdamOptimizer); var AdamaxOptimizer = class extends Optimizer { - constructor(learningRate, beta1, beta2, epsilon3 = null, decay = 0) { + constructor(learningRate, beta1, beta2, epsilon32 = null, decay = 0) { super(); this.learningRate = learningRate; this.beta1 = beta1; this.beta2 = beta2; - this.epsilon = epsilon3; + this.epsilon = epsilon32; this.decay = decay; this.accumulatedFirstMoment = []; this.accumulatedWeightedInfNorm = []; @@ -15723,7 +17890,7 @@ var AdamaxOptimizer = class extends Optimizer { this.iteration = scalar(0).variable(); this.accBeta1 = scalar(beta1).variable(); }); - if (epsilon3 == null) { + if (epsilon32 == null) { this.epsilon = ENGINE.backend.epsilon(); } } @@ -15917,17 +18084,17 @@ var MomentumOptimizer = class extends SGDOptimizer { MomentumOptimizer.className = "Momentum"; registerClass(MomentumOptimizer); var RMSPropOptimizer = class extends Optimizer { - constructor(learningRate, decay = 0.9, momentum = 0, epsilon3 = null, centered = false) { + constructor(learningRate, decay = 0.9, momentum = 0, epsilon32 = null, centered = false) { super(); this.learningRate = learningRate; this.decay = decay; this.momentum = momentum; - this.epsilon = epsilon3; + this.epsilon = epsilon32; this.accumulatedMeanSquares = []; this.accumulatedMoments = []; this.accumulatedMeanGrads = []; this.centered = centered; - if (epsilon3 == null) { + if (epsilon32 == null) { this.epsilon = ENGINE.backend.epsilon(); } if (learningRate == null) { @@ -16046,17 +18213,17 @@ var OptimizerConstructors = class { static momentum(learningRate, momentum, useNesterov = false) { return new MomentumOptimizer(learningRate, momentum, useNesterov); } - static rmsprop(learningRate, decay = 0.9, momentum = 0, epsilon3 = null, centered = false) { - return new RMSPropOptimizer(learningRate, decay, momentum, epsilon3, centered); + static rmsprop(learningRate, decay = 0.9, momentum = 0, epsilon32 = null, centered = false) { + return new RMSPropOptimizer(learningRate, decay, momentum, epsilon32, centered); } - static adam(learningRate = 1e-3, beta1 = 0.9, beta2 = 0.999, epsilon3 = null) { - return new AdamOptimizer(learningRate, beta1, beta2, epsilon3); + static adam(learningRate = 1e-3, beta1 = 0.9, beta2 = 0.999, epsilon32 = null) { + return new AdamOptimizer(learningRate, beta1, beta2, epsilon32); } - static adadelta(learningRate = 1e-3, rho = 0.95, epsilon3 = null) { - return new AdadeltaOptimizer(learningRate, rho, epsilon3); + static adadelta(learningRate = 1e-3, rho = 0.95, epsilon32 = null) { + return new AdadeltaOptimizer(learningRate, rho, epsilon32); } - static adamax(learningRate = 2e-3, beta1 = 0.9, beta2 = 0.999, epsilon3 = null, decay = 0) { - return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon3, decay); + static adamax(learningRate = 2e-3, beta1 = 0.9, beta2 = 0.999, epsilon32 = null, decay = 0) { + return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon32, decay); } static adagrad(learningRate, initialAccumulatorValue = 0.1) { return new AdagradOptimizer(learningRate, initialAccumulatorValue); @@ -16184,11 +18351,11 @@ function getImageCenter(center, imageHeight, imageWidth) { const centerY = imageHeight * (typeof center === "number" ? center : center[1]); return [centerX, centerY]; } -function getReshaped(inputShape, blockShape, prod5, batchToSpace = true) { +function getReshaped(inputShape, blockShape, prod52, batchToSpace = true) { let reshaped = []; if (batchToSpace) { reshaped = reshaped.concat(blockShape.slice(0)); - reshaped.push(inputShape[0] / prod5); + reshaped.push(inputShape[0] / prod52); reshaped = reshaped.concat(inputShape.slice(1)); } else { reshaped = reshaped.concat(inputShape[0]); @@ -16228,12 +18395,12 @@ function getPermuted(reshapedRank, blockShapeRank, batchToSpace = true) { } return permuted; } -function getReshapedPermuted(inputShape, blockShape, prod5, batchToSpace = true) { +function getReshapedPermuted(inputShape, blockShape, prod52, batchToSpace = true) { const reshapedPermuted = []; if (batchToSpace) { - reshapedPermuted.push(inputShape[0] / prod5); + reshapedPermuted.push(inputShape[0] / prod52); } else { - reshapedPermuted.push(inputShape[0] * prod5); + reshapedPermuted.push(inputShape[0] * prod52); } for (let i = 1; i < inputShape.length; ++i) { if (i <= blockShape.length) { @@ -16270,70 +18437,70 @@ var ERF_A2 = -0.284496736; var ERF_A3 = 1.421413741; var ERF_A4 = -1.453152027; var ERF_A5 = 1.061405429; -function mergeRealAndImagArrays(real4, imag4) { - if (real4.length !== imag4.length) { - throw new Error(`Cannot merge real and imag arrays of different lengths. real:${real4.length}, imag: ${imag4.length}.`); +function mergeRealAndImagArrays(real42, imag42) { + if (real42.length !== imag42.length) { + throw new Error(`Cannot merge real and imag arrays of different lengths. real:${real42.length}, imag: ${imag42.length}.`); } - const result = new Float32Array(real4.length * 2); + const result = new Float32Array(real42.length * 2); for (let i = 0; i < result.length; i += 2) { - result[i] = real4[i / 2]; - result[i + 1] = imag4[i / 2]; + result[i] = real42[i / 2]; + result[i + 1] = imag42[i / 2]; } return result; } -function splitRealAndImagArrays(complex4) { - const real4 = new Float32Array(complex4.length / 2); - const imag4 = new Float32Array(complex4.length / 2); - for (let i = 0; i < complex4.length; i += 2) { - real4[i / 2] = complex4[i]; - imag4[i / 2] = complex4[i + 1]; +function splitRealAndImagArrays(complex42) { + const real42 = new Float32Array(complex42.length / 2); + const imag42 = new Float32Array(complex42.length / 2); + for (let i = 0; i < complex42.length; i += 2) { + real42[i / 2] = complex42[i]; + imag42[i / 2] = complex42[i + 1]; } - return { real: real4, imag: imag4 }; + return { real: real42, imag: imag42 }; } -function complexWithEvenIndex(complex4) { - const len = Math.ceil(complex4.length / 4); - const real4 = new Float32Array(len); - const imag4 = new Float32Array(len); - for (let i = 0; i < complex4.length; i += 4) { - real4[Math.floor(i / 4)] = complex4[i]; - imag4[Math.floor(i / 4)] = complex4[i + 1]; +function complexWithEvenIndex(complex42) { + const len = Math.ceil(complex42.length / 4); + const real42 = new Float32Array(len); + const imag42 = new Float32Array(len); + for (let i = 0; i < complex42.length; i += 4) { + real42[Math.floor(i / 4)] = complex42[i]; + imag42[Math.floor(i / 4)] = complex42[i + 1]; } - return { real: real4, imag: imag4 }; + return { real: real42, imag: imag42 }; } -function complexWithOddIndex(complex4) { - const len = Math.floor(complex4.length / 4); - const real4 = new Float32Array(len); - const imag4 = new Float32Array(len); - for (let i = 2; i < complex4.length; i += 4) { - real4[Math.floor(i / 4)] = complex4[i]; - imag4[Math.floor(i / 4)] = complex4[i + 1]; +function complexWithOddIndex(complex42) { + const len = Math.floor(complex42.length / 4); + const real42 = new Float32Array(len); + const imag42 = new Float32Array(len); + for (let i = 2; i < complex42.length; i += 4) { + real42[Math.floor(i / 4)] = complex42[i]; + imag42[Math.floor(i / 4)] = complex42[i + 1]; } - return { real: real4, imag: imag4 }; + return { real: real42, imag: imag42 }; } -function getComplexWithIndex(complex4, index) { - const real4 = complex4[index * 2]; - const imag4 = complex4[index * 2 + 1]; - return { real: real4, imag: imag4 }; +function getComplexWithIndex(complex42, index) { + const real42 = complex42[index * 2]; + const imag42 = complex42[index * 2 + 1]; + return { real: real42, imag: imag42 }; } -function assignToTypedArray(data, real4, imag4, index) { - data[index * 2] = real4; - data[index * 2 + 1] = imag4; +function assignToTypedArray(data, real42, imag42, index) { + data[index * 2] = real42; + data[index * 2 + 1] = imag42; } function exponents(n, inverse) { - const real4 = new Float32Array(n / 2); - const imag4 = new Float32Array(n / 2); + const real42 = new Float32Array(n / 2); + const imag42 = new Float32Array(n / 2); for (let i = 0; i < Math.ceil(n / 2); i++) { const x = (inverse ? 2 : -2) * Math.PI * (i / n); - real4[i] = Math.cos(x); - imag4[i] = Math.sin(x); + real42[i] = Math.cos(x); + imag42[i] = Math.sin(x); } - return { real: real4, imag: imag4 }; + return { real: real42, imag: imag42 }; } function exponent(k, n, inverse) { const x = (inverse ? 2 : -2) * Math.PI * (k / n); - const real4 = Math.cos(x); - const imag4 = Math.sin(x); - return { real: real4, imag: imag4 }; + const real42 = Math.cos(x); + const imag42 = Math.sin(x); + return { real: real42, imag: imag42 }; } var ARROW = "->"; var ARROW_REGEX = /->/g; @@ -16397,14 +18564,14 @@ function getEinsumPermutation(nDims, idDims) { for (let i = 0; i < idDims.length; ++i) { permutationIndices[idDims[i]] = i; } - const expandDims6 = []; + const expandDims62 = []; for (let i = 0; i < nDims; ++i) { if (permutationIndices[i] === -1) { - expandDims6.push(i); + expandDims62.push(i); } } permutationIndices = permutationIndices.filter((d) => d !== -1); - return { permutationIndices, expandDims: expandDims6 }; + return { permutationIndices, expandDims: expandDims62 }; } function checkEinsumDimSizes(nDims, idDims, tensors) { const dimSizes = new Array(nDims); @@ -16727,9 +18894,9 @@ var atanhGradConfig = { return { x: () => div(dy, sub(scalar(1), square(cast(x, "float32")))) }; } }; -function avgPool3dGrad_(dy, input2, filterSize, strides, pad3, dimRoundingMode) { +function avgPool3dGrad_(dy, input22, filterSize, strides, pad32, dimRoundingMode) { const $dy = convertToTensor(dy, "dy", "avgPool3dGrad"); - const $input = convertToTensor(input2, "input", "avgPool3dGrad"); + const $input = convertToTensor(input22, "input", "avgPool3dGrad"); let dy5D = $dy; let input5D = $input; let reshapedTo5D = false; @@ -16747,10 +18914,10 @@ function avgPool3dGrad_(dy, input2, filterSize, strides, pad3, dimRoundingMode) assert(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ${dy5D.rank}.`); assert(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ${input5D.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { dy: dy5D, input: input5D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode }; const res = ENGINE.runKernel(AvgPool3DGrad, inputs, attrs); if (reshapedTo5D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); @@ -16763,15 +18930,15 @@ var avgPool3DGradConfig = { inputsToSave: ["x"], gradFunc: (dy, saved, attrs) => { const [x] = saved; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; return { - x: () => avgPool3dGrad(dy, x, filterSize, strides, pad3, dimRoundingMode) + x: () => avgPool3dGrad(dy, x, filterSize, strides, pad32, dimRoundingMode) }; } }; -function avgPoolGrad_(dy, input2, filterSize, strides, pad3) { +function avgPoolGrad_(dy, input22, filterSize, strides, pad32) { const $dy = convertToTensor(dy, "dy", "avgPoolGrad"); - const $input = convertToTensor(input2, "input", "avgPoolGrad"); + const $input = convertToTensor(input22, "input", "avgPoolGrad"); assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); let input4D = $input; let dy4D = $dy; @@ -16784,7 +18951,7 @@ function avgPoolGrad_(dy, input2, filterSize, strides, pad3) { assert(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ${dy4D.rank}.`); assert(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ${input4D.rank}.`); const inputs = { dy: dy4D, input: input4D }; - const attrs = { filterSize, strides, pad: pad3 }; + const attrs = { filterSize, strides, pad: pad32 }; const res = ENGINE.runKernel(AvgPoolGrad, inputs, attrs); if (reshapedTo4D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); @@ -16797,8 +18964,8 @@ var avgPoolGradConfig = { inputsToSave: ["x"], gradFunc: (dy, saved, attrs) => { const [x] = saved; - const { filterSize, strides, pad: pad3 } = attrs; - return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad3) }; + const { filterSize, strides, pad: pad32 } = attrs; + return { x: () => avgPoolGrad(dy, x, filterSize, strides, pad32) }; } }; var batchMatMulGradConfig = { @@ -16905,11 +19072,11 @@ var conv2DGradConfig = { inputsToSave: ["x", "filter"], gradFunc: (dy, saved, attrs) => { const [x4D, $filter] = saved; - const { dilations, strides, pad: pad3, dataFormat } = attrs; + const { dilations, strides, pad: pad32, dataFormat } = attrs; assert(tupleValuesAreOne(dilations), () => `Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); return { - x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad3, dataFormat), - filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad3, dataFormat) + x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad32, dataFormat), + filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad32, dataFormat) }; } }; @@ -16918,14 +19085,14 @@ var conv2DBackpropInputGradConfig = { inputsToSave: ["dy", "filter"], gradFunc: (ddx, saved, attrs) => { const [dy, filter] = saved; - const { strides, pad: pad3, dataFormat, dimRoundingMode } = attrs; + const { strides, pad: pad32, dataFormat, dimRoundingMode } = attrs; return { - dy: () => conv2d(ddx, filter, strides, pad3, dataFormat, 1, dimRoundingMode), - filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad3, dataFormat, dimRoundingMode) + dy: () => conv2d(ddx, filter, strides, pad32, dataFormat, 1, dimRoundingMode), + filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad32, dataFormat, dimRoundingMode) }; } }; -function conv3DBackpropFilter_(x, dy, filterShape, strides, pad3) { +function conv3DBackpropFilter_(x, dy, filterShape, strides, pad32) { let x5D = x; if (x.rank === 4) { x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); @@ -16940,7 +19107,7 @@ function conv3DBackpropFilter_(x, dy, filterShape, strides, pad3) { assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must match input depth in filter (${filterShape[3]}.`); assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must match output depth for filter (${filterShape[4]}).`); const inputs = { x: x5D, dy: dy5D }; - const attrs = { strides, pad: pad3, filterShape }; + const attrs = { strides, pad: pad32, filterShape }; return ENGINE.runKernel(Conv3DBackpropFilterV2, inputs, attrs); } var conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); @@ -16948,12 +19115,12 @@ var conv3DGradConfig = { kernelName: Conv3D, inputsToSave: ["x", "filter"], gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad: pad3 } = attrs; + const { dilations, strides, pad: pad32 } = attrs; assert(tupleValuesAreOne(dilations), () => `Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); const [x5D, $filter] = saved; return { - x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad3), - filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad3) + x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad32), + filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad32) }; } }; @@ -16978,11 +19145,11 @@ var cumsumGradConfig = { inputsToSave: ["x"], gradFunc: (dy, saved, attrs) => { const [x] = saved; - const { axis, exclusive, reverse: reverse5 } = attrs; + const { axis, exclusive, reverse: reverse52 } = attrs; return { x: () => { const permutation = getAxesPermutation([axis], x.rank); - let out = cumsum(dy, axis, exclusive, !reverse5); + let out = cumsum(dy, axis, exclusive, !reverse52); if (permutation != null) { out = transpose(out, permutation); } @@ -16995,7 +19162,7 @@ var depthwiseConv2dNativeGradConfig = { kernelName: DepthwiseConv2dNative, inputsToSave: ["x", "filter"], gradFunc: (dy, saved, attrs) => { - const { dilations, strides, pad: pad3, dimRoundingMode } = attrs; + const { dilations, strides, pad: pad32, dimRoundingMode } = attrs; const $dilations = dilations == null ? [1, 1] : dilations; assert(tupleValuesAreOne($dilations), () => `Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${$dilations}'`); const [x, filter] = saved; @@ -17004,11 +19171,11 @@ var depthwiseConv2dNativeGradConfig = { assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input channels (${x.shape[3]}) must match the inChannels dimension in filter ${filter.shape[2]}.`); assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } return { - x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad3, $dilations, dimRoundingMode), - filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad3, $dilations, dimRoundingMode) + x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, strides, pad32, $dilations, dimRoundingMode), + filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, strides, pad32, $dilations, dimRoundingMode) }; } }; @@ -17055,8 +19222,8 @@ var expandDimsGradConfig = { kernelName: ExpandDims, inputsToSave: ["input"], gradFunc: (dy, saved) => { - const [input2] = saved; - return { input: () => reshape(dy, input2.shape) }; + const [input22] = saved; + return { input: () => reshape(dy, input22.shape) }; } }; var expm1GradConfig = { @@ -17104,55 +19271,55 @@ var fusedBatchNormGradConfig = { inputsToSave: ["x", "mean", "variance", "scale"], gradFunc: (dy, saved, attrs) => { const { varianceEpsilon } = attrs; - const [x, mean4, variance, scale22] = saved; + const [x, mean42, variance, scale22] = saved; const scaleValue = scale22 == null ? scalar(1) : scale22; - const reductionAxes = getReductionAxes(mean4.shape, x.shape); + const reductionAxes = getReductionAxes(mean42.shape, x.shape); const tileShape = []; - if (mean4.rank === 1) { + if (mean42.rank === 1) { for (let i = 0; i < x.shape.length - 1; ++i) { tileShape.push(x.shape[i]); } tileShape.push(1); } - const xMinusMean = sub(x, mean4); + const xMinusMean = sub(x, mean42); const dyTimesScaleValue = mul(dy, scaleValue); const oneOverSqrtVariance = rsqrt(add2(variance, scalar(varianceEpsilon))); const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); const derX = () => { - if (mean4.rank === 1) { - return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean4.shape[0]]), tileShape)), scaleValue), x.shape); + if (mean42.rank === 1) { + return reshape(mul(mul(dy, tile(reshape(oneOverSqrtVariance, [1, 1, 1, mean42.shape[0]]), tileShape)), scaleValue), x.shape); } else { return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); } }; const derMean = () => { let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); - if (mean4.rank === 1) { + if (mean42.rank === 1) { meanDer = sum2(meanDer, reductionAxes); } - return reshape(meanDer, mean4.shape); + return reshape(meanDer, mean42.shape); }; const derVariance = () => { let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); - if (mean4.rank === 1) { + if (mean42.rank === 1) { varianceDer = sum2(varianceDer, reductionAxes); } - return reshape(varianceDer, mean4.shape); + return reshape(varianceDer, mean42.shape); }; const derScale = () => { const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); let scaleDer = mul(dy, xMinusMean2TimesRsqrt); - if (mean4.rank === 1) { + if (mean42.rank === 1) { scaleDer = sum2(scaleDer, reductionAxes); } - return reshape(scaleDer, mean4.shape); + return reshape(scaleDer, mean42.shape); }; const derOffset = () => { let offsetDer = dy; - if (mean4.rank === 1) { + if (mean42.rank === 1) { offsetDer = sum2(offsetDer, reductionAxes); } - return reshape(offsetDer, mean4.shape); + return reshape(offsetDer, mean42.shape); }; return { x: derX, @@ -17276,8 +19443,8 @@ var logSoftmaxGradConfig = { return { logits: () => { const keepDims = true; - const softmax6 = exp(value); - return sub(dy, mul(sum2(dy, axis, keepDims), softmax6)); + const softmax62 = exp(value); + return sub(dy, mul(sum2(dy, axis, keepDims), softmax62)); } }; } @@ -17342,9 +19509,9 @@ var maximumGradConfig = { return { a: derA, b: derB }; } }; -function maxPool3dGrad_(dy, input2, output, filterSize, strides, pad3, dimRoundingMode) { +function maxPool3dGrad_(dy, input22, output, filterSize, strides, pad32, dimRoundingMode) { const $dy = convertToTensor(dy, "dy", "maxPool3dGrad"); - const $input = convertToTensor(input2, "input", "maxPool3dGrad"); + const $input = convertToTensor(input22, "input", "maxPool3dGrad"); const $output = convertToTensor(output, "output", "maxPool3dGrad"); let dy5D = $dy; let input5D = $input; @@ -17372,10 +19539,10 @@ function maxPool3dGrad_(dy, input2, output, filterSize, strides, pad3, dimRoundi assert(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ${input5D.rank}.`); assert(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ${output5D.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { dy: dy5D, input: input5D, output: output5D }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode }; const res = ENGINE.runKernel(MaxPool3DGrad, inputs, attrs); if (reshapedTo5D) { return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); @@ -17389,24 +19556,24 @@ var maxPool3DGradConfig = { outputsToSave: [true], gradFunc: (dy, saved, attrs) => { const [x, y] = saved; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; return { - x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad3, dimRoundingMode) + x: () => maxPool3dGrad(dy, x, y, filterSize, strides, pad32, dimRoundingMode) }; } }; -function maxPoolGrad_(dy, input2, output, filterSize, strides, pad3, dimRoundingMode) { +function maxPoolGrad_(dy, input22, output, filterSize, strides, pad32, dimRoundingMode) { const $dy = convertToTensor(dy, "dy", "maxPoolGrad"); - const $input = convertToTensor(input2, "input", "maxPoolGrad"); + const $input = convertToTensor(input22, "input", "maxPoolGrad"); const $output = convertToTensor(output, "output", "maxPoolGrad"); assert($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); assert($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ${$dy.rank}.`); assert($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ${$input.rank}.`); if (dimRoundingMode != null) { - assert(isInt(pad3), () => `Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad3}.`); + assert(isInt(pad32), () => `Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad32}.`); } const inputs = { dy: $dy, input: $input, output: $output }; - const attrs = { filterSize, strides, pad: pad3, dimRoundingMode }; + const attrs = { filterSize, strides, pad: pad32, dimRoundingMode }; return ENGINE.runKernel(MaxPoolGrad, inputs, attrs); } var maxPoolGrad = op({ maxPoolGrad_ }); @@ -17416,9 +19583,9 @@ var maxPoolGradConfig = { outputsToSave: [true], gradFunc: (dy, saved, attrs) => { const [x, y] = saved; - const { filterSize, strides, pad: pad3 } = attrs; + const { filterSize, strides, pad: pad32 } = attrs; return { - x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad3) + x: () => maxPoolGrad(dy, x, y, filterSize, strides, pad32) }; } }; @@ -17477,7 +19644,7 @@ var mirrorPadGradConfig = { gradFunc: (dy, saved, attrs) => { const x = saved[0]; const { paddings } = attrs; - const begin = paddings.map((p2) => p2[0]); + const begin = paddings.map((p22) => p22[0]); return { x: () => slice(dy, begin, x.shape) }; } }; @@ -17565,7 +19732,7 @@ var padV2GradConfig = { gradFunc: (dy, saved, attrs) => { const x = saved[0]; const { paddings } = attrs; - const begin = paddings.map((p2) => p2[0]); + const begin = paddings.map((p22) => p22[0]); return { x: () => slice(dy, begin, x.shape) }; } }; @@ -17576,10 +19743,10 @@ var powGradConfig = { gradFunc: (dy, saved) => { const [a, b, y] = saved; const base2 = a; - const exp4 = b; - const outShape = assertAndGetBroadcastShape(base2.shape, exp4.shape); + const exp42 = b; + const outShape = assertAndGetBroadcastShape(base2.shape, exp42.shape); const derBase = () => { - const expFloat = cast(exp4, "float32"); + const expFloat = cast(exp42, "float32"); let res = mul(dy, mul(expFloat, pow(base2, sub(expFloat, scalar(1))))); const reduceAxes = getReductionAxes(base2.shape, outShape); if (reduceAxes.length > 0) { @@ -17591,11 +19758,11 @@ var powGradConfig = { const condition = greater(base2, 0); const logBase = where(condition, log5(base2), zerosLike(base2)); let res = mul(dy, mul(y, logBase)); - const reduceAxes = getReductionAxes(exp4.shape, outShape); + const reduceAxes = getReductionAxes(exp42.shape, outShape); if (reduceAxes.length > 0) { res = sum2(res, reduceAxes); } - return reshape(res, exp4.shape); + return reshape(res, exp42.shape); }; return { a: derBase, b: derExp }; } @@ -17740,10 +19907,10 @@ var seluGradConfig = { return { x: () => { const mask = greater(x, scalar(0)); - const scaleAlpha2 = scalar(SELU_SCALEALPHA); + const scaleAlpha22 = scalar(SELU_SCALEALPHA); const scale22 = scalar(SELU_SCALE); const greaterThanZeroDer = mul(dy, scale22); - const lessEqualZeroDer = mul(mul(dy, scaleAlpha2), exp(cast(x, "float32"))); + const lessEqualZeroDer = mul(mul(dy, scaleAlpha22), exp(cast(x, "float32"))); return where(mask, greaterThanZeroDer, lessEqualZeroDer); } }; @@ -18207,17 +20374,17 @@ getGlobalTensorClass().prototype.atanh = function() { this.throwIfDisposed(); return atanh(this); }; -getGlobalTensorClass().prototype.avgPool = function(filterSize, strides, pad3, dimRoundingMode) { +getGlobalTensorClass().prototype.avgPool = function(filterSize, strides, pad32, dimRoundingMode) { this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad3, dimRoundingMode); + return avgPool(this, filterSize, strides, pad32, dimRoundingMode); }; getGlobalTensorClass().prototype.batchToSpaceND = function(blockShape, crops) { this.throwIfDisposed(); return batchToSpaceND(this, blockShape, crops); }; -getGlobalTensorClass().prototype.batchNorm = function(mean4, variance, offset, scale22, varianceEpsilon) { +getGlobalTensorClass().prototype.batchNorm = function(mean42, variance, offset, scale22, varianceEpsilon) { this.throwIfDisposed(); - return batchNorm(this, mean4, variance, offset, scale22, varianceEpsilon); + return batchNorm(this, mean42, variance, offset, scale22, varianceEpsilon); }; getGlobalTensorClass().prototype.broadcastTo = function(shape) { this.throwIfDisposed(); @@ -18231,9 +20398,9 @@ getGlobalTensorClass().prototype.ceil = function() { this.throwIfDisposed(); return ceil(this); }; -getGlobalTensorClass().prototype.clipByValue = function(min6, max6) { +getGlobalTensorClass().prototype.clipByValue = function(min62, max62) { this.throwIfDisposed(); - return clipByValue(this, min6, max6); + return clipByValue(this, min62, max62); }; getGlobalTensorClass().prototype.concat = function(x, axis) { this.throwIfDisposed(); @@ -18242,17 +20409,17 @@ getGlobalTensorClass().prototype.concat = function(x, axis) { } return concat([this, ...x], axis); }; -getGlobalTensorClass().prototype.conv1d = function(filter, stride, pad3, dataFormat, dilation, dimRoundingMode) { +getGlobalTensorClass().prototype.conv1d = function(filter, stride, pad32, dataFormat, dilation, dimRoundingMode) { this.throwIfDisposed(); - return conv1d(this, filter, stride, pad3, dataFormat, dilation, dimRoundingMode); + return conv1d(this, filter, stride, pad32, dataFormat, dilation, dimRoundingMode); }; -getGlobalTensorClass().prototype.conv2dTranspose = function(filter, outputShape, strides, pad3, dimRoundingMode) { +getGlobalTensorClass().prototype.conv2dTranspose = function(filter, outputShape, strides, pad32, dimRoundingMode) { this.throwIfDisposed(); - return conv2dTranspose(this, filter, outputShape, strides, pad3, dimRoundingMode); + return conv2dTranspose(this, filter, outputShape, strides, pad32, dimRoundingMode); }; -getGlobalTensorClass().prototype.conv2d = function(filter, strides, pad3, dataFormat, dilations, dimRoundingMode) { +getGlobalTensorClass().prototype.conv2d = function(filter, strides, pad32, dataFormat, dilations, dimRoundingMode) { this.throwIfDisposed(); - return conv2d(this, filter, strides, pad3, dataFormat, dilations, dimRoundingMode); + return conv2d(this, filter, strides, pad32, dataFormat, dilations, dimRoundingMode); }; getGlobalTensorClass().prototype.cos = function() { this.throwIfDisposed(); @@ -18262,21 +20429,21 @@ getGlobalTensorClass().prototype.cosh = function() { this.throwIfDisposed(); return cosh(this); }; -getGlobalTensorClass().prototype.cumsum = function(axis, exclusive, reverse5) { +getGlobalTensorClass().prototype.cumsum = function(axis, exclusive, reverse52) { this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse5); + return cumsum(this, axis, exclusive, reverse52); }; getGlobalTensorClass().prototype.depthToSpace = function(blockSize, dataFormat) { this.throwIfDisposed(); return depthToSpace(this, blockSize, dataFormat); }; -getGlobalTensorClass().prototype.depthwiseConv2d = function(filter, strides, pad3, dataFormat, dilations, dimRoundingMode) { +getGlobalTensorClass().prototype.depthwiseConv2d = function(filter, strides, pad32, dataFormat, dilations, dimRoundingMode) { this.throwIfDisposed(); - return depthwiseConv2d(this, filter, strides, pad3, dataFormat, dilations, dimRoundingMode); + return depthwiseConv2d(this, filter, strides, pad32, dataFormat, dilations, dimRoundingMode); }; -getGlobalTensorClass().prototype.dilation2d = function(filter, strides, pad3, dilations, dataFormat) { +getGlobalTensorClass().prototype.dilation2d = function(filter, strides, pad32, dilations, dataFormat) { this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad3, dilations, dataFormat); + return dilation2d(this, filter, strides, pad32, dilations, dataFormat); }; getGlobalTensorClass().prototype.divNoNan = function(b) { this.throwIfDisposed(); @@ -18418,9 +20585,9 @@ getGlobalTensorClass().prototype.matMul = function(b, transposeA, transposeB) { this.throwIfDisposed(); return matMul(this, b, transposeA, transposeB); }; -getGlobalTensorClass().prototype.maxPool = function(filterSize, strides, pad3, dimRoundingMode) { +getGlobalTensorClass().prototype.maxPool = function(filterSize, strides, pad32, dimRoundingMode) { this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad3, dimRoundingMode); + return maxPool(this, filterSize, strides, pad32, dimRoundingMode); }; getGlobalTensorClass().prototype.max = function(axis, keepDims) { this.throwIfDisposed(); @@ -18478,13 +20645,13 @@ getGlobalTensorClass().prototype.pad = function(paddings, constantValue) { this.throwIfDisposed(); return pad(this, paddings, constantValue); }; -getGlobalTensorClass().prototype.pool = function(windowShape, poolingType, padding, dilationRate, strides) { +getGlobalTensorClass().prototype.pool = function(windowShape, poolingType, padding2, dilationRate, strides) { this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); + return pool(this, windowShape, poolingType, padding2, dilationRate, strides); }; -getGlobalTensorClass().prototype.pow = function(exp4) { +getGlobalTensorClass().prototype.pow = function(exp42) { this.throwIfDisposed(); - return pow(this, exp4); + return pow(this, exp42); }; getGlobalTensorClass().prototype.prelu = function(alpha) { this.throwIfDisposed(); @@ -18542,9 +20709,9 @@ getGlobalTensorClass().prototype.selu = function() { this.throwIfDisposed(); return selu(this); }; -getGlobalTensorClass().prototype.separableConv2d = function(depthwiseFilter, pointwiseFilter, strides, pad3, dilation, dataFormat) { +getGlobalTensorClass().prototype.separableConv2d = function(depthwiseFilter, pointwiseFilter, strides, pad32, dilation, dataFormat) { this.throwIfDisposed(); - return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad3, dilation, dataFormat); + return separableConv2d(this, depthwiseFilter, pointwiseFilter, strides, pad32, dilation, dataFormat); }; getGlobalTensorClass().prototype.sigmoid = function() { this.throwIfDisposed(); @@ -18736,9 +20903,9 @@ function assert2(val, message) { throw new AssertionError(message); } } -function count(array2, refernce) { +function count(array22, refernce) { let counter = 0; - for (const item of array2) { + for (const item of array22) { if (item === refernce) { counter++; } @@ -19161,44 +21328,44 @@ function isValidTensorName(name) { function isInteger(x) { return x === parseInt(x.toString(), 10); } -function arrayProd(array2, begin, end) { +function arrayProd(array22, begin, end) { if (begin == null) { begin = 0; } if (end == null) { - end = array2.length; + end = array22.length; } - let prod5 = 1; + let prod52 = 1; for (let i = begin; i < end; ++i) { - prod5 *= array2[i]; + prod52 *= array22[i]; } - return prod5; + return prod52; } -function min2(array2) { - if (array2.length === 0) { +function min2(array22) { + if (array22.length === 0) { return Number.NaN; } - let min6 = Number.POSITIVE_INFINITY; - for (let i = 0; i < array2.length; i++) { - const value = array2[i]; - if (value < min6) { - min6 = value; + let min62 = Number.POSITIVE_INFINITY; + for (let i = 0; i < array22.length; i++) { + const value = array22[i]; + if (value < min62) { + min62 = value; } } - return min6; + return min62; } -function max2(array2) { - if (array2.length === 0) { +function max2(array22) { + if (array22.length === 0) { return Number.NaN; } - let max6 = Number.NEGATIVE_INFINITY; - for (let i = 0; i < array2.length; i++) { - const value = array2[i]; - if (value > max6) { - max6 = value; + let max62 = Number.NEGATIVE_INFINITY; + for (let i = 0; i < array22.length; i++) { + const value = array22[i]; + if (value > max62) { + max62 = value; } } - return max6; + return max62; } function range2(begin, end) { if (end < begin) { @@ -19241,95 +21408,95 @@ function batchFlatten(x) { const newShape = [x.shape[0], arrayProd(x.shape, 1)]; return reshape(x, newShape); } -function sliceAlongFirstAxis(array2, start, size2) { +function sliceAlongFirstAxis(array22, start, size2) { return tidy(() => { - switch (array2.rank) { + switch (array22.rank) { case 1: - return slice1d(array2, start, size2); + return slice1d(array22, start, size2); case 2: - return slice2d(array2, [start, 0], [size2, array2.shape[1]]); + return slice2d(array22, [start, 0], [size2, array22.shape[1]]); case 3: - return slice3d(array2, [start, 0, 0], [size2, array2.shape[1], array2.shape[2]]); + return slice3d(array22, [start, 0, 0], [size2, array22.shape[1], array22.shape[2]]); case 4: - return slice4d(array2, [start, 0, 0, 0], [size2, array2.shape[1], array2.shape[2], array2.shape[3]]); + return slice4d(array22, [start, 0, 0, 0], [size2, array22.shape[1], array22.shape[2], array22.shape[3]]); case 5: - return slice(array2, [start, 0, 0, 0, 0], [ + return slice(array22, [start, 0, 0, 0, 0], [ size2, - array2.shape[1], - array2.shape[2], - array2.shape[3], - array2.shape[4] + array22.shape[1], + array22.shape[2], + array22.shape[3], + array22.shape[4] ]); case 6: - return slice(array2, [start, 0, 0, 0, 0, 0], [ + return slice(array22, [start, 0, 0, 0, 0, 0], [ size2, - array2.shape[1], - array2.shape[2], - array2.shape[3], - array2.shape[4], - array2.shape[5] + array22.shape[1], + array22.shape[2], + array22.shape[3], + array22.shape[4], + array22.shape[5] ]); default: - throw new ValueError(`sliceAlongFirstAxis() received an unsupported tensor rank: ${array2.rank}`); + throw new ValueError(`sliceAlongFirstAxis() received an unsupported tensor rank: ${array22.rank}`); } }); } -function sliceAlongLastAxis(array2, start, size2) { +function sliceAlongLastAxis(array22, start, size2) { return tidy(() => { - switch (array2.rank) { + switch (array22.rank) { case 1: - return slice1d(array2, start, size2); + return slice1d(array22, start, size2); case 2: - return slice2d(array2, [0, start], [array2.shape[0], size2]); + return slice2d(array22, [0, start], [array22.shape[0], size2]); case 3: - return slice3d(array2, [0, 0, start], [array2.shape[0], array2.shape[1], size2]); + return slice3d(array22, [0, 0, start], [array22.shape[0], array22.shape[1], size2]); case 4: - return slice4d(array2, [0, 0, 0, start], [array2.shape[0], array2.shape[1], array2.shape[2], size2]); + return slice4d(array22, [0, 0, 0, start], [array22.shape[0], array22.shape[1], array22.shape[2], size2]); default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ${array2.rank}`); + throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ${array22.rank}`); } }); } -function sliceAlongAxis(array2, start, size2, axis) { +function sliceAlongAxis(array22, start, size2, axis) { return tidy(() => { - switch (array2.rank) { + switch (array22.rank) { case 1: - return slice1d(array2, start, size2); + return slice1d(array22, start, size2); case 2: switch (axis) { case 1: - return sliceAlongFirstAxis(array2, start, size2); + return sliceAlongFirstAxis(array22, start, size2); case 2: - return sliceAlongLastAxis(array2, start, size2); + return sliceAlongLastAxis(array22, start, size2); default: throw new ValueError(`The axis is not within the rank of the tensor ${axis}`); } case 3: switch (axis) { case 1: - return sliceAlongFirstAxis(array2, start, size2); + return sliceAlongFirstAxis(array22, start, size2); case 2: - return slice3d(array2, [0, start, 0], [array2.shape[0], size2, array2.shape[2]]); + return slice3d(array22, [0, start, 0], [array22.shape[0], size2, array22.shape[2]]); case 3: - return sliceAlongLastAxis(array2, start, size2); + return sliceAlongLastAxis(array22, start, size2); default: throw new ValueError(`The axis is not within the rank of the tensor ${axis}`); } case 4: switch (axis) { case 1: - return sliceAlongFirstAxis(array2, start, size2); + return sliceAlongFirstAxis(array22, start, size2); case 2: - return slice4d(array2, [0, start, 0, 0], [array2.shape[0], size2, array2.shape[2], array2.shape[3]]); + return slice4d(array22, [0, start, 0, 0], [array22.shape[0], size2, array22.shape[2], array22.shape[3]]); case 3: - return slice4d(array2, [0, 0, start, 0], [array2.shape[0], array2.shape[1], size2, array2.shape[3]]); + return slice4d(array22, [0, 0, start, 0], [array22.shape[0], array22.shape[1], size2, array22.shape[3]]); case 4: - return sliceAlongLastAxis(array2, start, size2); + return sliceAlongLastAxis(array22, start, size2); default: throw new ValueError(`The axis is not within the rank of the tensor ${axis}`); } default: - throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ${array2.rank}`); + throw new ValueError(`sliceAlongLastAxis() received an unsupported tensor rank: ${array22.rank}`); } }); } @@ -19371,8 +21538,8 @@ function tile2(x, n) { } return tile(x, n); } -function randomNormal2(shape, mean4 = 0, stddev = 1, dtype, seed) { - return randomNormal(shape, mean4, stddev, dtype, seed); +function randomNormal2(shape, mean42 = 0, stddev = 1, dtype, seed) { + return randomNormal(shape, mean42, stddev, dtype, seed); } function dot2(a, b, activation2, bias) { if (a.rank < 2 || b.rank < 2) { @@ -20140,8 +22307,8 @@ function batchGetValue(xs) { } function batchSetValue(variablesAndValues) { variablesAndValues.forEach((variableAndValue) => { - const variable2 = variableAndValue[0]; - variable2.write(variableAndValue[1]); + const variable22 = variableAndValue[0]; + variable22.write(variableAndValue[1]); }); } var InputSpec = class { @@ -20434,15 +22601,15 @@ var Layer = class extends serialization_exports.Serializable { this.assertNotDisposed(); const inputsList = toList(inputs); let allAreSymbolic = true; - for (const input2 of inputsList) { - if (!(input2 instanceof SymbolicTensor)) { + for (const input22 of inputsList) { + if (!(input22 instanceof SymbolicTensor)) { allAreSymbolic = false; break; } } let noneAreSymbolic = true; - for (const input2 of inputsList) { - if (input2 instanceof SymbolicTensor) { + for (const input22 of inputsList) { + if (input22 instanceof SymbolicTensor) { noneAreSymbolic = false; break; } @@ -20566,12 +22733,12 @@ var Layer = class extends serialization_exports.Serializable { const paramValues = batchGetValue(params); for (let i = 0; i < paramValues.length; ++i) { const pv = paramValues[i]; - const p2 = params[i]; + const p22 = params[i]; const w = weights[i]; if (!util_exports.arraysEqual(pv.shape, w.shape)) { throw new ValueError(`Layer weight shape ${pv.shape} not compatible with provided weight shape ${w.shape}`); } - weightValueTuples.push([p2, w]); + weightValueTuples.push([p22, w]); } batchSetValue(weightValueTuples); }); @@ -20713,13 +22880,13 @@ function collectInputShape(inputTensors) { function guessOutputDType(inputTensors) { return "float32"; } -function getSourceInputs(tensor2, layer, nodeIndex) { +function getSourceInputs(tensor22, layer, nodeIndex) { if (layer == null || nodeIndex != null && nodeIndex > 0) { - layer = tensor2.sourceLayer; - nodeIndex = tensor2.nodeIndex; + layer = tensor22.sourceLayer; + nodeIndex = tensor22.nodeIndex; } if (layer.inboundNodes.length === 0) { - return [tensor2]; + return [tensor22]; } else { const node2 = layer.inboundNodes[nodeIndex]; if (node2.inboundLayers.length === 0) { @@ -20868,9 +23035,9 @@ function disposeTensorsInLogs(logs) { } } var ModelLoggingVerbosity; -(function(ModelLoggingVerbosity2) { - ModelLoggingVerbosity2[ModelLoggingVerbosity2["SILENT"] = 0] = "SILENT"; - ModelLoggingVerbosity2[ModelLoggingVerbosity2["VERBOSE"] = 1] = "VERBOSE"; +(function(ModelLoggingVerbosity22) { + ModelLoggingVerbosity22[ModelLoggingVerbosity22["SILENT"] = 0] = "SILENT"; + ModelLoggingVerbosity22[ModelLoggingVerbosity22["VERBOSE"] = 1] = "VERBOSE"; })(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); var DEFAULT_YIELD_EVERY_MS = 125; var BaseCallback = class { @@ -20896,11 +23063,11 @@ var BaseCallback = class { } }; var CallbackList = class { - constructor(callbacks2, queueLength = 10) { - if (callbacks2 == null) { - callbacks2 = []; + constructor(callbacks22, queueLength = 10) { + if (callbacks22 == null) { + callbacks22 = []; } - this.callbacks = callbacks2; + this.callbacks = callbacks22; this.queueLength = queueLength; } append(callback) { @@ -21011,8 +23178,8 @@ var BaseLogger = class extends BaseCallback { logs[key] = this.totals[key] / this.seen; } else { tidy(() => { - const log8 = mul(div(1, this.seen), this.totals[key]); - logs[key] = log8; + const log82 = mul(div(1, this.seen), this.totals[key]); + logs[key] = log82; this.totals[key].dispose(); keep(logs[key]); }); @@ -21142,17 +23309,17 @@ var CustomCallback = class extends BaseCallback { } } }; -function standardizeCallbacks(callbacks2, yieldEvery) { - if (callbacks2 == null) { - callbacks2 = {}; +function standardizeCallbacks(callbacks22, yieldEvery) { + if (callbacks22 == null) { + callbacks22 = {}; } - if (callbacks2 instanceof BaseCallback) { - return [callbacks2]; + if (callbacks22 instanceof BaseCallback) { + return [callbacks22]; } - if (Array.isArray(callbacks2) && callbacks2[0] instanceof BaseCallback) { - return callbacks2; + if (Array.isArray(callbacks22) && callbacks22[0] instanceof BaseCallback) { + return callbacks22; } - const callbackConfigs = toList(callbacks2); + const callbackConfigs = toList(callbacks22); return callbackConfigs.map((callbackConfig) => new CustomCallback(callbackConfig, yieldEvery)); } var CallbackConstructorRegistry = class { @@ -21191,14 +23358,14 @@ var CallbackConstructorRegistry = class { } }; CallbackConstructorRegistry.constructors = {}; -function configureCallbacks(callbacks2, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { +function configureCallbacks(callbacks22, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { const history = new History(); const actualCallbacks = [ new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose) ]; - if (callbacks2 != null) { - actualCallbacks.push(...callbacks2); + if (callbacks22 != null) { + actualCallbacks.push(...callbacks22); } actualCallbacks.push(history); const callbackList = new CallbackList(actualCallbacks); @@ -21224,8 +23391,8 @@ function l2Normalize(x, axis) { } const squareSum = sum2(square2(x), axis, true); const epsilonTensor = fill(squareSum.shape, epsilon()); - const norm2 = sqrt(maximum(squareSum, epsilonTensor)); - return div(x, norm2); + const norm22 = sqrt(maximum(squareSum, epsilonTensor)); + return div(x, norm22); }); } function meanSquaredError2(yTrue, yPred) { @@ -21266,8 +23433,8 @@ function hinge(yTrue, yPred) { function categoricalHinge(yTrue, yPred) { return tidy(() => { const pos = sum2(mul(yTrue, yPred), -1); - const neg4 = max(mul(sub(1, yTrue), yPred), -1); - return maximum(0, add2(1, sub(neg4, pos))); + const neg42 = max(mul(sub(1, yTrue), yPred), -1); + return maximum(0, add2(1, sub(neg42, pos))); }); } function logcosh(yTrue, yPred) { @@ -21370,8 +23537,8 @@ function get(identifierOrFn) { } function binaryAccuracy(yTrue, yPred) { return tidy(() => { - const threshold3 = mul(0.5, onesLike(yPred)); - const yPredThresholded = cast2(greater(yPred, threshold3), yTrue.dtype); + const threshold32 = mul(0.5, onesLike(yPred)); + const yPredThresholded = cast2(greater(yPred, threshold32), yTrue.dtype); return mean(equal(yTrue, yPredThresholded), -1); }); } @@ -21556,7 +23723,7 @@ function printSummary(model22, lineLength, positions, printFn = console.log) { positions = positions || [0.33, 0.55, 0.67, 1]; } if (positions[positions.length - 1] <= 1) { - positions = positions.map((p2) => Math.floor(lineLength * p2)); + positions = positions.map((p22) => Math.floor(lineLength * p22)); } let relevantNodes; if (!sequentialLike) { @@ -21899,17 +24066,17 @@ function execute(fetches, feedDict, kwargs, probe) { const inputMasks = []; const tensorsToDispose = []; let maskExists = false; - for (const input2 of symbolic.inputs) { - const value = internalFeedDict.getValue(input2); - const mask = internalFeedDict.getMask(input2); + for (const input22 of symbolic.inputs) { + const value = internalFeedDict.getValue(input22); + const mask = internalFeedDict.getMask(input22); inputValues.push(value); inputMasks.push(mask); if (mask != null) { maskExists = true; } if (!training) { - recipientCounts[input2.name]--; - if (recipientCounts[input2.name] === 0 && !feedDict.hasKey(input2) && outputNames.indexOf(input2.name) === -1 && !value.isDisposed && input2.sourceLayer.stateful !== true) { + recipientCounts[input22.name]--; + if (recipientCounts[input22.name] === 0 && !feedDict.hasKey(input22) && outputNames.indexOf(input22.name) === -1 && !value.isDisposed && input22.sourceLayer.stateful !== true) { tensorsToDispose.push(value); } } @@ -21951,8 +24118,8 @@ function getTopologicalSortAndRecipientCounts(fetches, feedDict) { finalRecipientMap = out.recipientMap; } else { const visited = new Set(); - for (const fetch4 of fetches) { - const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch(fetch4, feedDict); + for (const fetch42 of fetches) { + const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch(fetch42, feedDict); for (const symbolicTensor of sorted) { if (!visited.has(symbolicTensor.name)) { finalSorted.push(symbolicTensor); @@ -21979,61 +24146,61 @@ function recipientMap2Counts(recipientMap) { } return recipientCounts; } -function getTopologicalSortAndRecipientCountsForOneFetch(fetch4, feedDict) { +function getTopologicalSortAndRecipientCountsForOneFetch(fetch42, feedDict) { const visited = new Set(); const sorted = []; const recipientMap = {}; for (const key of feedDict.names()) { visited.add(key); } - const stack2 = []; + const stack22 = []; const marks = []; - stack2.push(fetch4); - while (stack2.length > 0) { - const top = stack2[stack2.length - 1]; + stack22.push(fetch42); + while (stack22.length > 0) { + const top = stack22[stack22.length - 1]; if (visited.has(top.name)) { - stack2.pop(); + stack22.pop(); continue; } - const topIsMarked = marks[marks.length - 1] === stack2.length - 1; + const topIsMarked = marks[marks.length - 1] === stack22.length - 1; if (top.inputs.length === 0 || topIsMarked) { - stack2.pop(); + stack22.pop(); sorted.push(top); visited.add(top.name); if (topIsMarked) { marks.pop(); } } else { - marks.push(stack2.length - 1); - for (const input2 of top.inputs) { - if (recipientMap[input2.name] == null) { - recipientMap[input2.name] = new Set(); + marks.push(stack22.length - 1); + for (const input22 of top.inputs) { + if (recipientMap[input22.name] == null) { + recipientMap[input22.name] = new Set(); } - recipientMap[input2.name].add(top.name); - if (visited.has(input2.name)) { + recipientMap[input22.name].add(top.name); + if (visited.has(input22.name)) { continue; } - stack2.push(input2); + stack22.push(input22); } } } return { sorted, recipientMap }; } -function getNodeOutputs(fetch4) { +function getNodeOutputs(fetch42) { let layerOutputs; - if (fetch4.sourceLayer.inboundNodes.length === 1) { - layerOutputs = fetch4.sourceLayer.output; + if (fetch42.sourceLayer.inboundNodes.length === 1) { + layerOutputs = fetch42.sourceLayer.output; } else { let nodeIndex = null; - for (let i = 0; i < fetch4.sourceLayer.inboundNodes.length; ++i) { - for (const outputTensor of fetch4.sourceLayer.inboundNodes[i].outputTensors) { - if (outputTensor.id === fetch4.id) { + for (let i = 0; i < fetch42.sourceLayer.inboundNodes.length; ++i) { + for (const outputTensor of fetch42.sourceLayer.inboundNodes[i].outputTensors) { + if (outputTensor.id === fetch42.id) { nodeIndex = i; break; } } } - layerOutputs = fetch4.sourceLayer.getOutputAt(nodeIndex); + layerOutputs = fetch42.sourceLayer.getOutputAt(nodeIndex); } return layerOutputs; } @@ -22115,15 +24282,15 @@ var Container = class extends Layer { const layerIDToLayer = {}; const layerIndices = {}; const nodesInDecreasingDepth = []; - const buildMapOfGraph = (tensor2, finishedNodes2, nodesInProgress2, layer, nodeIndex, tensorIndex) => { + const buildMapOfGraph = (tensor22, finishedNodes2, nodesInProgress2, layer, nodeIndex, tensorIndex) => { if (layer == null || nodeIndex == null || tensorIndex == null) { - layer = tensor2.sourceLayer; - nodeIndex = tensor2.nodeIndex; - tensorIndex = tensor2.tensorIndex; + layer = tensor22.sourceLayer; + nodeIndex = tensor22.nodeIndex; + tensorIndex = tensor22.tensorIndex; } const node2 = layer.inboundNodes[nodeIndex]; if (nodesInProgress2.indexOf(node2) !== -1) { - throw new RuntimeError(`The tensor ${tensor2.name} at layer "${layer.name}" is part of a cycle.`); + throw new RuntimeError(`The tensor ${tensor22.name} at layer "${layer.name}" is part of a cycle.`); } if (finishedNodes2.indexOf(node2) !== -1) { return; @@ -22513,9 +24680,9 @@ var Container = class extends Layer { const outputShapes = []; for (const x of this.outputs) { assert2(x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); - const [tensor2, mask] = tensorMap[x.id]; - outputShapes.push(tensor2.shape); - outputTensors.push(tensor2); + const [tensor22, mask] = tensorMap[x.id]; + outputShapes.push(tensor22.shape); + outputTensors.push(tensor22); outputMasks.push(mask); } return [outputTensors, outputMasks, outputShapes]; @@ -22909,9 +25076,9 @@ async function fitDataset(model22, dataset, args) { } else { callbackMetrics = outLabels.slice(); } - const callbacks2 = standardizeCallbacks(args.callbacks, args.yieldEvery); + const callbacks22 = standardizeCallbacks(args.callbacks, args.yieldEvery); const verbose = args.verbose == null ? 1 : args.verbose; - const { callbackList, history } = configureCallbacks(callbacks2, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, doValidation, callbackMetrics); + const { callbackList, history } = configureCallbacks(callbacks22, verbose, args.epochs, null, null, getStepsPerEpoch(dataset, args), null, doValidation, callbackMetrics); callbackList.setModel(model22); model22.history = history; await callbackList.onTrainBegin(); @@ -23069,7 +25236,7 @@ function sliceArrays(arrays, start, stop) { if (arrays == null) { return [null]; } else if (Array.isArray(arrays)) { - return arrays.map((array2) => sliceAlongFirstAxis(array2, start, stop - start)); + return arrays.map((array22) => sliceAlongFirstAxis(array22, start, stop - start)); } else { return sliceAlongFirstAxis(arrays, start, stop - start); } @@ -23079,7 +25246,7 @@ function sliceArraysByIndices(arrays, indices) { if (arrays == null) { return null; } else if (Array.isArray(arrays)) { - return arrays.map((array2) => sliceArraysByIndices(array2, indices)); + return arrays.map((array22) => sliceArraysByIndices(array22, indices)); } else { return gather2(arrays, indices.dtype === "int32" ? indices : cast(indices, "int32")); } @@ -23099,15 +25266,15 @@ function makeBatches(size2, batchSize) { } return output; } -async function fitLoop(model22, f, ins, outLabels, batchSize, epochs, verbose, callbacks2, valF, valIns, shuffle2, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { +async function fitLoop(model22, f, ins, outLabels, batchSize, epochs, verbose, callbacks22, valF, valIns, shuffle22, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { if (batchSize == null) { batchSize = 32; } if (epochs == null) { epochs = 1; } - if (shuffle2 == null) { - shuffle2 = true; + if (shuffle22 == null) { + shuffle22 = true; } if (initialEpoch == null) { initialEpoch = 0; @@ -23130,7 +25297,7 @@ async function fitLoop(model22, f, ins, outLabels, batchSize, epochs, verbose, c if (verbose == null) { verbose = 1; } - const { callbackList, history } = configureCallbacks(callbacks2, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); + const { callbackList, history } = configureCallbacks(callbacks22, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); callbackList.setModel(model22); model22.history = history; await callbackList.onTrainBegin(); @@ -23141,9 +25308,9 @@ async function fitLoop(model22, f, ins, outLabels, batchSize, epochs, verbose, c if (stepsPerEpoch != null) { throw new NotImplementedError("stepsPerEpoch mode is not implemented yet."); } else { - if (shuffle2 === "batch") { + if (shuffle22 === "batch") { throw new NotImplementedError("batch shuffling is not implemneted yet"); - } else if (shuffle2) { + } else if (shuffle22) { util_exports.shuffle(indexArray); } const epochIndexArray1D = tensor1d(indexArray); @@ -23258,8 +25425,8 @@ async function fitTensors(model22, x, y, args = {}) { valIns = []; callbackMetrics = outLabels.slice(); } - const callbacks2 = standardizeCallbacks(args.callbacks, args.yieldEvery); - const out = await fitLoop(model22, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks2, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); + const callbacks22 = standardizeCallbacks(args.callbacks, args.yieldEvery); + const out = await fitLoop(model22, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks22, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); return out; } finally { model22.isTraining = false; @@ -23278,13 +25445,13 @@ function ensureTensorsRank2OrHigher(tensors) { tensors = [tensors]; } for (let i = 0; i < tensors.length; ++i) { - const tensor2 = tensors[i]; - if (tensor2.rank === 1) { - outs.push(expandDims2(tensor2, 1)); - } else if (tensor2.rank === 0) { + const tensor22 = tensors[i]; + if (tensor22.rank === 1) { + outs.push(expandDims2(tensor22, 1)); + } else if (tensor22.rank === 0) { throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar)."); } else { - outs.push(tensor2); + outs.push(tensor22); } } return outs; @@ -23317,9 +25484,9 @@ function disposeNewTensors(tensors, refTensors) { }); } else if (tensors != null) { for (const name in tensors) { - const tensor2 = tensors[name]; - if (oldTensorIds.indexOf(tensor2.id) === -1) { - tensorsToDispose.push(tensor2); + const tensor22 = tensors[name]; + if (oldTensorIds.indexOf(tensor22.id) === -1) { + tensorsToDispose.push(tensor22); } } } @@ -23392,18 +25559,18 @@ function standardizeInputData(data, names, shapes, checkBatchAxis = true, except if (shapes[i] == null) { continue; } - const array2 = arrays[i]; - if (array2.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s). but got array with shape ${array2.shape}`); + const array22 = arrays[i]; + if (array22.shape.length !== shapes[i].length) { + throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s). but got array with shape ${array22.shape}`); } for (let j = 0; j < shapes[i].length; ++j) { if (j === 0 && !checkBatchAxis) { continue; } - const dim = array2.shape[j]; + const dim = array22.shape[j]; const refDim = shapes[i][j]; if (refDim != null && refDim >= 0 && dim !== refDim) { - throw new ValueError(`${exceptionPrefix} expected a batch of elements where each example has shape [${shapes[i].slice(1, shapes[i].length)}] (i.e.,tensor shape [*,${shapes[i].slice(1, shapes[i].length)}]) but the ${exceptionPrefix} received an input with ${array2.shape[0]} examples, each with shape [${array2.shape.slice(1, array2.shape.length)}] (tensor shape [${array2.shape}])`); + throw new ValueError(`${exceptionPrefix} expected a batch of elements where each example has shape [${shapes[i].slice(1, shapes[i].length)}] (i.e.,tensor shape [*,${shapes[i].slice(1, shapes[i].length)}]) but the ${exceptionPrefix} received an input with ${array22.shape[0]} examples, each with shape [${array22.shape.slice(1, array22.shape.length)}] (tensor shape [${array22.shape}])`); } } } @@ -23411,12 +25578,12 @@ function standardizeInputData(data, names, shapes, checkBatchAxis = true, except return arrays; } function checkArrayLengths(inputs, targets, weights) { - const setX = unique2(inputs.map((input2) => input2.shape[0])); + const setX = unique2(inputs.map((input22) => input22.shape[0])); setX.sort(); const setY = unique2(targets.map((target) => target.shape[0])); setY.sort(); if (setX.length > 1) { - throw new ValueError(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(inputs.map((input2) => input2.shape))}`); + throw new ValueError(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(inputs.map((input22) => input22.shape))}`); } if (setY.length > 1) { throw new ValueError(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(targets.map((target) => target.shape))}`); @@ -23474,19 +25641,19 @@ function checkInputData(data, names, shapes, checkBatchAxis = true, exceptionPre if (shapes[i] == null) { continue; } - const array2 = arrays[i]; - if (array2.shape.length !== shapes[i].length) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s), but got array with shape ${JSON.stringify(array2.shape)}`); + const array22 = arrays[i]; + if (array22.shape.length !== shapes[i].length) { + throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s), but got array with shape ${JSON.stringify(array22.shape)}`); } for (let j = 0; j < shapes[i].length; ++j) { if (j === 0 && !checkBatchAxis) { continue; } - const dim = array2.shape[j]; + const dim = array22.shape[j]; const refDim = shapes[i][j]; if (refDim != null) { if (refDim !== dim) { - throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have shape ${JSON.stringify(shapes[i])} but got array with shape ${JSON.stringify(array2.shape)}.`); + throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have shape ${JSON.stringify(shapes[i])} but got array with shape ${JSON.stringify(array22.shape)}.`); } } } @@ -23730,12 +25897,12 @@ var LayersModel = class extends Container { feedDict.add(this.inputs[i], inputs[i]); } } else { - for (const input2 of this.inputs) { - const tensorValue = inputs[input2.name]; + for (const input22 of this.inputs) { + const tensorValue = inputs[input22.name]; if (tensorValue == null) { - throw new ValueError(`No value is provided for the model's input ${input2.name}`); + throw new ValueError(`No value is provided for the model's input ${input22.name}`); } - feedDict.add(input2, tensorValue); + feedDict.add(input22, tensorValue); } } const executeOutputs = execute(outputSymbolicTensors, feedDict); @@ -23763,8 +25930,8 @@ var LayersModel = class extends Container { } if (outputsRemaining > 0) { const remainingNames = []; - outputSymbolicTensors.forEach((tensor2, i) => { - if (tensor2 == null) { + outputSymbolicTensors.forEach((tensor22, i) => { + if (tensor22 == null) { remainingNames.push(symbolicTensorNames[i]); } }); @@ -24258,8 +26425,8 @@ async function loadLayersModelFromIOHandler(handler, customObjects, options3) { } return model22; } -function decodeModelAndOptimizerWeights(buffer2, specs) { - const name2Tensor = io_exports.decodeWeights(buffer2, specs); +function decodeModelAndOptimizerWeights(buffer22, specs) { + const name2Tensor = io_exports.decodeWeights(buffer22, specs); const modelWeights = {}; const optimizerWeights = []; specs.forEach((spec) => { @@ -24948,29 +27115,29 @@ function normalizeArray(value, n, name) { return value; } } -function convOutputLength(inputLength, filterSize, padding, stride, dilation = 1) { +function convOutputLength(inputLength, filterSize, padding2, stride, dilation = 1) { if (inputLength == null) { return inputLength; } const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); let outputLength; - if (padding === "same") { + if (padding2 === "same") { outputLength = inputLength; } else { outputLength = inputLength - dilatedFilterSize + 1; } return Math.floor((outputLength + stride - 1) / stride); } -function deconvLength(dimSize, strideSize, kernelSize, padding) { +function deconvLength(dimSize, strideSize, kernelSize, padding2) { if (dimSize == null) { return null; } - if (padding === "valid") { + if (padding2 === "valid") { dimSize = dimSize * strideSize + max2([kernelSize - strideSize, 0]); - } else if (padding === "same") { + } else if (padding2 === "same") { dimSize = dimSize * strideSize; } else { - throw new ValueError(`Unsupport padding mode: ${padding}.`); + throw new ValueError(`Unsupport padding mode: ${padding2}.`); } return dimSize; } @@ -24994,7 +27161,7 @@ function preprocessConv3DInput(x, dataFormat) { } }); } -function conv1dWithBias(x, kernel, bias, strides = 1, padding = "valid", dataFormat, dilationRate = 1) { +function conv1dWithBias(x, kernel, bias, strides = 1, padding2 = "valid", dataFormat, dilationRate = 1) { return tidy(() => { if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -25012,17 +27179,17 @@ function conv1dWithBias(x, kernel, bias, strides = 1, padding = "valid", dataFor if (dataFormat === "channelsFirst") { x = transpose(x, [0, 2, 1]); } - if (padding === "causal") { + if (padding2 === "causal") { throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet."); } - let y = conv1d(x, kernel, strides, padding === "same" ? "same" : "valid", "NWC", dilationRate); + let y = conv1d(x, kernel, strides, padding2 === "same" ? "same" : "valid", "NWC", dilationRate); if (bias != null) { y = biasAdd(y, bias); } return y; }); } -function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = "valid", dataFormat, dilationRate, activation2 = null) { +function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding2 = "valid", dataFormat, dilationRate, activation2 = null) { return tidy(() => { if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -25035,14 +27202,14 @@ function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = " throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${x.rank}.`); } let y = preprocessConv2DInput(x, dataFormat); - if (padding === "causal") { + if (padding2 === "causal") { throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet."); } y = fused_ops_exports.conv2d({ x: y, filter: kernel, strides, - pad: padding === "same" ? "same" : "valid", + pad: padding2 === "same" ? "same" : "valid", dilations: dilationRate, dataFormat: "NHWC", bias, @@ -25054,7 +27221,7 @@ function conv2dWithBiasActivation(x, kernel, bias, strides = [1, 1], padding = " return y; }); } -function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding = "valid", dataFormat, dilationRate) { +function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding2 = "valid", dataFormat, dilationRate) { return tidy(() => { if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -25067,10 +27234,10 @@ function conv3dWithBias(x, kernel, bias, strides = [1, 1, 1], padding = "valid", throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${x.rank}.`); } let y = preprocessConv3DInput(x, dataFormat); - if (padding === "causal") { + if (padding2 === "causal") { throw new NotImplementedError("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet."); } - y = conv3d(y, kernel, strides, padding === "same" ? "same" : "valid", "NDHWC", dilationRate); + y = conv3d(y, kernel, strides, padding2 === "same" ? "same" : "valid", "NDHWC", dilationRate); if (bias != null) { y = biasAdd(y, bias); } @@ -25298,11 +27465,11 @@ var Conv2DTranspose = class extends Conv2D2 { } call(inputs, kwargs) { return tidy(() => { - let input2 = getExactlyOneTensor(inputs); - if (input2.shape.length !== 4) { - throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input2.shape.length}`); + let input22 = getExactlyOneTensor(inputs); + if (input22.shape.length !== 4) { + throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input22.shape.length}`); } - const inputShape = input2.shape; + const inputShape = input22.shape; const batchSize = inputShape[0]; let hAxis; let wAxis; @@ -25323,9 +27490,9 @@ var Conv2DTranspose = class extends Conv2D2 { const outWidth = deconvLength(width, strideW, kernelW, this.padding); const outputShape = [batchSize, outHeight, outWidth, this.filters]; if (this.dataFormat !== "channelsLast") { - input2 = transpose(input2, [0, 2, 3, 1]); + input22 = transpose(input22, [0, 2, 3, 1]); } - let outputs = conv2dTranspose(input2, this.kernel.read(), outputShape, this.strides, this.padding); + let outputs = conv2dTranspose(input22, this.kernel.read(), outputShape, this.strides, this.padding); if (this.dataFormat !== "channelsLast") { outputs = transpose(outputs, [0, 3, 1, 2]); } @@ -25398,11 +27565,11 @@ var Conv3DTranspose = class extends Conv3D2 { } call(inputs, kwargs) { return tidy(() => { - let input2 = getExactlyOneTensor(inputs); - if (input2.shape.length !== 5) { - throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input2.shape.length}`); + let input22 = getExactlyOneTensor(inputs); + if (input22.shape.length !== 5) { + throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input22.shape.length}`); } - const inputShape = input2.shape; + const inputShape = input22.shape; const batchSize = inputShape[0]; let hAxis; let wAxis; @@ -25430,9 +27597,9 @@ var Conv3DTranspose = class extends Conv3D2 { const outWidth = deconvLength(width, strideW, kernelW, this.padding); const outputShape = [batchSize, outDepth, outHeight, outWidth, this.filters]; if (this.dataFormat !== "channelsLast") { - input2 = transpose(input2, [0, 2, 3, 4, 1]); + input22 = transpose(input22, [0, 2, 3, 4, 1]); } - let outputs = conv3dTranspose(input2, this.kernel.read(), outputShape, this.strides, this.padding); + let outputs = conv3dTranspose(input22, this.kernel.read(), outputShape, this.strides, this.padding); if (this.dataFormat !== "channelsLast") { outputs = transpose(outputs, [0, 4, 1, 2, 3]); } @@ -25679,18 +27846,18 @@ var UpSampling2D = class extends Layer { } call(inputs, kwargs) { return tidy(() => { - let input2 = getExactlyOneTensor(inputs); - const inputShape = input2.shape; + let input22 = getExactlyOneTensor(inputs); + const inputShape = input22.shape; if (this.dataFormat === "channelsFirst") { - input2 = transpose(input2, [0, 2, 3, 1]); + input22 = transpose(input22, [0, 2, 3, 1]); const height = this.size[0] * inputShape[2]; const width = this.size[1] * inputShape[3]; - const resized = this.interpolation === "nearest" ? image.resizeNearestNeighbor(input2, [height, width]) : image.resizeBilinear(input2, [height, width]); + const resized = this.interpolation === "nearest" ? image.resizeNearestNeighbor(input22, [height, width]) : image.resizeBilinear(input22, [height, width]); return transpose(resized, [0, 3, 1, 2]); } else { const height = this.size[0] * inputShape[1]; const width = this.size[1] * inputShape[2]; - return this.interpolation === "nearest" ? image.resizeNearestNeighbor(input2, [height, width]) : image.resizeBilinear(input2, [height, width]); + return this.interpolation === "nearest" ? image.resizeNearestNeighbor(input22, [height, width]) : image.resizeBilinear(input22, [height, width]); } }); } @@ -25703,7 +27870,7 @@ var UpSampling2D = class extends Layer { }; UpSampling2D.className = "UpSampling2D"; serialization_exports.registerClass(UpSampling2D); -function depthwiseConv2d3(x, depthwiseKernel, strides = [1, 1], padding = "valid", dataFormat, dilationRate) { +function depthwiseConv2d3(x, depthwiseKernel, strides = [1, 1], padding2 = "valid", dataFormat, dilationRate) { return tidy(() => { if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -25716,7 +27883,7 @@ function depthwiseConv2d3(x, depthwiseKernel, strides = [1, 1], padding = "valid if (depthwiseKernel.rank !== 4) { throw new ValueError(`depthwiseKernel is required to be 4-D, but is instead ${depthwiseKernel.rank}-D`); } - y = depthwiseConv2d(y, depthwiseKernel, strides, padding === "same" ? "same" : "valid", "NHWC", dilationRate); + y = depthwiseConv2d(y, depthwiseKernel, strides, padding2 === "same" ? "same" : "valid", "NHWC", dilationRate); if (dataFormat === "channelsFirst") { y = transpose(y, [0, 3, 1, 2]); } @@ -26124,11 +28291,11 @@ var RNN = class extends Layer { console.warn("Ignoring unroll = true for RNN layer, due to imperative backend."); } const cellCallKwargs = { training }; - const step5 = (inputs2, states2) => { + const step52 = (inputs2, states2) => { const outputs2 = this.cell.call([inputs2].concat(states2), cellCallKwargs); return [outputs2[0], outputs2.slice(1)]; }; - const rnnOutputs = rnn(step5, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); + const rnnOutputs = rnn(step52, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); const lastOutput = rnnOutputs[0]; const outputs = rnnOutputs[1]; const states = rnnOutputs[2]; @@ -26805,9 +28972,9 @@ var StackedRNNCells = class extends RNNCell { StackedRNNCells.className = "StackedRNNCells"; serialization_exports.registerClass(StackedRNNCells); function generateDropoutMask(args) { - const { ones: ones4, rate, training = false, count: count22 = 1 } = args; - const droppedInputs = () => dropout2(ones4(), rate); - const createMask = () => inTrainPhase(droppedInputs, ones4, training); + const { ones: ones42, rate, training = false, count: count22 = 1 } = args; + const droppedInputs = () => dropout2(ones42(), rate); + const createMask = () => inTrainPhase(droppedInputs, ones42, training); if (!count22 || count22 <= 1) { return keep(createMask().clone()); } @@ -26816,13 +28983,13 @@ function generateDropoutMask(args) { } var __rest = function(s, e) { var t = {}; - for (var p2 in s) - if (Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0) - t[p2] = s[p2]; + for (var p22 in s) + if (Object.prototype.hasOwnProperty.call(s, p22) && e.indexOf(p22) < 0) + t[p22] = s[p22]; if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) { - if (e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i])) - t[p2[i]] = s[p2[i]]; + for (var i = 0, p22 = Object.getOwnPropertySymbols(s); i < p22.length; i++) { + if (e.indexOf(p22[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p22[i])) + t[p22[i]] = s[p22[i]]; } return t; }; @@ -26933,12 +29100,12 @@ var ConvRNN2D = class extends RNN { }); } computeSingleOutputShape(inputShape) { - const { dataFormat, filters, kernelSize, padding, strides, dilationRate } = this.cell; + const { dataFormat, filters, kernelSize, padding: padding2, strides, dilationRate } = this.cell; const isChannelsFirst = dataFormat === "channelsFirst"; const h = inputShape[isChannelsFirst ? 3 : 2]; const w = inputShape[isChannelsFirst ? 4 : 3]; - const hOut = convOutputLength(h, kernelSize[0], padding, strides[0], dilationRate[0]); - const wOut = convOutputLength(w, kernelSize[1], padding, strides[1], dilationRate[1]); + const hOut = convOutputLength(h, kernelSize[0], padding2, strides[0], dilationRate[0]); + const wOut = convOutputLength(w, kernelSize[1], padding2, strides[1], dilationRate[1]); const outShape = [ ...inputShape.slice(0, 2), ...isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters] @@ -26949,7 +29116,7 @@ var ConvRNN2D = class extends RNN { ConvRNN2D.className = "ConvRNN2D"; var ConvLSTM2DCell = class extends LSTMCell { constructor(args) { - const { filters, kernelSize, strides, padding, dataFormat, dilationRate } = args; + const { filters, kernelSize, strides, padding: padding2, dataFormat, dilationRate } = args; super(Object.assign({}, args, { units: filters })); this.filters = filters; assertPositiveInteger(this.filters, "filters"); @@ -26957,7 +29124,7 @@ var ConvLSTM2DCell = class extends LSTMCell { this.kernelSize.forEach((size2) => assertPositiveInteger(size2, "kernelSize")); this.strides = normalizeArray(strides || 1, 2, "strides"); this.strides.forEach((stride) => assertPositiveInteger(stride, "strides")); - this.padding = padding || "valid"; + this.padding = padding2 || "valid"; checkPaddingMode(this.padding); this.dataFormat = dataFormat || "channelsLast"; checkDataFormat(this.dataFormat); @@ -27070,8 +29237,8 @@ var ConvLSTM2DCell = class extends LSTMCell { }; return Object.assign({}, baseConfig, config3); } - inputConv(x, w, b, padding) { - const out = conv2d(x, w, this.strides, padding || "valid", this.dataFormat === "channelsFirst" ? "NCHW" : "NHWC", this.dilationRate); + inputConv(x, w, b, padding2) { + const out = conv2d(x, w, this.strides, padding2 || "valid", this.dataFormat === "channelsFirst" ? "NCHW" : "NHWC", this.dilationRate); if (b) { return biasAdd(out, b, this.dataFormat); } @@ -27103,11 +29270,11 @@ var Dropout = class extends Layer { this.seed = args.seed; this.supportsMasking = true; } - getNoiseShape(input2) { + getNoiseShape(input22) { if (this.noiseShape == null) { return this.noiseShape; } - const inputShape = input2.shape; + const inputShape = input22.shape; const noiseShape = []; for (let i = 0; i < this.noiseShape.length; ++i) { noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); @@ -27117,11 +29284,11 @@ var Dropout = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); if (0 < this.rate && this.rate < 1) { const training = kwargs["training"] == null ? false : kwargs["training"]; - const noiseShape = this.getNoiseShape(input2); - const output = inTrainPhase(() => dropout2(input2, this.rate, noiseShape, this.seed), () => input2, training); + const noiseShape = this.getNoiseShape(input22); + const output = inTrainPhase(() => dropout2(input22, this.rate, noiseShape, this.seed), () => input22, training); return output; } return inputs; @@ -27148,8 +29315,8 @@ var SpatialDropout1D = class extends Dropout { super(args); this.inputSpec = [{ ndim: 3 }]; } - getNoiseShape(input2) { - const inputShape = input2.shape; + getNoiseShape(input22) { + const inputShape = input22.shape; return [inputShape[0], 1, inputShape[2]]; } }; @@ -27208,13 +29375,13 @@ var Dense = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); const fusedActivationName = mapActivationToFusedKernel(this.activation.getClassName()); let output; if (fusedActivationName != null) { - output = dot2(input2, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); + output = dot2(input22, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); } else { - output = dot2(input2, this.kernel.read()); + output = dot2(input22, this.kernel.read()); if (this.bias != null) { output = biasAdd(output, this.bias.read()); } @@ -27264,16 +29431,16 @@ var Flatten = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - let input2 = getExactlyOneTensor(inputs); - if (this.dataFormat === "channelsFirst" && input2.rank > 1) { + let input22 = getExactlyOneTensor(inputs); + if (this.dataFormat === "channelsFirst" && input22.rank > 1) { const permutation = [0]; - for (let i = 2; i < input2.rank; ++i) { + for (let i = 2; i < input22.rank; ++i) { permutation.push(i); } permutation.push(1); - input2 = transpose(input2, permutation); + input22 = transpose(input22, permutation); } - return batchFlatten(input2); + return batchFlatten(input22); }); } getConfig() { @@ -27297,8 +29464,8 @@ var Activation2 = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); - return this.activation.apply(input2); + const input22 = getExactlyOneTensor(inputs); + return this.activation.apply(input22); }); } getConfig() { @@ -27394,10 +29561,10 @@ var Reshape2 = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); - const inputShape = input2.shape; + const input22 = getExactlyOneTensor(inputs); + const inputShape = input22.shape; const outputShape = inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); - return reshape(input2, outputShape); + return reshape(input22, outputShape); }); } getConfig() { @@ -27470,18 +29637,18 @@ var Masking = class extends Layer { return config3; } computeMask(inputs, mask) { - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); const axis = -1; - return any(notEqual(input2, this.maskValue), axis); + return any(notEqual(input22, this.maskValue), axis); } call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); const axis = -1; const keepDims = true; - const booleanMask = any(notEqual(input2, this.maskValue), axis, keepDims); - const output = mul(input2, cast(booleanMask, input2.dtype)); + const booleanMask = any(notEqual(input22, this.maskValue), axis, keepDims); + const output = mul(input22, cast(booleanMask, input22.dtype)); return output; }); } @@ -27558,12 +29725,12 @@ var Embedding = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - let input2 = getExactlyOneTensor(inputs); - if (input2.dtype !== "int32") { - input2 = cast2(input2, "int32"); + let input22 = getExactlyOneTensor(inputs); + if (input22.dtype !== "int32") { + input22 = cast2(input22, "int32"); } - const output = gather2(this.embeddings.read(), reshape(input2, [input2.size])); - return reshape(output, getExactlyOneShape(this.computeOutputShape(input2.shape))); + const output = gather2(this.embeddings.read(), reshape(input22, [input22.size])); + return reshape(output, getExactlyOneShape(this.computeOutputShape(input22.shape))); }); } getConfig() { @@ -27654,7 +29821,7 @@ var Merge = class extends Layer { inputs = inputs; if (this.reshapeRequired) { const reshapedInputs = []; - const inputDims = inputs.map((input2) => input2.rank); + const inputDims = inputs.map((input22) => input22.rank); if (inputDims.indexOf(null) === -1) { const maxNDim = max2(inputDims); for (let x of inputs) { @@ -28131,9 +30298,9 @@ var GaussianNoise = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); - const noised = () => add2(randomNormal2(input2.shape, 0, this.stddev), input2); - const output = inTrainPhase(noised, () => input2, kwargs["training"] || false); + const input22 = getExactlyOneTensor(inputs); + const noised = () => add2(randomNormal2(input22.shape, 0, this.stddev), input22); + const output = inTrainPhase(noised, () => input22, kwargs["training"] || false); return output; }); } @@ -28158,15 +30325,15 @@ var GaussianDropout = class extends Layer { call(inputs, kwargs) { return tidy(() => { this.invokeCallHook(inputs, kwargs); - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); if (this.rate > 0 && this.rate < 1) { const noised = () => { const stddev = Math.sqrt(this.rate / (1 - this.rate)); - return mul(input2, randomNormal2(input2.shape, 1, stddev)); + return mul(input22, randomNormal2(input22.shape, 1, stddev)); }; - return inTrainPhase(noised, () => input2, kwargs["training"] || false); + return inTrainPhase(noised, () => input22, kwargs["training"] || false); } - return input2; + return input22; }); } }; @@ -28196,7 +30363,7 @@ var AlphaDropout = class extends Layer { if (this.rate < 1 && this.rate > 0) { const noiseShape = this._getNoiseShape(inputs); const droppedInputs = () => { - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); const alpha = 1.6732632423543772; const scale22 = 1.0507009873554805; const alphaP = -alpha * scale22; @@ -28204,7 +30371,7 @@ var AlphaDropout = class extends Layer { keptIdx = cast2(keptIdx, "float32"); const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; const b = -a * alphaP * this.rate; - const x = add2(mul(input2, keptIdx), mul(add2(keptIdx, -1), alphaP)); + const x = add2(mul(input22, keptIdx), mul(add2(keptIdx, -1), alphaP)); return add2(mul(x, a), b); }; return inTrainPhase(droppedInputs, () => getExactlyOneTensor(inputs), kwargs["training"] || false); @@ -28215,32 +30382,32 @@ var AlphaDropout = class extends Layer { }; AlphaDropout.className = "AlphaDropout"; serialization_exports.registerClass(AlphaDropout); -function batchNormalization(x, mean4, variance, beta, gamma, epsilon3 = 1e-3) { +function batchNormalization(x, mean42, variance, beta, gamma, epsilon32 = 1e-3) { let out; if (x.rank === 2) { - out = batchNorm2d(x, mean4, variance, beta, gamma, epsilon3); + out = batchNorm2d(x, mean42, variance, beta, gamma, epsilon32); } else if (x.rank === 3) { - out = batchNorm3d(x, mean4, variance, beta, gamma, epsilon3); + out = batchNorm3d(x, mean42, variance, beta, gamma, epsilon32); } else if (x.rank === 4) { - out = batchNorm4d(x, mean4, variance, beta, gamma, epsilon3); + out = batchNorm4d(x, mean42, variance, beta, gamma, epsilon32); } else { throw new NotImplementedError(`batchNormalization is not implemented for array of rank ${x.rank} yet`); } return out; } -function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon3 = 1e-3) { +function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon32 = 1e-3) { return tidy(() => { const meanAndVariance = moments(x, reductionAxes); - const mean4 = meanAndVariance.mean; + const mean42 = meanAndVariance.mean; const variance = meanAndVariance.variance; - const normed = batchNormalization(x, mean4, variance, beta, gamma, epsilon3); - return [normed, mean4, variance]; + const normed = batchNormalization(x, mean42, variance, beta, gamma, epsilon32); + return [normed, mean42, variance]; }); } -function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon3 = 1e-3) { +function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon32 = 1e-3) { return tidy(() => { const meanAndVariance = moments(x, reductionAxes); - const mean4 = meanAndVariance.mean; + const mean42 = meanAndVariance.mean; const variance = meanAndVariance.variance; const targetShape = []; for (const axis of range2(0, x.rank)) { @@ -28250,19 +30417,19 @@ function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilo targetShape.push(x.shape[axis]); } } - const broadcastMean = reshape(mean4, targetShape); + const broadcastMean = reshape(mean42, targetShape); const broadcastVariance = reshape(variance, targetShape); const broadcastGamma = gamma == null ? null : reshape(gamma, targetShape); const broadcastBeta = beta == null ? null : reshape(beta, targetShape); - const normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon3); - return [normed, mean4, variance]; + const normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon32); + return [normed, mean42, variance]; }); } -function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon3 = 1e-3) { +function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon32 = 1e-3) { if (util_exports.arraysEqual(reductionAxes.slice().sort(), range2(0, x.rank - 1))) { - return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon3); + return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon32); } else { - return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon3); + return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon32); } } var BatchNormalization = class extends Layer { @@ -28308,8 +30475,8 @@ var BatchNormalization = class extends Layer { call(inputs, kwargs) { return tidy(() => { const training = kwargs["training"] == null ? false : kwargs["training"]; - const input2 = getExactlyOneTensor(inputs); - const inputShape = input2.shape; + const input22 = getExactlyOneTensor(inputs); + const inputShape = input22.shape; const ndim = inputShape.length; const reductionAxes = range2(0, ndim); const axis = this.axis >= 0 ? this.axis : this.axis + ndim; @@ -28325,25 +30492,25 @@ var BatchNormalization = class extends Layer { const broadcastMovingVariance = reshape(this.movingVariance.read(), broadcastShape); const broadcastBeta = this.center ? reshape(this.beta.read(), broadcastShape) : null; const broadcastGamma = this.scale ? reshape(this.gamma.read(), broadcastShape) : null; - return batchNormalization(input2, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); + return batchNormalization(input22, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); } else { - return batchNormalization(input2, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); + return batchNormalization(input22, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); } }; if (!training) { return normalizeInference(); } - const [normedTraining, mean4, variance] = normalizeBatchInTraining(input2, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); - const doMovingAverage = (variable2, value, momentum) => { + const [normedTraining, mean42, variance] = normalizeBatchInTraining(input22, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); + const doMovingAverage = (variable22, value, momentum) => { tidy(() => { const decay = 1 - momentum; - const origValue = variable2.read(); + const origValue = variable22.read(); const updateDelta = mul(sub(origValue, value), decay); - variable2.write(sub(origValue, updateDelta)); + variable22.write(sub(origValue, updateDelta)); }); }; const updateMovingMeanAndVariance = () => { - doMovingAverage(this.movingMean, mean4, this.momentum); + doMovingAverage(this.movingMean, mean42, this.momentum); doMovingAverage(this.movingVariance, variance, this.momentum); }; updateMovingMeanAndVariance(); @@ -28436,12 +30603,12 @@ var LayerNormalization = class extends Layer { this.built = true; } call(inputs, kwargs) { - const input2 = getExactlyOneTensor(inputs); - const inputShape = input2.shape; + const input22 = getExactlyOneTensor(inputs); + const inputShape = input22.shape; const nDims = inputShape.length; return tidy(() => { const keepDims = true; - let { mean: mean4, variance } = moments(input2, this.axis, keepDims); + let { mean: mean42, variance } = moments(input22, this.axis, keepDims); const broadcastShape = pyListRepeat(1, nDims); for (const dim of this.axis) { broadcastShape[dim] = inputShape[dim]; @@ -28466,11 +30633,11 @@ var LayerNormalization = class extends Layer { scaleOffsetTiling.push(inputShape[i]); } } - mean4 = tile(mean4, momentsTiling); + mean42 = tile(mean42, momentsTiling); variance = tile(variance, momentsTiling); scale22 = tile(scale22, scaleOffsetTiling); offset = tile(offset, scaleOffsetTiling); - return batchNormalization(input2, mean4, variance, offset, scale22, this.epsilon); + return batchNormalization(input22, mean42, variance, offset, scale22, this.epsilon); }); } getConfig() { @@ -28491,15 +30658,15 @@ var LayerNormalization = class extends Layer { }; LayerNormalization.className = "LayerNormalization"; serialization_exports.registerClass(LayerNormalization); -function spatial2dPadding(x, padding, dataFormat) { +function spatial2dPadding(x, padding2, dataFormat) { return tidy(() => { if (x.rank !== 4) { throw new ValueError(`temporalPadding expects input tensor to be 4-D, but received a ${x.rank}-D tensor.`); } - if (padding == null) { - padding = [[1, 1], [1, 1]]; + if (padding2 == null) { + padding2 = [[1, 1], [1, 1]]; } - if (padding.length !== 2 || padding[0].length !== 2 || padding[1].length !== 2) { + if (padding2.length !== 2 || padding2[0].length !== 2 || padding2[1].length !== 2) { throw new ValueError("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers."); } if (dataFormat == null) { @@ -28510,9 +30677,9 @@ function spatial2dPadding(x, padding, dataFormat) { } let pattern; if (dataFormat === "channelsFirst") { - pattern = [[0, 0], [0, 0], padding[0], padding[1]]; + pattern = [[0, 0], [0, 0], padding2[0], padding2[1]]; } else { - pattern = [[0, 0], padding[0], padding[1], [0, 0]]; + pattern = [[0, 0], padding2[0], padding2[1], [0, 0]]; } return pad(x, pattern); }); @@ -28598,16 +30765,16 @@ var ZeroPadding2D = class extends Layer { }; ZeroPadding2D.className = "ZeroPadding2D"; serialization_exports.registerClass(ZeroPadding2D); -function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { +function pool2d(x, poolSize, strides, padding2, dataFormat, poolMode) { return tidy(() => { checkDataFormat(dataFormat); checkPoolMode(poolMode); - checkPaddingMode(padding); + checkPaddingMode(padding2); if (strides == null) { strides = [1, 1]; } - if (padding == null) { - padding = "valid"; + if (padding2 == null) { + padding2 = "valid"; } if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -28617,7 +30784,7 @@ function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { } x = preprocessConv2DInput(x, dataFormat); let y; - const paddingString = padding === "same" ? "same" : "valid"; + const paddingString = padding2 === "same" ? "same" : "valid"; if (poolMode === "max") { y = maxPool(x, poolSize, strides, paddingString); } else { @@ -28629,16 +30796,16 @@ function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { return y; }); } -function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { +function pool3d(x, poolSize, strides, padding2, dataFormat, poolMode) { return tidy(() => { checkDataFormat(dataFormat); checkPoolMode(poolMode); - checkPaddingMode(padding); + checkPaddingMode(padding2); if (strides == null) { strides = [1, 1, 1]; } - if (padding == null) { - padding = "valid"; + if (padding2 == null) { + padding2 = "valid"; } if (dataFormat == null) { dataFormat = imageDataFormat(); @@ -28648,7 +30815,7 @@ function pool3d(x, poolSize, strides, padding, dataFormat, poolMode) { } x = preprocessConv3DInput(x, dataFormat); let y; - const paddingString = padding === "same" ? "same" : "valid"; + const paddingString = padding2 === "same" ? "same" : "valid"; if (poolMode === "max") { y = maxPool3d(x, poolSize, strides, paddingString); } else { @@ -28718,10 +30885,10 @@ var MaxPooling1D = class extends Pooling1D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, "max"); + checkPaddingMode(padding2); + return pool2d(inputs, poolSize, strides, padding2, dataFormat, "max"); } }; MaxPooling1D.className = "MaxPooling1D"; @@ -28730,10 +30897,10 @@ var AveragePooling1D = class extends Pooling1D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, "avg"); + checkPaddingMode(padding2); + return pool2d(inputs, poolSize, strides, padding2, dataFormat, "avg"); } }; AveragePooling1D.className = "AveragePooling1D"; @@ -28797,10 +30964,10 @@ var MaxPooling2D = class extends Pooling2D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, "max"); + checkPaddingMode(padding2); + return pool2d(inputs, poolSize, strides, padding2, dataFormat, "max"); } }; MaxPooling2D.className = "MaxPooling2D"; @@ -28809,10 +30976,10 @@ var AveragePooling2D = class extends Pooling2D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool2d(inputs, poolSize, strides, padding, dataFormat, "avg"); + checkPaddingMode(padding2); + return pool2d(inputs, poolSize, strides, padding2, dataFormat, "avg"); } }; AveragePooling2D.className = "AveragePooling2D"; @@ -28878,10 +31045,10 @@ var MaxPooling3D = class extends Pooling3D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, "max"); + checkPaddingMode(padding2); + return pool3d(inputs, poolSize, strides, padding2, dataFormat, "max"); } }; MaxPooling3D.className = "MaxPooling3D"; @@ -28890,10 +31057,10 @@ var AveragePooling3D = class extends Pooling3D { constructor(args) { super(args); } - poolingFunction(inputs, poolSize, strides, padding, dataFormat) { + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { checkDataFormat(dataFormat); - checkPaddingMode(padding); - return pool3d(inputs, poolSize, strides, padding, dataFormat, "avg"); + checkPaddingMode(padding2); + return pool3d(inputs, poolSize, strides, padding2, dataFormat, "avg"); } }; AveragePooling3D.className = "AveragePooling3D"; @@ -28916,8 +31083,8 @@ var GlobalAveragePooling1D = class extends GlobalPooling1D { } call(inputs, kwargs) { return tidy(() => { - const input2 = getExactlyOneTensor(inputs); - return mean(input2, 1); + const input22 = getExactlyOneTensor(inputs); + return mean(input22, 1); }); } }; @@ -28929,8 +31096,8 @@ var GlobalMaxPooling1D = class extends GlobalPooling1D { } call(inputs, kwargs) { return tidy(() => { - const input2 = getExactlyOneTensor(inputs); - return max(input2, 1); + const input22 = getExactlyOneTensor(inputs); + return max(input22, 1); }); } }; @@ -28964,11 +31131,11 @@ var GlobalPooling2D = class extends Layer { var GlobalAveragePooling2D = class extends GlobalPooling2D { call(inputs, kwargs) { return tidy(() => { - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); if (this.dataFormat === "channelsLast") { - return mean(input2, [1, 2]); + return mean(input22, [1, 2]); } else { - return mean(input2, [2, 3]); + return mean(input22, [2, 3]); } }); } @@ -28978,11 +31145,11 @@ serialization_exports.registerClass(GlobalAveragePooling2D); var GlobalMaxPooling2D = class extends GlobalPooling2D { call(inputs, kwargs) { return tidy(() => { - const input2 = getExactlyOneTensor(inputs); + const input22 = getExactlyOneTensor(inputs); if (this.dataFormat === "channelsLast") { - return max(input2, [1, 2]); + return max(input22, [1, 2]); } else { - return max(input2, [2, 3]); + return max(input22, [2, 3]); } }); } @@ -29081,11 +31248,11 @@ var TimeDistributed = class extends Wrapper { call(inputs, kwargs) { return tidy(() => { inputs = getExactlyOneTensor(inputs); - const step5 = (inputs2, states) => { + const step52 = (inputs2, states) => { const output = getExactlyOneTensor(this.layer.call(inputs2, kwargs)); return [output, []]; }; - const rnnOutputs = rnn(step5, inputs, [], false, null, null, false, true); + const rnnOutputs = rnn(step52, inputs, [], false, null, null, false, true); const y = rnnOutputs[1]; return y; }); @@ -29213,8 +31380,8 @@ var Bidirectional = class extends Wrapper { throw new NotImplementedError("Support for constants in Bidirectional layers is not implemented yet."); } const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; - for (const tensor2 of additionalInputs) { - if (tensor2 instanceof SymbolicTensor !== isSymbolicTensor) { + for (const tensor22 of additionalInputs) { + if (tensor22 instanceof SymbolicTensor !== isSymbolicTensor) { throw new ValueError("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors"); } } @@ -29742,45 +31909,45 @@ function earlyStopping(args) { } var callbacks = { earlyStopping }; var DataType; -(function(DataType2) { - DataType2[DataType2["DT_INVALID"] = 0] = "DT_INVALID"; - DataType2[DataType2["DT_FLOAT"] = 1] = "DT_FLOAT"; - DataType2[DataType2["DT_DOUBLE"] = 2] = "DT_DOUBLE"; - DataType2[DataType2["DT_INT32"] = 3] = "DT_INT32"; - DataType2[DataType2["DT_UINT8"] = 4] = "DT_UINT8"; - DataType2[DataType2["DT_INT16"] = 5] = "DT_INT16"; - DataType2[DataType2["DT_INT8"] = 6] = "DT_INT8"; - DataType2[DataType2["DT_STRING"] = 7] = "DT_STRING"; - DataType2[DataType2["DT_COMPLEX64"] = 8] = "DT_COMPLEX64"; - DataType2[DataType2["DT_INT64"] = 9] = "DT_INT64"; - DataType2[DataType2["DT_BOOL"] = 10] = "DT_BOOL"; - DataType2[DataType2["DT_QINT8"] = 11] = "DT_QINT8"; - DataType2[DataType2["DT_QUINT8"] = 12] = "DT_QUINT8"; - DataType2[DataType2["DT_QINT32"] = 13] = "DT_QINT32"; - DataType2[DataType2["DT_BFLOAT16"] = 14] = "DT_BFLOAT16"; - DataType2[DataType2["DT_FLOAT_REF"] = 101] = "DT_FLOAT_REF"; - DataType2[DataType2["DT_DOUBLE_REF"] = 102] = "DT_DOUBLE_REF"; - DataType2[DataType2["DT_INT32_REF"] = 103] = "DT_INT32_REF"; - DataType2[DataType2["DT_UINT8_REF"] = 104] = "DT_UINT8_REF"; - DataType2[DataType2["DT_INT16_REF"] = 105] = "DT_INT16_REF"; - DataType2[DataType2["DT_INT8_REF"] = 106] = "DT_INT8_REF"; - DataType2[DataType2["DT_STRING_REF"] = 107] = "DT_STRING_REF"; - DataType2[DataType2["DT_COMPLEX64_REF"] = 108] = "DT_COMPLEX64_REF"; - DataType2[DataType2["DT_INT64_REF"] = 109] = "DT_INT64_REF"; - DataType2[DataType2["DT_BOOL_REF"] = 110] = "DT_BOOL_REF"; - DataType2[DataType2["DT_QINT8_REF"] = 111] = "DT_QINT8_REF"; - DataType2[DataType2["DT_QUINT8_REF"] = 112] = "DT_QUINT8_REF"; - DataType2[DataType2["DT_QINT32_REF"] = 113] = "DT_QINT32_REF"; - DataType2[DataType2["DT_BFLOAT16_REF"] = 114] = "DT_BFLOAT16_REF"; +(function(DataType22) { + DataType22[DataType22["DT_INVALID"] = 0] = "DT_INVALID"; + DataType22[DataType22["DT_FLOAT"] = 1] = "DT_FLOAT"; + DataType22[DataType22["DT_DOUBLE"] = 2] = "DT_DOUBLE"; + DataType22[DataType22["DT_INT32"] = 3] = "DT_INT32"; + DataType22[DataType22["DT_UINT8"] = 4] = "DT_UINT8"; + DataType22[DataType22["DT_INT16"] = 5] = "DT_INT16"; + DataType22[DataType22["DT_INT8"] = 6] = "DT_INT8"; + DataType22[DataType22["DT_STRING"] = 7] = "DT_STRING"; + DataType22[DataType22["DT_COMPLEX64"] = 8] = "DT_COMPLEX64"; + DataType22[DataType22["DT_INT64"] = 9] = "DT_INT64"; + DataType22[DataType22["DT_BOOL"] = 10] = "DT_BOOL"; + DataType22[DataType22["DT_QINT8"] = 11] = "DT_QINT8"; + DataType22[DataType22["DT_QUINT8"] = 12] = "DT_QUINT8"; + DataType22[DataType22["DT_QINT32"] = 13] = "DT_QINT32"; + DataType22[DataType22["DT_BFLOAT16"] = 14] = "DT_BFLOAT16"; + DataType22[DataType22["DT_FLOAT_REF"] = 101] = "DT_FLOAT_REF"; + DataType22[DataType22["DT_DOUBLE_REF"] = 102] = "DT_DOUBLE_REF"; + DataType22[DataType22["DT_INT32_REF"] = 103] = "DT_INT32_REF"; + DataType22[DataType22["DT_UINT8_REF"] = 104] = "DT_UINT8_REF"; + DataType22[DataType22["DT_INT16_REF"] = 105] = "DT_INT16_REF"; + DataType22[DataType22["DT_INT8_REF"] = 106] = "DT_INT8_REF"; + DataType22[DataType22["DT_STRING_REF"] = 107] = "DT_STRING_REF"; + DataType22[DataType22["DT_COMPLEX64_REF"] = 108] = "DT_COMPLEX64_REF"; + DataType22[DataType22["DT_INT64_REF"] = 109] = "DT_INT64_REF"; + DataType22[DataType22["DT_BOOL_REF"] = 110] = "DT_BOOL_REF"; + DataType22[DataType22["DT_QINT8_REF"] = 111] = "DT_QINT8_REF"; + DataType22[DataType22["DT_QUINT8_REF"] = 112] = "DT_QUINT8_REF"; + DataType22[DataType22["DT_QINT32_REF"] = 113] = "DT_QINT32_REF"; + DataType22[DataType22["DT_BFLOAT16_REF"] = 114] = "DT_BFLOAT16_REF"; })(DataType || (DataType = {})); var SaverDef; -(function(SaverDef2) { +(function(SaverDef22) { let CheckpointFormatVersion; (function(CheckpointFormatVersion2) { CheckpointFormatVersion2[CheckpointFormatVersion2["LEGACY"] = 0] = "LEGACY"; CheckpointFormatVersion2[CheckpointFormatVersion2["V1"] = 1] = "V1"; CheckpointFormatVersion2[CheckpointFormatVersion2["V2"] = 2] = "V2"; - })(CheckpointFormatVersion = SaverDef2.CheckpointFormatVersion || (SaverDef2.CheckpointFormatVersion = {})); + })(CheckpointFormatVersion = SaverDef22.CheckpointFormatVersion || (SaverDef22.CheckpointFormatVersion = {})); })(SaverDef || (SaverDef = {})); var CUSTOM_OPS = {}; function registerOp(name, opFunc) { @@ -29811,9 +31978,9 @@ function getParamValue(paramName, node2, tensorMap, context, resourceManager) { const inputs = node2.inputNames.slice(start, end); return inputs.map((name) => getTensor(name, tensorMap, context, resourceManager)); } - const tensor2 = getTensor(node2.inputNames.slice(start)[0], tensorMap, context, resourceManager); - const data = tensor2.dataSync(); - return inputParam.type === "number" ? data[0] : util_exports.toNestedArray(tensor2.shape, data); + const tensor22 = getTensor(node2.inputNames.slice(start)[0], tensorMap, context, resourceManager); + const data = tensor22.dataSync(); + return inputParam.type === "number" ? data[0] : util_exports.toNestedArray(tensor22.shape, data); } const attrParam = node2.attrParams[paramName]; return attrParam && attrParam.value; @@ -29821,9 +31988,9 @@ function getParamValue(paramName, node2, tensorMap, context, resourceManager) { function getTensor(name, tensorsMap, context, resourceManager) { const [nodeName, index] = parseNodeName(name); if (resourceManager != null) { - const tensor2 = resourceManager.getHashTableHandleByName(nodeName); - if (tensor2 != null) { - return tensor2; + const tensor22 = resourceManager.getHashTableHandleByName(nodeName); + if (tensor22 != null) { + return tensor22; } } const contextId = context.currentContextIds.find((contextId2) => { @@ -29856,20 +32023,20 @@ function parseNodeName(name) { return [nodeName, index, outputName]; } function getPadding(node2, tensorMap, context) { - let pad3 = getParamValue("pad", node2, tensorMap, context); - if (pad3 === "explicit") { - pad3 = getParamValue("explicitPaddings", node2, tensorMap, context); + let pad32 = getParamValue("pad", node2, tensorMap, context); + if (pad32 === "explicit") { + pad32 = getParamValue("explicitPaddings", node2, tensorMap, context); const explicitPadding = [[0, 0], [0, 0], [0, 0], [0, 0]]; for (let i = 0; i < 4; i++) { - explicitPadding[i][0] = pad3[i * 2]; - explicitPadding[i][1] = pad3[i * 2 + 1]; + explicitPadding[i][0] = pad32[i * 2]; + explicitPadding[i][1] = pad32[i * 2 + 1]; } return explicitPadding; } - return pad3; + return pad32; } -function cloneTensor(tensor2) { - return tensor2.kept ? tensor2 : clone(tensor2); +function cloneTensor(tensor22) { + return tensor22.kept ? tensor22 : clone(tensor22); } var arithmetic_exports = {}; __export2(arithmetic_exports, { @@ -32822,7 +34989,7 @@ var OperationMapper = class { string_exports, transformation_exports ]; - const mappersJson = [].concat(...ops.map((op2) => op2.json)); + const mappersJson = [].concat(...ops.map((op22) => op22.json)); this.opMappers = mappersJson.reduce((map, mapper) => { map[mapper.tfOpName] = mapper; return map; @@ -32900,8 +35067,8 @@ var OperationMapper = class { } let functions = {}; if (graph2.library != null && graph2.library.function != null) { - functions = graph2.library.function.reduce((functions2, func2) => { - functions2[func2.signature.name] = this.mapFunction(func2); + functions = graph2.library.function.reduce((functions2, func22) => { + functions2[func22.signature.name] = this.mapFunction(func22); return functions2; }, {}); } @@ -32926,7 +35093,7 @@ var OperationMapper = class { name: node2.name, op: node2.op, category: mapper.category, - inputNames: (node2.input || []).map((input2) => input2.startsWith("^") ? input2.substr(1) : input2), + inputNames: (node2.input || []).map((input22) => input22.startsWith("^") ? input22.substr(1) : input22), inputs: [], children: [], inputParams: {}, @@ -33101,10 +35268,10 @@ var OperationMapper = class { }, {}) }; } - mapArgToTensorInfo(arg, nameMap2) { + mapArgToTensorInfo(arg, nameMap22) { let name = arg.name; - if (nameMap2 != null) { - name = nameMap2[name]; + if (nameMap22 != null) { + name = nameMap22[name]; } return { name, dtype: arg.type }; } @@ -33457,8 +35624,8 @@ function inferElementShape(listElementShape, tensors, elementShape) { throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${partialShape}`); } if (notfullDefinedShape) { - tensors.forEach((tensor2) => { - partialShape = mergeElementShape(tensor2.shape, partialShape); + tensors.forEach((tensor22) => { + partialShape = mergeElementShape(tensor22.shape, partialShape); }); } if (!fullDefinedShape(partialShape)) { @@ -33508,9 +35675,9 @@ var TensorArray = class { return this.closed_; } clearAndClose(keepIds) { - this.tensors.forEach((tensor2) => { - if (keepIds == null || !keepIds.has(tensor2.tensor.id)) { - tensor2.tensor.dispose(); + this.tensors.forEach((tensor22) => { + if (keepIds == null || !keepIds.has(tensor22.tensor.id)) { + tensor22.tensor.dispose(); } }); this.tensors = []; @@ -33540,7 +35707,7 @@ var TensorArray = class { readMany(indices) { return indices.map((index) => this.read(index)); } - write(index, tensor2) { + write(index, tensor22) { if (this.closed_) { throw new Error(`TensorArray ${this.name} has already been closed.`); } @@ -33548,22 +35715,22 @@ var TensorArray = class { throw new Error(`Tried to write to index ${index}, but array is not resizeable and size is: ${this.maxSize}`); } const t = this.tensors[index] || {}; - if (tensor2.dtype !== this.dtype) { + if (tensor22.dtype !== this.dtype) { throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, - because the value dtype is ${tensor2.dtype}, but TensorArray dtype is ${this.dtype}.`); + because the value dtype is ${tensor22.dtype}, but TensorArray dtype is ${this.dtype}.`); } if (this.size() === 0 && (this.elementShape == null || this.elementShape.length === 0)) { - this.elementShape = tensor2.shape; + this.elementShape = tensor22.shape; } - assertShapesMatchAllowUndefinedSize(this.elementShape, tensor2.shape, `TensorArray ${this.name}: Could not write to TensorArray index ${index}.`); + assertShapesMatchAllowUndefinedSize(this.elementShape, tensor22.shape, `TensorArray ${this.name}: Could not write to TensorArray index ${index}.`); if (t.read) { throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, because it has already been read.`); } if (t.written) { throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, because it has already been written.`); } - t.tensor = tensor2; - keep(tensor2); + t.tensor = tensor22; + keep(tensor22); t.written = true; this.tensors[index] = t; } @@ -33607,45 +35774,45 @@ var TensorArray = class { assertShapesMatchAllowUndefinedSize(this.elementShape, tensors[0].shape, `TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${tensors[0].shape})`); return concat(tensors, 0); } - scatter(indices, tensor2) { - if (tensor2.dtype !== this.dtype) { - throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor2.dtype}`); + scatter(indices, tensor22) { + if (tensor22.dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor22.dtype}`); } - if (indices.length !== tensor2.shape[0]) { - throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor2.shape[0]}`); + if (indices.length !== tensor22.shape[0]) { + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor22.shape[0]}`); } const maxIndex = Math.max(...indices); if (!this.dynamicSize && maxIndex >= this.maxSize) { throw new Error(`Max index must be < array size (${maxIndex} vs. ${this.maxSize})`); } - this.writeMany(indices, unstack(tensor2, 0)); + this.writeMany(indices, unstack(tensor22, 0)); } - split(length, tensor2) { - if (tensor2.dtype !== this.dtype) { - throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor2.dtype}`); + split(length, tensor22) { + if (tensor22.dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor22.dtype}`); } let totalLength = 0; const cumulativeLengths = length.map((len) => { totalLength += len; return totalLength; }); - if (totalLength !== tensor2.shape[0]) { + if (totalLength !== tensor22.shape[0]) { throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${totalLength}, and tensor's shape is: ${tensor2.shape}`); + ${totalLength}, and tensor's shape is: ${tensor22.shape}`); } if (!this.dynamicSize && length.length !== this.maxSize) { throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${length.length}), and the TensorArray is not marked as dynamically resizeable`); } - const elementPerRow = totalLength === 0 ? 0 : tensor2.size / totalLength; + const elementPerRow = totalLength === 0 ? 0 : tensor22.size / totalLength; const tensors = []; tidy(() => { - tensor2 = reshape(tensor2, [1, totalLength, elementPerRow]); + tensor22 = reshape(tensor22, [1, totalLength, elementPerRow]); for (let i = 0; i < length.length; ++i) { const previousLength = i === 0 ? 0 : cumulativeLengths[i - 1]; const indices2 = [0, previousLength, 0]; const sizes = [1, length[i], elementPerRow]; - tensors[i] = reshape(slice(tensor2, indices2, sizes), this.elementShape); + tensors[i] = reshape(slice(tensor22, indices2, sizes), this.elementShape); } return tensors; }); @@ -33662,12 +35829,12 @@ var TensorList = class { this.elementShape = elementShape; this.elementDtype = elementDtype; if (tensors != null) { - tensors.forEach((tensor2) => { - if (elementDtype !== tensor2.dtype) { - throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${tensor2.dtype}`); + tensors.forEach((tensor22) => { + if (elementDtype !== tensor22.dtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${tensor22.dtype}`); } - assertShapesMatchAllowUndefinedSize(elementShape, tensor2.shape, "TensorList shape mismatch: "); - keep(tensor2); + assertShapesMatchAllowUndefinedSize(elementShape, tensor22.shape, "TensorList shape mismatch: "); + keep(tensor22); }); } this.idTensor = scalar(0); @@ -33681,9 +35848,9 @@ var TensorList = class { return new TensorList([...this.tensors], this.elementShape, this.elementDtype); } clearAndClose(keepIds) { - this.tensors.forEach((tensor2) => { - if (keepIds == null || !keepIds.has(tensor2.id)) { - tensor2.dispose(); + this.tensors.forEach((tensor22) => { + if (keepIds == null || !keepIds.has(tensor22.id)) { + tensor22.dispose(); } }); this.tensors.length = 0; @@ -33702,7 +35869,7 @@ var TensorList = class { assertShapesMatchAllowUndefinedSize(elementShape, this.elementShape, "TensorList shape mismatch: "); const outputElementShape = inferElementShape(this.elementShape, this.tensors, elementShape); return tidy(() => { - const reshapedTensors = this.tensors.map((tensor2) => reshape(tensor2, outputElementShape)); + const reshapedTensors = this.tensors.map((tensor22) => reshape(tensor22, outputElementShape)); return stack(reshapedTensors, 0); }); } @@ -33714,20 +35881,20 @@ var TensorList = class { throw new Error("Trying to pop from an empty list."); } const outputElementShape = inferElementShape(this.elementShape, this.tensors, elementShape); - const tensor2 = this.tensors.pop(); - assertShapesMatchAllowUndefinedSize(tensor2.shape, elementShape, "TensorList shape mismatch: "); - return reshape(tensor2, outputElementShape); + const tensor22 = this.tensors.pop(); + assertShapesMatchAllowUndefinedSize(tensor22.shape, elementShape, "TensorList shape mismatch: "); + return reshape(tensor22, outputElementShape); } - pushBack(tensor2) { - if (tensor2.dtype !== this.elementDtype) { - throw new Error(`Invalid data types; op elements ${tensor2.dtype}, but list elements ${this.elementDtype}`); + pushBack(tensor22) { + if (tensor22.dtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor22.dtype}, but list elements ${this.elementDtype}`); } - assertShapesMatchAllowUndefinedSize(tensor2.shape, this.elementShape, "TensorList shape mismatch: "); + assertShapesMatchAllowUndefinedSize(tensor22.shape, this.elementShape, "TensorList shape mismatch: "); if (this.maxNumElements === this.size()) { throw new Error(`Trying to push element into a full list.`); } - keep(tensor2); - this.tensors.push(tensor2); + keep(tensor22); + this.tensors.push(tensor22); } resize(size2) { if (size2 < 0) { @@ -33752,16 +35919,16 @@ var TensorList = class { const outputElementShape = inferElementShape(this.elementShape, this.tensors, elementShape); return reshape(this.tensors[elementIndex], outputElementShape); } - setItem(elementIndex, tensor2) { - if (tensor2.dtype !== this.elementDtype) { - throw new Error(`Invalid data types; op elements ${tensor2.dtype}, but list elements ${this.elementDtype}`); + setItem(elementIndex, tensor22) { + if (tensor22.dtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor22.dtype}, but list elements ${this.elementDtype}`); } if (elementIndex < 0 || this.maxNumElements !== -1 && elementIndex >= this.maxNumElements) { throw new Error(`Trying to set element ${elementIndex} in a list with max ${this.maxNumElements} elements.`); } - assertShapesMatchAllowUndefinedSize(this.elementShape, tensor2.shape, "TensorList shape mismatch: "); - keep(tensor2); - this.tensors[elementIndex] = tensor2; + assertShapesMatchAllowUndefinedSize(this.elementShape, tensor22.shape, "TensorList shape mismatch: "); + keep(tensor22); + this.tensors[elementIndex] = tensor22; } gather(indices, elementDtype, elementShape) { if (elementDtype !== this.elementDtype) { @@ -33793,64 +35960,64 @@ var TensorList = class { }); } }; -function fromTensor(tensor2, elementShape, elementDtype) { - const dtype = tensor2.dtype; - if (tensor2.shape.length < 1) { - throw new Error(`Tensor must be at least a vector, but saw shape: ${tensor2.shape}`); +function fromTensor(tensor22, elementShape, elementDtype) { + const dtype = tensor22.dtype; + if (tensor22.shape.length < 1) { + throw new Error(`Tensor must be at least a vector, but saw shape: ${tensor22.shape}`); } - if (tensor2.dtype !== elementDtype) { - throw new Error(`Invalid data types; op elements ${tensor2.dtype}, but list elements ${elementDtype}`); + if (tensor22.dtype !== elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor22.dtype}, but list elements ${elementDtype}`); } - const tensorElementShape = tensor2.shape.slice(1); + const tensorElementShape = tensor22.shape.slice(1); assertShapesMatchAllowUndefinedSize(tensorElementShape, elementShape, "TensorList shape mismatch: "); - const tensorList = unstack(tensor2); + const tensorList = unstack(tensor22); return new TensorList(tensorList, elementShape, dtype); } function reserve(elementShape, elementDtype, numElements) { return new TensorList([], elementShape, elementDtype, numElements); } -function scatter(tensor2, indices, elementShape, numElements) { - if (indices.length !== tensor2.shape[0]) { - throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor2.shape[0]}`); +function scatter(tensor22, indices, elementShape, numElements) { + if (indices.length !== tensor22.shape[0]) { + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor22.shape[0]}`); } const maxIndex = Math.max(...indices); if (numElements != null && numElements !== -1 && maxIndex >= numElements) { throw new Error(`Max index must be < array size (${maxIndex} vs. ${numElements})`); } - const list = new TensorList([], elementShape, tensor2.dtype, numElements); - const tensors = unstack(tensor2, 0); + const list = new TensorList([], elementShape, tensor22.dtype, numElements); + const tensors = unstack(tensor22, 0); indices.forEach((value, index) => { list.setItem(value, tensors[index]); }); return list; } -function split2(tensor2, length, elementShape) { +function split2(tensor22, length, elementShape) { let totalLength = 0; const cumulativeLengths = length.map((len) => { totalLength += len; return totalLength; }); - if (totalLength !== tensor2.shape[0]) { + if (totalLength !== tensor22.shape[0]) { throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${totalLength}, and tensor's shape is: ${tensor2.shape}`); + ${totalLength}, and tensor's shape is: ${tensor22.shape}`); } - const shapeWithoutFirstDim = tensor2.shape.slice(1); + const shapeWithoutFirstDim = tensor22.shape.slice(1); const outputElementShape = mergeElementShape(shapeWithoutFirstDim, elementShape); - const elementPerRow = totalLength === 0 ? 0 : tensor2.size / totalLength; + const elementPerRow = totalLength === 0 ? 0 : tensor22.size / totalLength; const tensors = tidy(() => { const tensors2 = []; - tensor2 = reshape(tensor2, [1, totalLength, elementPerRow]); + tensor22 = reshape(tensor22, [1, totalLength, elementPerRow]); for (let i = 0; i < length.length; ++i) { const previousLength = i === 0 ? 0 : cumulativeLengths[i - 1]; const indices = [0, previousLength, 0]; const sizes = [1, length[i], elementPerRow]; - tensors2[i] = reshape(slice(tensor2, indices, sizes), outputElementShape); + tensors2[i] = reshape(slice(tensor22, indices, sizes), outputElementShape); } - tensor2.dispose(); + tensor22.dispose(); return tensors2; }); - const list = new TensorList([], elementShape, tensor2.dtype, length.length); + const list = new TensorList([], elementShape, tensor22.dtype, length.length); for (let i = 0; i < tensors.length; i++) { list.setItem(i, tensors[i]); } @@ -33877,28 +36044,28 @@ var executeOp3 = async (node2, tensorMap, context) => { const condFunc = getParamValue("cond", node2, tensorMap, context); const args = getParamValue("args", node2, tensorMap, context); const condResult = await context.functionMap[condFunc].executeFunctionAsync(args, context.tensorArrayMap, context.tensorListMap); - const argIds = args.map((tensor2) => tensor2.id); + const argIds = args.map((tensor22) => tensor22.id); let condValue = await condResult[0].data(); - condResult.forEach((tensor2) => { - if (!tensor2.kept && argIds.indexOf(tensor2.id) === -1) { - tensor2.dispose(); + condResult.forEach((tensor22) => { + if (!tensor22.kept && argIds.indexOf(tensor22.id) === -1) { + tensor22.dispose(); } }); let result = args; while (condValue[0]) { const origResult = result; result = await context.functionMap[bodyFunc].executeFunctionAsync(result, context.tensorArrayMap, context.tensorListMap); - const resultIds = result.map((tensor2) => tensor2.id); - origResult.forEach((tensor2) => { - if (!tensor2.kept && argIds.indexOf(tensor2.id) === -1 && resultIds.indexOf(tensor2.id) === -1) { - tensor2.dispose(); + const resultIds = result.map((tensor22) => tensor22.id); + origResult.forEach((tensor22) => { + if (!tensor22.kept && argIds.indexOf(tensor22.id) === -1 && resultIds.indexOf(tensor22.id) === -1) { + tensor22.dispose(); } }); const condResult2 = await context.functionMap[condFunc].executeFunctionAsync(result, context.tensorArrayMap, context.tensorListMap); condValue = await condResult2[0].data(); - condResult2.forEach((tensor2) => { - if (!tensor2.kept && argIds.indexOf(tensor2.id) === -1 && resultIds.indexOf(tensor2.id) === -1) { - tensor2.dispose(); + condResult2.forEach((tensor22) => { + if (!tensor22.kept && argIds.indexOf(tensor22.id) === -1 && resultIds.indexOf(tensor22.id) === -1) { + tensor22.dispose(); } }); } @@ -34064,10 +36231,10 @@ var executeOp3 = async (node2, tensorMap, context) => { return [tensorList.stack(elementShape, elementDtype, numElements)]; } case "TensorListFromTensor": { - const tensor2 = getParamValue("tensor", node2, tensorMap, context); + const tensor22 = getParamValue("tensor", node2, tensorMap, context); const elementShape = getParamValue("elementShape", node2, tensorMap, context); const elementDtype = getParamValue("elementDType", node2, tensorMap, context); - const tensorList = fromTensor(tensor2, elementShape, elementDtype); + const tensorList = fromTensor(tensor22, elementShape, elementDtype); context.addTensorList(tensorList); return [tensorList.idTensor]; } @@ -34123,7 +36290,7 @@ function fusedConvAndDepthWiseParams(node2, tensorMap, context) { throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported"); } const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getPadding(node2, tensorMap, context); + const pad32 = getPadding(node2, tensorMap, context); const dataFormat = getParamValue("dataFormat", node2, tensorMap, context).toUpperCase(); const dilations = getParamValue("dilations", node2, tensorMap, context); let [biasArg, preluArg] = getParamValue("args", node2, tensorMap, context); @@ -34134,7 +36301,7 @@ function fusedConvAndDepthWiseParams(node2, tensorMap, context) { const leakyreluAlpha = getParamValue("leakyreluAlpha", node2, tensorMap, context); return { stride, - pad: pad3, + pad: pad32, dataFormat, dilations, biasArg, @@ -34147,25 +36314,25 @@ var executeOp4 = (node2, tensorMap, context) => { switch (node2.op) { case "Conv1D": { const stride = getParamValue("stride", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const dataFormat = getParamValue("dataFormat", node2, tensorMap, context).toUpperCase(); const dilation = getParamValue("dilation", node2, tensorMap, context); - return [conv1d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), stride, pad3, dataFormat, dilation)]; + return [conv1d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), stride, pad32, dataFormat, dilation)]; } case "Conv2D": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getPadding(node2, tensorMap, context); + const pad32 = getPadding(node2, tensorMap, context); const dataFormat = getParamValue("dataFormat", node2, tensorMap, context).toUpperCase(); const dilations = getParamValue("dilations", node2, tensorMap, context); - return [conv2d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2]], pad3, dataFormat, [dilations[1], dilations[2]])]; + return [conv2d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2]], pad32, dataFormat, [dilations[1], dilations[2]])]; } case "_FusedConv2D": { - const { stride, pad: pad3, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams(node2, tensorMap, context); + const { stride, pad: pad32, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams(node2, tensorMap, context); return [fused_ops_exports.conv2d({ x: getParamValue("x", node2, tensorMap, context), filter: getParamValue("filter", node2, tensorMap, context), strides: [stride[1], stride[2]], - pad: pad3, + pad: pad32, dataFormat, dilations: [dilations[1], dilations[2]], bias: biasArg, @@ -34175,12 +36342,12 @@ var executeOp4 = (node2, tensorMap, context) => { })]; } case "FusedDepthwiseConv2dNative": { - const { stride, pad: pad3, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams(node2, tensorMap, context); + const { stride, pad: pad32, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams(node2, tensorMap, context); return [fused_ops_exports.depthwiseConv2d({ x: getParamValue("x", node2, tensorMap, context), filter: getParamValue("filter", node2, tensorMap, context), strides: [stride[1], stride[2]], - pad: pad3, + pad: pad32, dataFormat, dilations: [dilations[1], dilations[2]], bias: biasArg, @@ -34193,65 +36360,65 @@ var executeOp4 = (node2, tensorMap, context) => { case "Conv2dTranspose": { const shape = getParamValue("outputShape", node2, tensorMap, context); const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getPadding(node2, tensorMap, context); - return [conv2dTranspose(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), shape, [stride[1], stride[2]], pad3)]; + const pad32 = getPadding(node2, tensorMap, context); + return [conv2dTranspose(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), shape, [stride[1], stride[2]], pad32)]; } case "DepthwiseConv2dNative": case "DepthwiseConv2d": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getPadding(node2, tensorMap, context); + const pad32 = getPadding(node2, tensorMap, context); const dilations = getParamValue("dilations", node2, tensorMap, context); const dataFormat = getParamValue("dataFormat", node2, tensorMap, context).toUpperCase(); - return [depthwiseConv2d(getParamValue("input", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2]], pad3, dataFormat, [dilations[1], dilations[2]])]; + return [depthwiseConv2d(getParamValue("input", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2]], pad32, dataFormat, [dilations[1], dilations[2]])]; } case "Conv3D": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const dataFormat = getParamValue("dataFormat", node2, tensorMap, context).toUpperCase(); const dilations = getParamValue("dilations", node2, tensorMap, context); - return [conv3d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2], stride[3]], pad3, dataFormat, [dilations[1], dilations[2], dilations[3]])]; + return [conv3d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [stride[1], stride[2], stride[3]], pad32, dataFormat, [dilations[1], dilations[2], dilations[3]])]; } case "AvgPool": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const kernelSize = getParamValue("kernelSize", node2, tensorMap, context); - return [avgPool(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad3)]; + return [avgPool(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad32)]; } case "MaxPool": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const kernelSize = getParamValue("kernelSize", node2, tensorMap, context); - return [maxPool(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad3)]; + return [maxPool(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad32)]; } case "MaxPoolWithArgmax": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const kernelSize = getParamValue("kernelSize", node2, tensorMap, context); const includeBatchInIndex = getParamValue("includeBatchInIndex", node2, tensorMap, context); - const { result, indexes } = maxPoolWithArgmax(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad3, includeBatchInIndex); + const { result, indexes } = maxPoolWithArgmax(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad32, includeBatchInIndex); return [result, indexes]; } case "AvgPool3D": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const kernelSize = getParamValue("kernelSize", node2, tensorMap, context); - return [avgPool3d(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad3)]; + return [avgPool3d(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad32)]; } case "MaxPool3D": { const stride = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const kernelSize = getParamValue("kernelSize", node2, tensorMap, context); - return [maxPool3d(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad3)]; + return [maxPool3d(getParamValue("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad32)]; } case "Dilation2D": { const strides = getParamValue("strides", node2, tensorMap, context); - const pad3 = getParamValue("pad", node2, tensorMap, context); + const pad32 = getParamValue("pad", node2, tensorMap, context); const dilations = getParamValue("dilations", node2, tensorMap, context); const strideHeight = strides[1]; const strideWidth = strides[2]; const dilationHeight = dilations[1]; const dilationWidth = dilations[2]; - return [dilation2d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [strideHeight, strideWidth], pad3, [dilationHeight, dilationWidth], "NHWC")]; + return [dilation2d(getParamValue("x", node2, tensorMap, context), getParamValue("filter", node2, tensorMap, context), [strideHeight, strideWidth], pad32, [dilationHeight, dilationWidth], "NHWC")]; } default: throw TypeError(`Node type ${node2.op} is not implemented`); @@ -34296,15 +36463,15 @@ var executeOp5 = (node2, tensorMap, context) => { case "Range": { const start = getParamValue("start", node2, tensorMap, context); const stop = getParamValue("stop", node2, tensorMap, context); - const step5 = getParamValue("step", node2, tensorMap, context); - return [range(start, stop, step5, getParamValue("dtype", node2, tensorMap, context))]; + const step52 = getParamValue("step", node2, tensorMap, context); + return [range(start, stop, step52, getParamValue("dtype", node2, tensorMap, context))]; } case "TruncatedNormal": { const shape = getParamValue("shape", node2, tensorMap, context); - const mean4 = getParamValue("mean", node2, tensorMap, context); + const mean42 = getParamValue("mean", node2, tensorMap, context); const stdDev = getParamValue("stdDev", node2, tensorMap, context); const seed = getParamValue("seed", node2, tensorMap, context); - return [truncatedNormal(shape, mean4, stdDev, getParamValue("dtype", node2, tensorMap, context), seed)]; + return [truncatedNormal(shape, mean42, stdDev, getParamValue("dtype", node2, tensorMap, context), seed)]; } case "Zeros": { return [zeros(getParamValue("shape", node2, tensorMap, context), getParamValue("dtype", node2, tensorMap, context))]; @@ -34419,7 +36586,7 @@ var executeOp8 = (node2, tensorMap, context) => { case "NoOp": return [scalar(1)]; case "Print": - const input2 = getParamValue("x", node2, tensorMap, context); + const input22 = getParamValue("x", node2, tensorMap, context); const data = getParamValue("data", node2, tensorMap, context); const message = getParamValue("message", node2, tensorMap, context); const summarize = getParamValue("summarize", node2, tensorMap, context); @@ -34428,7 +36595,7 @@ var executeOp8 = (node2, tensorMap, context) => { for (let i = 0; i < data.length; i++) { console.log(Array.prototype.slice.call(data[i].dataSync()).slice(0, summarize)); } - return [input2]; + return [input22]; default: throw TypeError(`Node type ${node2.op} is not implemented`); } @@ -34714,8 +36881,8 @@ var executeOp14 = (node2, tensorMap, context) => { case "Cumsum": { const axis = getParamValue("axis", node2, tensorMap, context); const exclusive = getParamValue("exclusive", node2, tensorMap, context); - const reverse5 = getParamValue("reverse", node2, tensorMap, context); - return [cumsum(getParamValue("x", node2, tensorMap, context), axis, exclusive, reverse5)]; + const reverse52 = getParamValue("reverse", node2, tensorMap, context); + return [cumsum(getParamValue("x", node2, tensorMap, context), axis, exclusive, reverse52)]; } case "Bincount": const x = getParamValue("x", node2, tensorMap, context); @@ -34744,16 +36911,16 @@ var executeOp15 = (node2, tensorMap, context) => { return [concat(inputs, axis)]; } case "Gather": { - const input2 = getParamValue("x", node2, tensorMap, context); + const input22 = getParamValue("x", node2, tensorMap, context); const indices = getParamValue("indices", node2, tensorMap, context); - return [gather(input2, cast(indices, "int32"), 0)]; + return [gather(input22, cast(indices, "int32"), 0)]; } case "GatherV2": { const axis = getParamValue("axis", node2, tensorMap, context); const batchDims = getParamValue("batchDims", node2, tensorMap, context); - const input2 = getParamValue("x", node2, tensorMap, context); + const input22 = getParamValue("x", node2, tensorMap, context); const indices = getParamValue("indices", node2, tensorMap, context); - return [gather(input2, cast(indices, "int32"), axis, batchDims)]; + return [gather(input22, cast(indices, "int32"), axis, batchDims)]; } case "Reverse": { const dims = getParamValue("dims", node2, tensorMap, context); @@ -34763,13 +36930,13 @@ var executeOp15 = (node2, tensorMap, context) => { axis.push(i); } } - const input2 = getParamValue("x", node2, tensorMap, context); - return [reverse(input2, axis)]; + const input22 = getParamValue("x", node2, tensorMap, context); + return [reverse(input22, axis)]; } case "ReverseV2": { const axis = getParamValue("axis", node2, tensorMap, context); - const input2 = getParamValue("x", node2, tensorMap, context); - return [reverse(input2, axis)]; + const input22 = getParamValue("x", node2, tensorMap, context); + return [reverse(input22, axis)]; } case "Slice": { const begin = getParamValue("begin", node2, tensorMap, context); @@ -34785,8 +36952,8 @@ var executeOp15 = (node2, tensorMap, context) => { const ellipsisMask = getParamValue("ellipsisMask", node2, tensorMap, context); const newAxisMask = getParamValue("newAxisMask", node2, tensorMap, context); const shrinkAxisMask = getParamValue("shrinkAxisMask", node2, tensorMap, context); - const tensor2 = getParamValue("x", node2, tensorMap, context); - return [stridedSlice(tensor2, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask)]; + const tensor22 = getParamValue("x", node2, tensorMap, context); + return [stridedSlice(tensor22, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask)]; } case "Pack": { return tidy(() => { @@ -34794,20 +36961,20 @@ var executeOp15 = (node2, tensorMap, context) => { const tensors = getParamValue("tensors", node2, tensorMap, context); const shape = tensors[0].shape; const squeezedShape = squeeze(tensors[0]).shape; - const mapped = tensors.map((tensor2) => { - const sameShape = util_exports.arraysEqual(tensor2.shape, shape); - if (!sameShape && !util_exports.arraysEqual(squeeze(tensor2).shape, squeezedShape)) { + const mapped = tensors.map((tensor22) => { + const sameShape = util_exports.arraysEqual(tensor22.shape, shape); + if (!sameShape && !util_exports.arraysEqual(squeeze(tensor22).shape, squeezedShape)) { throw new Error("the input tensors shape does not match"); } - return sameShape ? tensor2 : reshape(tensor2, shape); + return sameShape ? tensor22 : reshape(tensor22, shape); }); return [stack(mapped, axis)]; }); } case "Unpack": { const axis = getParamValue("axis", node2, tensorMap, context); - const tensor2 = getParamValue("tensor", node2, tensorMap, context); - return unstack(tensor2, axis); + const tensor22 = getParamValue("tensor", node2, tensorMap, context); + return unstack(tensor22, axis); } case "Tile": { const reps = getParamValue("reps", node2, tensorMap, context); @@ -34817,8 +36984,8 @@ var executeOp15 = (node2, tensorMap, context) => { case "SplitV": { const axis = getParamValue("axis", node2, tensorMap, context); const numOrSizeSplits = getParamValue("numOrSizeSplits", node2, tensorMap, context); - const tensor2 = getParamValue("x", node2, tensorMap, context); - return split(tensor2, numOrSizeSplits, axis); + const tensor22 = getParamValue("x", node2, tensorMap, context); + return split(tensor22, numOrSizeSplits, axis); } case "ScatterNd": { const indices = getParamValue("indices", node2, tensorMap, context); @@ -35024,9 +37191,9 @@ var ExecutionContext = class { newFrame(id, frameName) { return { id, frameName, iterationId: 0 }; } - set currentContext(contexts2) { - if (this.contexts !== contexts2) { - this.contexts = contexts2; + set currentContext(contexts22) { + if (this.contexts !== contexts22) { + this.contexts = contexts22; this.generateCurrentContextIds(); } } @@ -35042,14 +37209,14 @@ var ExecutionContext = class { generateCurrentContextIds() { const names = []; for (let i = 0; i < this.contexts.length - 1; i++) { - const contexts2 = this.contexts.slice(0, this.contexts.length - i); - names.push(this.contextIdforContexts(contexts2)); + const contexts22 = this.contexts.slice(0, this.contexts.length - i); + names.push(this.contextIdforContexts(contexts22)); } names.push(""); this._currentContextIds = names; } - contextIdforContexts(contexts2) { - return contexts2 ? contexts2.map((context) => context.id === 0 && context.iterationId === 0 ? "" : `${context.frameName}-${context.iterationId}`).join("/") : ""; + contextIdforContexts(contexts22) { + return contexts22 ? contexts22.map((context) => context.id === 0 && context.iterationId === 0 ? "" : `${context.frameName}-${context.iterationId}`).join("/") : ""; } enterFrame(frameId) { if (this.contexts) { @@ -35139,12 +37306,12 @@ function getExecutionSubgraph(inputs, outputs, weightMap, initNodes) { missingInputs.push(node2.name); continue; } - node2.inputs.forEach((input2) => { - if (seen.has(input2.name)) { + node2.inputs.forEach((input22) => { + if (seen.has(input22.name)) { return; } - seen.add(input2.name); - frontier.push(input2); + seen.add(input22.name); + frontier.push(input22); }); } return { inputs, outputs, usedNodes, missingInputs, dynamicNode, syncInputs }; @@ -35154,9 +37321,9 @@ function getNodesInTopologicalOrder(graph2, weightMap, executionInfo) { const frontier = []; const inputNodes = Object.keys(inputs).map((name) => parseNodeName(name)[0]).map((name) => graph2.nodes[name]); const initNodes = graph2.initNodes; - inputNodes.forEach((input2) => { - if (usedNodes.has(input2.name)) { - frontier.push(input2); + inputNodes.forEach((input22) => { + if (usedNodes.has(input22.name)) { + frontier.push(input22); } }); graph2.weights.forEach((weight) => { @@ -35180,7 +37347,7 @@ function getNodesInTopologicalOrder(graph2, weightMap, executionInfo) { orderedNodes.push(node2); } node2.children.forEach((child) => { - if (!seen.has(child.name) && usedNodes.has(child.name) && child.inputs.every((input2) => seen.has(input2.name))) { + if (!seen.has(child.name) && usedNodes.has(child.name) && child.inputs.every((input22) => seen.has(input22.name))) { frontier.push(child); } }); @@ -35253,7 +37420,7 @@ var GraphExecutor = class { return this.parent ? this.parent.weightMap : this._weightMap; } set weightMap(weightMap) { - const weightIds = Object.keys(weightMap).map((key) => weightMap[key].map((tensor2) => tensor2.id)); + const weightIds = Object.keys(weightMap).map((key) => weightMap[key].map((tensor22) => tensor22.id)); this._weightIds = [].concat(...weightIds); this._weightMap = weightMap; } @@ -35361,30 +37528,30 @@ var GraphExecutor = class { }); } getFrozenTensorIds(tensorMap) { - const ids = [].concat.apply([], Object.keys(tensorMap).map((key) => tensorMap[key]).map((tensors) => tensors.map((tensor2) => tensor2.id))); + const ids = [].concat.apply([], Object.keys(tensorMap).map((key) => tensorMap[key]).map((tensors) => tensors.map((tensor22) => tensor22.id))); return new Set(ids); } checkTensorForDisposal(nodeName, node2, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount) { if (node2.category === "control" || outputNames.indexOf(nodeName) !== -1) { return; } - tensorMap[nodeName].forEach((tensor2) => { - if (tensor2 != null) { - intermediateTensorConsumerCount[tensor2.id] = (intermediateTensorConsumerCount[tensor2.id] || 0) + node2.children.length; + tensorMap[nodeName].forEach((tensor22) => { + if (tensor22 != null) { + intermediateTensorConsumerCount[tensor22.id] = (intermediateTensorConsumerCount[tensor22.id] || 0) + node2.children.length; } }); - node2.inputs.forEach((input2) => { - if (input2.category !== "control") { - const tensors = getTensorsForCurrentContenxt(input2.name, tensorMap, context); + node2.inputs.forEach((input22) => { + if (input22.category !== "control") { + const tensors = getTensorsForCurrentContenxt(input22.name, tensorMap, context); if (tensors != null) { - tensors.forEach((tensor2) => { - if (tensor2 && !tensor2.kept && !tensorsToKeep.has(tensor2.id)) { - const count22 = intermediateTensorConsumerCount[tensor2.id]; + tensors.forEach((tensor22) => { + if (tensor22 && !tensor22.kept && !tensorsToKeep.has(tensor22.id)) { + const count22 = intermediateTensorConsumerCount[tensor22.id]; if (count22 === 1) { - tensor2.dispose(); - delete intermediateTensorConsumerCount[tensor2.id]; + tensor22.dispose(); + delete intermediateTensorConsumerCount[tensor22.id]; } else if (count22 != null) { - intermediateTensorConsumerCount[tensor2.id]--; + intermediateTensorConsumerCount[tensor22.id]--; } } }); @@ -35411,9 +37578,9 @@ var GraphExecutor = class { const keepIds = new Set([...outputIds, ...inputIds, ...this.weightIds]); Object.keys(tensorMap).forEach((key) => { const tensorArray = tensorMap[key]; - tensorArray.forEach((tensor2) => { - if (tensor2 && !tensor2.kept && !tensor2.isDisposed && !keepIds.has(tensor2.id)) { - tensor2.dispose(); + tensorArray.forEach((tensor22) => { + if (tensor22 && !tensor22.kept && !tensor22.isDisposed && !keepIds.has(tensor22.id)) { + tensor22.dispose(); } }); }); @@ -35423,8 +37590,8 @@ var GraphExecutor = class { return results; } async executeFunctionAsync(inputs, tensorArrayMap, tensorListMap) { - const mappedInputs = inputs.reduce((map, tensor2, index) => { - map[this.inputs[index].name] = tensor2; + const mappedInputs = inputs.reduce((map, tensor22, index) => { + map[this.inputs[index].name] = tensor22; return map; }, {}); return this._executeAsync(mappedInputs, this.outputNodes, true, tensorArrayMap, tensorListMap); @@ -35438,7 +37605,7 @@ var GraphExecutor = class { outputNodes2 = this._outputs; } const { usedNodes, missingInputs, dynamicNode, syncInputs } = getExecutionSubgraph(inputs, outputNodes2, this.weightMap, this._initNodes); - const stack2 = [ + const stack22 = [ ...inputNodes, ...this.graph.weights, ...this._initNodes || [] @@ -35455,8 +37622,8 @@ var GraphExecutor = class { const intermediateTensorConsumerCount = {}; const tensorsToKeep = this.getFrozenTensorIds(tensorsMap); const added = {}; - while (stack2.length > 0) { - const promises = this.processStack(inputNodes, stack2, context, tensorsMap, added, tensorsToKeep, outputNodeNames, intermediateTensorConsumerCount, usedNodes); + while (stack22.length > 0) { + const promises = this.processStack(inputNodes, stack22, context, tensorsMap, added, tensorsToKeep, outputNodeNames, intermediateTensorConsumerCount, usedNodes); await Promise.all(promises); } if (dynamicNode == null && !isFunctionExecution) { @@ -35472,10 +37639,10 @@ var GraphExecutor = class { } return tensorsMap; } - processStack(inputNodes, stack2, context, tensorMap, added, tensorsToKeep, outputNames, intermediateTensorConsumerCount, usedNodes) { + processStack(inputNodes, stack22, context, tensorMap, added, tensorsToKeep, outputNames, intermediateTensorConsumerCount, usedNodes) { const promises = []; - while (stack2.length > 0) { - const item = stack2.pop(); + while (stack22.length > 0) { + const item = stack22.pop(); context.currentContext = item.contexts; let nodeName = ""; if (item.node.op === "Enter" && getParamValue("isConstant", item.node, tensorMap, context)) { @@ -35492,21 +37659,21 @@ var GraphExecutor = class { tensorMap[nodeName] = t; context.currentContext = currentContext; this.checkTensorForDisposal(nodeName, item.node, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount); - this.processChildNodes(item.node, stack2, context, tensorMap, added, usedNodes); + this.processChildNodes(item.node, stack22, context, tensorMap, added, usedNodes); return t; })); } else { tensorMap[nodeName] = tensors; this.checkTensorForDisposal(nodeName, item.node, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount); - this.processChildNodes(item.node, stack2, context, tensorMap, added, usedNodes); + this.processChildNodes(item.node, stack22, context, tensorMap, added, usedNodes); } } else { - this.processChildNodes(item.node, stack2, context, tensorMap, added, usedNodes); + this.processChildNodes(item.node, stack22, context, tensorMap, added, usedNodes); } } return promises; } - processChildNodes(node2, stack2, context, tensorMap, added, usedNodes) { + processChildNodes(node2, stack22, context, tensorMap, added, usedNodes) { node2.children.forEach((childNode) => { const [nodeName] = getNodeNameAndIndex(childNode.name, context); if (added[nodeName] || !usedNodes.has(childNode.name)) { @@ -35517,31 +37684,31 @@ var GraphExecutor = class { return !!getTensor(name, tensorMap, context); })) { added[nodeName] = true; - stack2.push({ contexts: context.currentContext, node: childNode }); + stack22.push({ contexts: context.currentContext, node: childNode }); } } else if (childNode.inputNames.every((name) => { return !!getTensor(name, tensorMap, context); })) { added[nodeName] = true; - stack2.push({ contexts: context.currentContext, node: childNode }); + stack22.push({ contexts: context.currentContext, node: childNode }); } }); } dispose() { - Object.keys(this.weightMap).forEach((key) => this.weightMap[key].forEach((tensor2) => tensor2.dispose())); + Object.keys(this.weightMap).forEach((key) => this.weightMap[key].forEach((tensor22) => tensor22.dispose())); } checkInputShapeAndType(inputs) { Object.keys(inputs).forEach((name) => { - const input2 = inputs[name]; + const input22 = inputs[name]; const [nodeName] = parseNodeName(name); const node2 = this.graph.nodes[nodeName]; if (node2.attrParams["shape"] && node2.attrParams["shape"].value) { const shape = node2.attrParams["shape"].value; - const match4 = shape.length === input2.shape.length && input2.shape.every((dim, index) => shape[index] === -1 || shape[index] === dim); - util_exports.assert(match4, () => `The shape of dict['${node2.name}'] provided in model.execute(dict) must be [${shape}], but was [${input2.shape}]`); + const match4 = shape.length === input22.shape.length && input22.shape.every((dim, index) => shape[index] === -1 || shape[index] === dim); + util_exports.assert(match4, () => `The shape of dict['${node2.name}'] provided in model.execute(dict) must be [${shape}], but was [${input22.shape}]`); } if (node2.attrParams["dtype"] && node2.attrParams["dtype"].value) { - util_exports.assert(input2.dtype === node2.attrParams["dtype"].value, () => `The dtype of dict['${node2.name}'] provided in model.execute(dict) must be ${node2.attrParams["dtype"].value}, but was ${input2.dtype}`); + util_exports.assert(input22.dtype === node2.attrParams["dtype"].value, () => `The dtype of dict['${node2.name}'] provided in model.execute(dict) must be ${node2.attrParams["dtype"].value}, but was ${input22.dtype}`); } }); } @@ -35549,8 +37716,8 @@ var GraphExecutor = class { const result = {}; for (const inputName in inputs) { if (this._signature != null && this._signature.inputs != null && this._signature.inputs[inputName] != null) { - const tensor2 = this._signature.inputs[inputName]; - result[tensor2.name] = inputs[inputName]; + const tensor22 = this._signature.inputs[inputName]; + result[tensor22.name] = inputs[inputName]; } else { result[inputName] = inputs[inputName]; } @@ -35569,8 +37736,8 @@ var GraphExecutor = class { mapOutputs(outputs) { return outputs.map((name) => { if (this._signature != null && this._signature.outputs != null && this._signature.outputs[name] != null) { - const tensor2 = this._signature.outputs[name]; - return tensor2.name; + const tensor22 = this._signature.outputs[name]; + return tensor22.name; } return name; }, {}); @@ -35791,48 +37958,48 @@ __export2(dist_exports, { webcam: () => webcam, zip: () => zip }); -var seedrandom3 = __toModule(require_seedrandom4()); -var seedrandom2 = __toModule(require_seedrandom4()); -function deepMap(input2, mapFn) { - return deepMapInternal(input2, mapFn); +var seedrandom3 = __toModule2(require_seedrandom4()); +var seedrandom2 = __toModule2(require_seedrandom4()); +function deepMap(input22, mapFn) { + return deepMapInternal(input22, mapFn); } -function deepMapInternal(input2, mapFn, seen = new Map(), containedIn = new Set()) { - if (input2 == null) { +function deepMapInternal(input22, mapFn, seen = new Map(), containedIn = new Set()) { + if (input22 == null) { return null; } - if (containedIn.has(input2)) { + if (containedIn.has(input22)) { throw new Error("Circular references are not supported."); } - if (seen.has(input2)) { - return seen.get(input2); + if (seen.has(input22)) { + return seen.get(input22); } - const result = mapFn(input2); + const result = mapFn(input22); if (result.recurse && result.value !== null) { throw new Error("A deep map function may not return both a value and recurse=true."); } if (!result.recurse) { - seen.set(input2, result.value); + seen.set(input22, result.value); return result.value; - } else if (isIterable2(input2)) { - const mappedIterable = Array.isArray(input2) ? [] : {}; - containedIn.add(input2); - for (const k in input2) { - const child = input2[k]; + } else if (isIterable2(input22)) { + const mappedIterable = Array.isArray(input22) ? [] : {}; + containedIn.add(input22); + for (const k in input22) { + const child = input22[k]; const childResult = deepMapInternal(child, mapFn, seen, containedIn); mappedIterable[k] = childResult; } - containedIn.delete(input2); + containedIn.delete(input22); return mappedIterable; } else { - throw new Error(`Can't recurse into non-iterable type: ${input2}`); + throw new Error(`Can't recurse into non-iterable type: ${input22}`); } } function deepZip(inputs, zipFn = zipToList) { return deepZipInternal(inputs, zipFn); } function deepZipInternal(inputs, zipFn, containedIn = new Set()) { - const input2 = inputs[0]; - if (containedIn.has(input2)) { + const input22 = inputs[0]; + if (containedIn.has(input22)) { throw new Error("Circular references are not supported."); } const result = zipFn(inputs); @@ -35841,18 +38008,18 @@ function deepZipInternal(inputs, zipFn, containedIn = new Set()) { } if (!result.recurse) { return result.value; - } else if (isIterable2(input2)) { - const mappedIterable = Array.isArray(input2) ? [] : {}; - containedIn.add(input2); - for (const k in input2) { + } else if (isIterable2(input22)) { + const mappedIterable = Array.isArray(input22) ? [] : {}; + containedIn.add(input22); + for (const k in input22) { const children = inputs.map((x) => x[k]); const childResult = deepZipInternal(children, zipFn, containedIn); mappedIterable[k] = childResult; } - containedIn.delete(input2); + containedIn.delete(input22); return mappedIterable; } else { - throw new Error(`Can't recurse into non-iterable type: ${input2}`); + throw new Error(`Can't recurse into non-iterable type: ${input22}`); } } function zipToList(x) { @@ -35865,9 +38032,9 @@ function zipToList(x) { return { value: x, recurse: false }; } } -async function deepMapAndAwaitAll(input2, mapFn) { +async function deepMapAndAwaitAll(input22, mapFn) { const seen = new Map(); - deepMapInternal(input2, mapFn, seen); + deepMapInternal(input22, mapFn, seen); for (const key of Array.from(seen.keys())) { const value = seen.get(key); if (util_exports.isPromise(value)) { @@ -35875,7 +38042,7 @@ async function deepMapAndAwaitAll(input2, mapFn) { seen.set(key, mappedValue); } } - const result = deepMapInternal(input2, mapFn, seen); + const result = deepMapInternal(input22, mapFn, seen); return result; } function isIterable2(obj) { @@ -36035,8 +38202,8 @@ GrowingRingBuffer.INITIAL_CAPACITY = 32; function iteratorFromItems(items) { return new ArrayIterator(items); } -function iteratorFromFunction(func2) { - return new FunctionCallIterator(func2); +function iteratorFromFunction(func22) { + return new FunctionCallIterator(func22); } function iteratorFromConcatenated(baseIterators, baseErrorHandler) { return new ChainedIterator(baseIterators, baseErrorHandler); @@ -36084,17 +38251,17 @@ var LazyIterator = class { filter(predicate) { return new FilterIterator(this, predicate); } - map(transform5) { - return new MapIterator(this, transform5); + map(transform52) { + return new MapIterator(this, transform52); } - mapAsync(transform5) { - return new AsyncMapIterator(this, transform5); + mapAsync(transform52) { + return new AsyncMapIterator(this, transform52); } - serialMapAsync(transform5) { - return new AsyncMapIterator(this, transform5).serial(); + serialMapAsync(transform52) { + return new AsyncMapIterator(this, transform52).serial(); } - flatmap(transform5) { - return new FlatmapIterator(this, transform5); + flatmap(transform52) { + return new FlatmapIterator(this, transform52); } async forEachAsync(f) { return this.map(f).resolveFully(); @@ -36203,11 +38370,11 @@ var SkipIterator = class extends LazyIterator { } async serialNext() { while (this.count++ < this.maxCount) { - const skipped10 = await this.upstream.next(); - if (skipped10.done) { - return skipped10; + const skipped11 = await this.upstream.next(); + if (skipped11.done) { + return skipped11; } - dispose(skipped10.value); + dispose(skipped11.value); } return this.upstream.next(); } @@ -36284,10 +38451,10 @@ var FilterIterator = class extends LazyIterator { } }; var MapIterator = class extends LazyIterator { - constructor(upstream, transform5) { + constructor(upstream, transform52) { super(); this.upstream = upstream; - this.transform = transform5; + this.transform = transform52; } summary() { return `${this.upstream.summary()} -> Map`; @@ -36336,10 +38503,10 @@ var ErrorHandlingLazyIterator = class extends LazyIterator { } }; var AsyncMapIterator = class extends LazyIterator { - constructor(upstream, transform5) { + constructor(upstream, transform52) { super(); this.upstream = upstream; - this.transform = transform5; + this.transform = transform52; } summary() { return `${this.upstream.summary()} -> AsyncMap`; @@ -36380,10 +38547,10 @@ var OneToManyIterator = class extends LazyIterator { } }; var FlatmapIterator = class extends OneToManyIterator { - constructor(upstream, transform5) { + constructor(upstream, transform52) { super(); this.upstream = upstream; - this.transform = transform5; + this.transform = transform52; } summary() { return `${this.upstream.summary()} -> Flatmap`; @@ -36442,10 +38609,10 @@ var ChainedIterator = class extends LazyIterator { } }; var ZipMismatchMode; -(function(ZipMismatchMode2) { - ZipMismatchMode2[ZipMismatchMode2["FAIL"] = 0] = "FAIL"; - ZipMismatchMode2[ZipMismatchMode2["SHORTEST"] = 1] = "SHORTEST"; - ZipMismatchMode2[ZipMismatchMode2["LONGEST"] = 2] = "LONGEST"; +(function(ZipMismatchMode22) { + ZipMismatchMode22[ZipMismatchMode22["FAIL"] = 0] = "FAIL"; + ZipMismatchMode22[ZipMismatchMode22["SHORTEST"] = 1] = "SHORTEST"; + ZipMismatchMode22[ZipMismatchMode22["LONGEST"] = 2] = "LONGEST"; })(ZipMismatchMode || (ZipMismatchMode = {})); var ZipIterator = class extends LazyIterator { constructor(iterators, mismatchMode = ZipMismatchMode.FAIL) { @@ -36536,8 +38703,8 @@ var ShuffleIterator = class extends PrefetchIterator { this.lastRead = this.lastRead.then(() => this.serialNext()); return this.lastRead; } - randomInt(max6) { - return Math.floor(this.random() * max6); + randomInt(max62) { + return Math.floor(this.random() * max62); } chooseIndex() { return this.randomInt(this.buffer.length()); @@ -36606,16 +38773,16 @@ var Dataset = class { async forEachAsync(f) { return (await this.iterator()).forEachAsync(f); } - map(transform5) { + map(transform52) { const base2 = this; return datasetFromIteratorFn(async () => { - return (await base2.iterator()).map((x) => tidy(() => transform5(x))); + return (await base2.iterator()).map((x) => tidy(() => transform52(x))); }, this.size); } - mapAsync(transform5) { + mapAsync(transform52) { const base2 = this; return datasetFromIteratorFn(async () => { - return (await base2.iterator()).mapAsync(transform5); + return (await base2.iterator()).mapAsync(transform52); }, this.size); } prefetch(bufferSize) { @@ -36761,9 +38928,9 @@ function batchConcat(arrays) { } } var TextLineDataset = class extends Dataset { - constructor(input2) { + constructor(input22) { super(); - this.input = input2; + this.input = input22; } async iterator() { const inputIterator = await this.input.iterator(); @@ -36784,9 +38951,9 @@ var STATE_QUOTE = Symbol("quote"); var STATE_QUOTE_AFTER_QUOTE = Symbol("quoteafterquote"); var STATE_WITHIN_QUOTE_IN_QUOTE = Symbol("quoteinquote"); var CSVDataset = class extends Dataset { - constructor(input2, csvConfig) { + constructor(input22, csvConfig) { super(); - this.input = input2; + this.input = input22; this.hasHeader = true; this.fullColumnNames = null; this.columnNamesValidated = false; @@ -36794,7 +38961,7 @@ var CSVDataset = class extends Dataset { this.configuredColumnsOnly = false; this.delimiter = ","; this.delimWhitespace = false; - this.base = new TextLineDataset(input2); + this.base = new TextLineDataset(input22); if (!csvConfig) { csvConfig = {}; } @@ -37414,8 +39581,8 @@ var FileChunkIterator = class extends ByteChunkIterator { fileReader.onerror = (event) => { return reject(new Error(event.type)); }; - const slice5 = this.file.slice(this.offset, end); - fileReader.readAsArrayBuffer(slice5); + const slice52 = this.file.slice(this.offset, end); + fileReader.readAsArrayBuffer(slice52); } this.offset = end; }); @@ -37457,9 +39624,9 @@ function isLocalPath(source) { return typeof source === "string" && source.substr(0, 7) === "file://"; } var FileDataSource = class extends DataSource { - constructor(input2, options3 = {}) { + constructor(input22, options3 = {}) { super(); - this.input = input2; + this.input = input22; this.options = options3; } async iterator() { @@ -37491,9 +39658,9 @@ function func(f) { const iter = iteratorFromFunction(f); return datasetFromIteratorFn(async () => iter); } -function generator(generator2) { +function generator(generator22) { return datasetFromIteratorFn(async () => { - const gen = await generator2(); + const gen = await generator22(); return iteratorFromFunction(() => gen.next()); }); } @@ -37504,11 +39671,11 @@ async function microphone(microphoneConfig) { return MicrophoneIterator.create(microphoneConfig); } var version4 = "3.9.0"; -function assertNotComplex(tensor2, opName) { - if (!Array.isArray(tensor2)) { - tensor2 = [tensor2]; +function assertNotComplex(tensor22, opName) { + if (!Array.isArray(tensor22)) { + tensor22 = [tensor22]; } - tensor2.forEach((t) => { + tensor22.forEach((t) => { if (t != null) { util_exports.assert(t.dtype !== "complex64", () => `${opName} does not support complex64 tensors in the CPU backend.`); } @@ -37709,7 +39876,7 @@ var absConfig = { backendName: "cpu", kernelFunc: abs2 }; -function createSimpleBinaryKernelImpl(op2) { +function createSimpleBinaryKernelImpl(op22) { return (aShape, bShape, aVals, bVals, dtype) => { const newShape = backend_util_exports.assertAndGetBroadcastShape(aShape, bShape); const resultRank = newShape.length; @@ -37724,7 +39891,7 @@ function createSimpleBinaryKernelImpl(op2) { const bBroadcastDims = backend_util_exports.getBroadcastDims(bShape, newShape); if (aBroadcastDims.length + bBroadcastDims.length === 0) { for (let i = 0; i < result.length; ++i) { - result[i] = op2(aVals[i % aVals.length], bVals[i % bVals.length]); + result[i] = op22(aVals[i % aVals.length], bVals[i % bVals.length]); } } else { for (let i = 0; i < result.length; ++i) { @@ -37735,7 +39902,7 @@ function createSimpleBinaryKernelImpl(op2) { const bLoc = loc.slice(-bRank); bBroadcastDims.forEach((d) => bLoc[d] = 0); const bIndex = util_exports.locToIndex(bLoc, bRank, bStrides); - result[i] = op2(aVals[aIndex], bVals[bIndex]); + result[i] = op22(aVals[aIndex], bVals[bIndex]); } } return [result, newShape]; @@ -37743,14 +39910,14 @@ function createSimpleBinaryKernelImpl(op2) { } function complex2(args) { const { inputs, backend: backend22 } = args; - const { real: real4, imag: imag4 } = inputs; - const realVals = backend22.data.get(real4.dataId).values; - const imagVals = backend22.data.get(imag4.dataId).values; - const complexInfo = backend22.makeTensorInfo(real4.shape, "complex64"); - const complex4 = backend22.data.get(complexInfo.dataId); - complex4.complexTensorInfos = { - real: backend22.makeTensorInfo(real4.shape, "float32", realVals), - imag: backend22.makeTensorInfo(imag4.shape, "float32", imagVals) + const { real: real42, imag: imag42 } = inputs; + const realVals = backend22.data.get(real42.dataId).values; + const imagVals = backend22.data.get(imag42.dataId).values; + const complexInfo = backend22.makeTensorInfo(real42.shape, "complex64"); + const complex42 = backend22.data.get(complexInfo.dataId); + complex42.complexTensorInfos = { + real: backend22.makeTensorInfo(real42.shape, "float32", realVals), + imag: backend22.makeTensorInfo(imag42.shape, "float32", imagVals) }; return complexInfo; } @@ -37761,9 +39928,9 @@ var complexConfig = { }; function zeros3(backend22, shape, dtype = "float32") { if (dtype === "complex64") { - const real4 = zeros3(backend22, shape, "float32"); - const imag4 = zeros3(backend22, shape, "float32"); - return complex2({ inputs: { real: real4, imag: imag4 }, backend: backend22 }); + const real42 = zeros3(backend22, shape, "float32"); + const imag42 = zeros3(backend22, shape, "float32"); + return complex2({ inputs: { real: real42, imag: imag42 }, backend: backend22 }); } const values = util_exports.makeZerosTypedArray(util_exports.sizeFromShape(shape), dtype); return backend22.makeTensorInfo(shape, dtype, values); @@ -37781,10 +39948,10 @@ var identityConfig = { }; function real2(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const real4 = backend22.data.get(input2.dataId).complexTensorInfos.real; - const realVal = backend22.data.get(real4.dataId).values; - return backend22.makeTensorInfo(real4.shape, real4.dtype, realVal); + const { input: input22 } = inputs; + const real42 = backend22.data.get(input22.dataId).complexTensorInfos.real; + const realVal = backend22.data.get(real42.dataId).values; + return backend22.makeTensorInfo(real42.shape, real42.dtype, realVal); } var realConfig = { kernelName: Real, @@ -37883,7 +40050,7 @@ function binaryKernelFunc(name, simpleImpl, complexImpl, dtype) { } }; } -function createComplexBinaryKernelImpl(op2) { +function createComplexBinaryKernelImpl(op22) { return (aShape, bShape, aRealVals, aImagVals, bRealVals, bImagVals) => { const resultShape = backend_util_exports.assertAndGetBroadcastShape(aShape, bShape); const resultSize = util_exports.sizeFromShape(resultShape); @@ -37903,7 +40070,7 @@ function createComplexBinaryKernelImpl(op2) { for (let i = 0; i < resultRealVals.length; i++) { const aIdx = i % aVals.length; const bIdx = i % bVals.length; - const result = op2(aVals[aIdx * 2], aVals[aIdx * 2 + 1], bVals[bIdx * 2], bVals[bIdx * 2 + 1]); + const result = op22(aVals[aIdx * 2], aVals[aIdx * 2 + 1], bVals[bIdx * 2], bVals[bIdx * 2 + 1]); resultRealVals[i] = result.real; resultImagVals[i] = result.imag; } @@ -37916,7 +40083,7 @@ function createComplexBinaryKernelImpl(op2) { const bLoc = loc.slice(-bRank); bBroadcastDims.forEach((d) => bLoc[d] = 0); const bIndex = util_exports.locToIndex(bLoc, bRank, bStrides); - const opResult = op2(aVals[aIndex * 2], aVals[aIndex * 2 + 1], bVals[bIndex * 2], bVals[bIndex * 2 + 1]); + const opResult = op22(aVals[aIndex * 2], aVals[aIndex * 2 + 1], bVals[bIndex * 2], bVals[bIndex * 2 + 1]); resultRealVals[i] = opResult.real; resultImagVals[i] = opResult.imag; } @@ -37979,16 +40146,16 @@ function bincountReduceImpl(xBuf, weightsBuf, size2, binaryOutput = false) { } return outBuf; } -function createSimpleUnaryImpl(op2) { +function createSimpleUnaryImpl(op22) { return (values, dtype, attrs) => { const newValues = util_exports.getTypedArrayFromDType(dtype, values.length); for (let i = 0; i < values.length; ++i) { - newValues[i] = op2(values[i], attrs); + newValues[i] = op22(values[i], attrs); } return newValues; }; } -function unaryKernelFunc(name, op2, dtype) { +function unaryKernelFunc(name, op22, dtype) { return ({ inputs, attrs, backend: backend22 }) => { const { x } = inputs; assertNotComplex(x, name); @@ -38001,7 +40168,7 @@ function unaryKernelFunc(name, op2, dtype) { const $dtype = dtype || x.dtype; const newValues = util_exports.getArrayFromDType($dtype, xSize); for (let i = 0; i < xSize; ++i) { - newValues[i] = op2(values[i], attrs); + newValues[i] = op22(values[i], attrs); } return cpuBackend.makeTensorInfo(x.shape, $dtype, newValues); }; @@ -38031,23 +40198,23 @@ function concatImpl(inputs, outShape, dtype, simplyConcat) { const outVals = util_exports.getArrayFromDType(dtype, util_exports.sizeFromShape(outShape)); if (simplyConcat && dtype !== "string") { let offset = 0; - inputs.forEach((input2) => { - const size2 = util_exports.sizeFromShape(input2.shape); - outVals.set(input2.vals, offset); + inputs.forEach((input22) => { + const size2 = util_exports.sizeFromShape(input22.shape); + outVals.set(input22.vals, offset); offset += size2; }); } else { let colOffset = 0; - inputs.forEach((input2) => { - const decodedData = dtype === "string" ? backend_util_exports.fromUint8ToStringArray(input2.vals) : input2.vals; + inputs.forEach((input22) => { + const decodedData = dtype === "string" ? backend_util_exports.fromUint8ToStringArray(input22.vals) : input22.vals; let tIdx = 0; - for (let row = 0; row < input2.shape[0]; ++row) { + for (let row = 0; row < input22.shape[0]; ++row) { const resIdx = row * outShape[1] + colOffset; - for (let col = 0; col < input2.shape[1]; ++col) { + for (let col = 0; col < input22.shape[1]; ++col) { outVals[resIdx + col] = decodedData[tIdx++]; } } - colOffset += input2.shape[1]; + colOffset += input22.shape[1]; }); } return outVals; @@ -38142,11 +40309,11 @@ var lessEqualConfig = { kernelFunc: lessEqual2 }; function linSpaceImpl(start, stop, num) { - const step5 = (stop - start) / (num - 1); + const step52 = (stop - start) / (num - 1); const values = util_exports.makeZerosTypedArray(num, "float32"); values[0] = start; for (let i = 1; i < values.length; i++) { - values[i] = values[i - 1] + step5; + values[i] = values[i - 1] + step52; } return values; } @@ -38161,14 +40328,14 @@ function maxImpl(aVals, reduceSize, outShape, dtype) { const vals = util_exports.getTypedArrayFromDType(dtype, util_exports.sizeFromShape(outShape)); for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let max6 = aVals[offset]; + let max62 = aVals[offset]; for (let j = 0; j < reduceSize; ++j) { const value = aVals[offset + j]; - if (Number.isNaN(value) || value > max6) { - max6 = value; + if (Number.isNaN(value) || value > max62) { + max62 = value; } } - vals[i] = max6; + vals[i] = max62; } return vals; } @@ -38267,11 +40434,11 @@ function prodImpl(xShape, xDtype, xVals, reductionAxes) { const reduceSize = util_exports.sizeFromShape(reduceShape); for (let i = 0; i < outVals.length; ++i) { const offset = i * reduceSize; - let prod5 = 1; + let prod52 = 1; for (let j = 0; j < reduceSize; ++j) { - prod5 *= xVals[offset + j]; + prod52 *= xVals[offset + j]; } - outVals[i] = prod5; + outVals[i] = prod52; } return { outVals, outShape, outDtype }; } @@ -38305,21 +40472,21 @@ var prodConfig = { backendName: "cpu", kernelFunc: prod2 }; -function rangeImpl(start, stop, step5, dtype) { +function rangeImpl(start, stop, step52, dtype) { const sameStartStop = start === stop; - const increasingRangeNegativeStep = start < stop && step5 < 0; - const decreasingRangePositiveStep = stop < start && step5 > 1; + const increasingRangeNegativeStep = start < stop && step52 < 0; + const decreasingRangePositiveStep = stop < start && step52 > 1; if (sameStartStop || increasingRangeNegativeStep || decreasingRangePositiveStep) { return util_exports.makeZerosTypedArray(0, dtype); } - const numElements = Math.abs(Math.ceil((stop - start) / step5)); + const numElements = Math.abs(Math.ceil((stop - start) / step52)); const values = util_exports.makeZerosTypedArray(numElements, dtype); - if (stop < start && step5 === 1) { - step5 = -1; + if (stop < start && step52 === 1) { + step52 = -1; } values[0] = start; for (let i = 1; i < values.length; i++) { - values[i] = values[i - 1] + step5; + values[i] = values[i - 1] + step52; } return values; } @@ -38506,9 +40673,9 @@ function sparseReshapeImpl(inputIndices, inputIndicesShape, inputDType, inputSha } outputShape[unknownIndex] = missing; } - const outputSize3 = util_exports.sizeFromShape(outputShape); - if (outputSize3 !== denseSize) { - throw new Error(`Input to reshape is a tensor with ${denseSize} dense values, but the requested shape has ${outputSize3}. inputShape=${inputShape} outputShape=${outputShape}`); + const outputSize2 = util_exports.sizeFromShape(outputShape); + if (outputSize2 !== denseSize) { + throw new Error(`Input to reshape is a tensor with ${denseSize} dense values, but the requested shape has ${outputSize2}. inputShape=${inputShape} outputShape=${outputShape}`); } const inputRank = inputShape.length; const inputStrides = []; @@ -38538,12 +40705,12 @@ function sparseReshapeImpl(inputIndices, inputIndicesShape, inputDType, inputSha } return [newIndices, [nnz, outputRank], outputShape]; } -function sparseSegmentReductionImpl(input2, inputShape, inputDType, indices, segmentIds, isMean = false, defaultValue = 0) { +function sparseSegmentReductionImpl(input22, inputShape, inputDType, indices, segmentIds, isMean = false, defaultValue = 0) { const numIndices = indices.length; if (numIndices !== segmentIds.length) { throw new Error(`segmentIds and indices should have same size.`); } - const inputFlat = [inputShape[0], input2.length / inputShape[0]]; + const inputFlat = [inputShape[0], input22.length / inputShape[0]]; const numCol = inputFlat[1]; const lastSegmentIdPlusOne = numIndices > 0 ? segmentIds[numIndices - 1] + 1 : 0; const outputRows = lastSegmentIdPlusOne; @@ -38590,7 +40757,7 @@ function sparseSegmentReductionImpl(input2, inputShape, inputDType, indices, seg throw new Error(`Bad: indices[${i}] == ${indices[i]} out of range [0, ${inputFlat[0]})`); } for (let j = 0; j < numCol; j++) { - output[outIndex * numCol + j] += input2[index * numCol + j]; + output[outIndex * numCol + j] += input22[index * numCol + j]; } } if (isMean) { @@ -38641,11 +40808,11 @@ function stridedSliceImpl(outShape, xBuf, strides, begin) { return outBuf; } var StringNGramsOp = class { - constructor(separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences) { + constructor(separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences) { this.separator = util_exports.encodeString(separator); this.nGramWidths = nGramWidths; this.leftPad = util_exports.encodeString(leftPad); - this.rightPad = util_exports.encodeString(rightPad2); + this.rightPad = util_exports.encodeString(rightPad22); this.padWidth = padWidth; this.preserveShort = preserveShortSequences; } @@ -38762,8 +40929,8 @@ var StringNGramsOp = class { return [nGrams, nGramsSplits]; } }; -function stringNGramsImpl(data, dataSplits, separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences) { - return new StringNGramsOp(separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences).compute(data, dataSplits); +function stringNGramsImpl(data, dataSplits, separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences) { + return new StringNGramsOp(separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences).compute(data, dataSplits); } function split3(str, delimiters, skipEmpty, result) { if (!str.length) { @@ -38802,22 +40969,22 @@ function split3(str, delimiters, skipEmpty, result) { } } } -function stringSplitImpl(input2, delimiter, skipEmpty) { - const batchSize = input2.length; +function stringSplitImpl(input22, delimiter, skipEmpty) { + const batchSize = input22.length; const tokens = []; - let outputSize3 = 0; + let outputSize2 = 0; let maxNumEntries = 0; const numIndices = new Array(batchSize); for (let i = 0; i < batchSize; ++i) { const prevTokensLength = tokens.length; - split3(input2[i], delimiter, skipEmpty, tokens); + split3(input22[i], delimiter, skipEmpty, tokens); const nEntries = tokens.length - prevTokensLength; numIndices[i] = nEntries; - outputSize3 += nEntries; + outputSize2 += nEntries; maxNumEntries = Math.max(maxNumEntries, nEntries); } - const indices = util_exports.getArrayFromDType("int32", outputSize3 * 2); - const values = new Array(outputSize3); + const indices = util_exports.getArrayFromDType("int32", outputSize2 * 2); + const values = new Array(outputSize2); const shape = [batchSize, maxNumEntries]; let c = 0; for (let i = 0; i < batchSize; ++i) { @@ -38830,10 +40997,10 @@ function stringSplitImpl(input2, delimiter, skipEmpty) { } return [indices, values, shape]; } -function stringToHashBucketFastImpl(input2, numBuckets) { - const output = util_exports.getArrayFromDType("int32", input2.length); - for (let i = 0; i < input2.length; ++i) { - output[i] = util_exports.fingerPrint64(input2[i]).modulo(numBuckets).getLowBitsUnsigned(); +function stringToHashBucketFastImpl(input22, numBuckets) { + const output = util_exports.getArrayFromDType("int32", input22.length); + for (let i = 0; i < input22.length; ++i) { + output[i] = util_exports.fingerPrint64(input22[i]).modulo(numBuckets).getLowBitsUnsigned(); } return output; } @@ -38868,7 +41035,7 @@ var comparePair = (a, b) => { const valueDiff = b.value - a.value; return valueDiff === 0 ? a.index - b.index : valueDiff; }; -function select(array2, k, left = 0, right = array2.length - 1) { +function select(array22, k, left = 0, right = array22.length - 1) { while (right > left) { if (right - left > 600) { const n = right - left + 1; @@ -38878,31 +41045,31 @@ function select(array2, k, left = 0, right = array2.length - 1) { const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * Math.sign(i2 - n / 2); const newLeft = Math.max(left, Math.floor(k - i2 * s / n + sd)); const newRight = Math.min(right, Math.floor(k + (n - i2) * s / n + sd)); - select(array2, k, newLeft, newRight); + select(array22, k, newLeft, newRight); } - const t = array2[k]; + const t = array22[k]; let i = left; let j = right; - util_exports.swap(array2, left, k); - if (comparePair(array2[right], t) > 0) { - util_exports.swap(array2, left, right); + util_exports.swap(array22, left, k); + if (comparePair(array22[right], t) > 0) { + util_exports.swap(array22, left, right); } while (i < j) { - util_exports.swap(array2, i, j); + util_exports.swap(array22, i, j); i++; j--; - while (comparePair(array2[i], t) < 0) { + while (comparePair(array22[i], t) < 0) { i = i + 1; } - while (comparePair(array2[j], t) > 0) { + while (comparePair(array22[j], t) > 0) { j = j - 1; } } - if (comparePair(array2[left], t) === 0) { - util_exports.swap(array2, left, j); + if (comparePair(array22[left], t) === 0) { + util_exports.swap(array22, left, j); } else { j = j + 1; - util_exports.swap(array2, j, right); + util_exports.swap(array22, j, right); } if (j <= k) { left = j + 1; @@ -39080,10 +41247,10 @@ function reshape3(args) { backend22.incRef(x.dataId); const xData = backend22.data.get(x.dataId); if (xData.complexTensorInfos != null) { - const real4 = xData.complexTensorInfos.real; - const imag4 = xData.complexTensorInfos.imag; - real4.shape = $shape; - imag4.shape = $shape; + const real42 = xData.complexTensorInfos.real; + const imag42 = xData.complexTensorInfos.imag; + real42.shape = $shape; + imag42.shape = $shape; } return { dataId: x.dataId, shape: $shape, dtype: x.dtype }; } @@ -39133,21 +41300,21 @@ function batchMatMul(args) { for (let bi = 0; bi < batchDim; bi++) { for (let i0 = 0; i0 < leftDim; i0 += blockSize) { for (let j0 = 0; j0 < rightDim; j0 += blockSize) { - for (let k02 = 0; k02 < sharedDim; k02 += blockSize) { + for (let k022 = 0; k022 < sharedDim; k022 += blockSize) { const iBlock = Math.min(i0 + blockSize, leftDim); const jBlock = Math.min(j0 + blockSize, rightDim); - const kBlock = Math.min(k02 + blockSize, sharedDim); + const kBlock = Math.min(k022 + blockSize, sharedDim); for (let i = i0; i < iBlock; i++) { for (let j = j0; j < jBlock; j++) { - let sum6 = 0; - for (let k = k02; k < kBlock; k++) { + let sum62 = 0; + for (let k = k022; k < kBlock; k++) { const batchOffsetA = Math.min(bi, batchDimA - 1) * aBatch; const batchOffsetB = Math.min(bi, batchDimB - 1) * bBatch; const aVal = a3dValues[batchOffsetA + i * aOuterStep + k * aInnerStep]; const bVal = b3dValues[k * bInnerStep + j * bOuterStep + batchOffsetB]; - sum6 += aVal * bVal; + sum62 += aVal * bVal; } - resVals[bi * size2 + (i * rightDim + j)] += sum6; + resVals[bi * size2 + (i * rightDim + j)] += sum62; } } } @@ -39336,12 +41503,12 @@ function argMax2(args) { const aVals = backend22.data.get($x.dataId).values; for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let max6 = aVals[offset]; + let max62 = aVals[offset]; let maxIndex = 0; for (let j = 0; j < reduceSize; ++j) { const value = aVals[offset + j]; - if (value > max6) { - max6 = value; + if (value > max62) { + max62 = value; maxIndex = j; } } @@ -39378,12 +41545,12 @@ function argMin2(args) { const aVals = backend22.data.get($x.dataId).values; for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let min6 = aVals[offset]; + let min62 = aVals[offset]; let minIndex = 0; for (let j = 0; j < reduceSize; ++j) { const value = aVals[offset + j]; - if (value < min6) { - min6 = value; + if (value < min62) { + min62 = value; minIndex = j; } } @@ -39684,18 +41851,18 @@ function avgPool2(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; assertNotComplex(x, "avgPool"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = 1; util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); let res; if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports.arraysEqual(convInfo.inShape, convInfo.outShape)) { res = identity2({ inputs: { x }, backend: backend22 }); } else { const xValues = backend22.data.get(x.dataId).values; const strides2 = util_exports.computeStrides(x.shape); - const buffer2 = pool2(xValues, x.shape, x.dtype, strides2, convInfo, "avg"); - res = backend22.makeTensorInfo(convInfo.outShape, x.dtype, buffer2.values); + const buffer22 = pool2(xValues, x.shape, x.dtype, strides2, convInfo, "avg"); + res = backend22.makeTensorInfo(convInfo.outShape, x.dtype, buffer22.values); } return res; } @@ -39707,9 +41874,9 @@ var avgPoolConfig = { function avgPool3D(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { filterSize, strides, pad: pad3, dimRoundingMode, dataFormat } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode, dataFormat } = attrs; assertNotComplex(x, "avgPool3d"); - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode, dataFormat); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode, dataFormat); const xValues = backend22.data.get(x.dataId).values; const outBuf = pool3d2(xValues, x.shape, x.dtype, util_exports.computeStrides(x.shape), convInfo, "avg"); return backend22.makeTensorInfo(outBuf.shape, "float32", outBuf.values); @@ -39721,10 +41888,10 @@ var avgPool3DConfig = { }; function avgPool3DGrad(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - assertNotComplex([dy, input2], "avgPool3DGrad"); - const convInfo = backend_util_exports.computePool3DInfo(input2.shape, filterSize, strides, 1, pad3, dimRoundingMode); + const { dy, input: input22 } = inputs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + assertNotComplex([dy, input22], "avgPool3DGrad"); + const convInfo = backend_util_exports.computePool3DInfo(input22.shape, filterSize, strides, 1, pad32, dimRoundingMode); const strideDepth = convInfo.strideDepth; const strideHeight = convInfo.strideHeight; const strideWidth = convInfo.strideWidth; @@ -39740,7 +41907,7 @@ function avgPool3DGrad(args) { const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; - const dx = buffer(input2.shape, "float32"); + const dx = buffer(input22.shape, "float32"); const avgMultiplier = 1 / (filterDepth * filterHeight * filterWidth); const dyBuf = backend22.bufferSync(dy); for (let batch = 0; batch < convInfo.batchSize; ++batch) { @@ -39787,11 +41954,11 @@ var avgPool3DGradConfig2 = { }; function avgPoolGrad2(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const x = input2; - assertNotComplex([dy, input2], "avgPoolGrad"); - const { filterSize, strides, pad: pad3 } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3); + const { dy, input: input22 } = inputs; + const x = input22; + assertNotComplex([dy, input22], "avgPoolGrad"); + const { filterSize, strides, pad: pad32 } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32); const strideHeight = convInfo.strideHeight; const strideWidth = convInfo.strideWidth; const filterHeight = convInfo.filterHeight; @@ -39841,17 +42008,17 @@ var avgPoolGradConfig2 = { }; function batchNorm2(args) { const { inputs, backend: backend22, attrs } = args; - const { x, scale: scale22, offset, mean: mean4, variance } = inputs; - util_exports.assert(mean4.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); - util_exports.assert(offset == null || mean4.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); - util_exports.assert(scale22 == null || mean4.shape.length === scale22.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); - assertNotComplex([x, mean4, variance, scale22, offset], "batchNorm"); + const { x, scale: scale22, offset, mean: mean42, variance } = inputs; + util_exports.assert(mean42.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); + util_exports.assert(offset == null || mean42.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); + util_exports.assert(scale22 == null || mean42.shape.length === scale22.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + assertNotComplex([x, mean42, variance, scale22, offset], "batchNorm"); let { varianceEpsilon } = attrs; if (varianceEpsilon == null) { varianceEpsilon = 1e-3; } const xVals = backend22.data.get(x.dataId).values; - const mVals = backend22.data.get(mean4.dataId).values; + const mVals = backend22.data.get(mean42.dataId).values; const varVals = backend22.data.get(variance.dataId).values; const sVals = scale22 ? backend22.data.get(scale22.dataId).values : new Float32Array([1]); const offVals = offset ? backend22.data.get(offset.dataId).values : new Float32Array([0]); @@ -39891,10 +42058,10 @@ function batchToSpaceND2(args) { const { x } = inputs; const { blockShape, crops } = attrs; assertNotComplex([x], "batchToSpaceND"); - const prod5 = blockShape.reduce((a, b) => a * b); - const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod5); + const prod52 = blockShape.reduce((a, b) => a * b); + const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod52); const permuted = backend_util_exports.getPermuted(reshaped.length, blockShape.length); - const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod5); + const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod52); const sliceBeginCoords = backend_util_exports.getSliceBeginCoords(crops, blockShape.length); const sliceSize = backend_util_exports.getSliceSize(reshapedPermuted, crops, blockShape.length); const xReshaped = reshape3({ inputs: { x }, backend: backend22, attrs: { shape: reshaped } }); @@ -39959,14 +42126,14 @@ var complexAbs = (args) => { const cpuBackend = args.backend; const resultValues = new Float32Array(util_exports.sizeFromShape(x.shape)); const complexVals = cpuBackend.data.get(x.dataId); - const real4 = complexVals.complexTensorInfos.real; - const imag4 = complexVals.complexTensorInfos.imag; - const realVals = cpuBackend.data.get(real4.dataId).values; - const imagVals = cpuBackend.data.get(imag4.dataId).values; + const real42 = complexVals.complexTensorInfos.real; + const imag42 = complexVals.complexTensorInfos.imag; + const realVals = cpuBackend.data.get(real42.dataId).values; + const imagVals = cpuBackend.data.get(imag42.dataId).values; for (let i = 0; i < realVals.length; i++) { - const real5 = realVals[i]; - const imag5 = imagVals[i]; - resultValues[i] = Math.hypot(real5, imag5); + const real52 = realVals[i]; + const imag52 = imagVals[i]; + resultValues[i] = Math.hypot(real52, imag52); } return cpuBackend.makeOutput(resultValues, x.shape, "float32"); }; @@ -39977,10 +42144,10 @@ var complexAbsConfig = { }; function imag2(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const imag4 = backend22.data.get(input2.dataId).complexTensorInfos.imag; - const imagVal = backend22.data.get(imag4.dataId).values; - return backend22.makeTensorInfo(imag4.shape, imag4.dtype, imagVal); + const { input: input22 } = inputs; + const imag42 = backend22.data.get(input22.dataId).complexTensorInfos.imag; + const imagVal = backend22.data.get(imag42.dataId).values; + return backend22.makeTensorInfo(imag42.shape, imag42.dtype, imagVal); } var imagConfig = { kernelName: Imag, @@ -40037,10 +42204,10 @@ var concatConfig = { function conv2D(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dataFormat, dilations, dimRoundingMode } = attrs; + const { strides, pad: pad32, dataFormat, dilations, dimRoundingMode } = attrs; assertNotComplex([x, filter], "conv2d"); const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode, false, $dataFormat); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const dilationHeight = convInfo.dilationHeight; @@ -40108,10 +42275,10 @@ var conv2DConfig = { function conv2DBackpropFilter2(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, pad: pad3, dataFormat, dimRoundingMode, filterShape } = attrs; + const { strides, pad: pad32, dataFormat, dimRoundingMode, filterShape } = attrs; assertNotComplex([x, dy], "conv2dBackpropFilter"); const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, 1, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, 1, pad32, dimRoundingMode, false, $dataFormat); const { strideHeight, strideWidth, filterHeight, filterWidth } = convInfo; const isChannelsLast = convInfo.dataFormat === "channelsLast"; const dW = new TensorBuffer(convInfo.filterShape, "float32"); @@ -40158,12 +42325,12 @@ var conv2DBackpropFilterConfig = { function conv2DBackpropInput2(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { inputShape, strides, pad: pad3, dataFormat, dimRoundingMode } = attrs; + const { inputShape, strides, pad: pad32, dataFormat, dimRoundingMode } = attrs; assertNotComplex([dy, filter], "conv2dBackpropInput"); const filterStrides = util_exports.computeStrides(filter.shape); const dyStrides = util_exports.computeStrides(dy.shape); let $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad32, dimRoundingMode, false, $dataFormat); const dx = new TensorBuffer(convInfo.inShape, "float32"); const dxValues = dx.values; const dyValues = backend22.data.get(dy.dataId).values; @@ -40222,9 +42389,9 @@ var conv2DBackpropInputConfig = { function conv3D(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dilations } = attrs; + const { strides, pad: pad32, dilations } = attrs; assertNotComplex([x, filter], "conv3d"); - const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad3); + const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad32); const { filterDepth, filterHeight, filterWidth, dilationDepth, dilationHeight, dilationWidth, padInfo } = convInfo; const padFront = padInfo.front; const padLeft = padInfo.left; @@ -40293,11 +42460,11 @@ var conv3DConfig = { function conv3DBackpropFilterV2(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, pad: pad3, filterShape } = attrs; + const { strides, pad: pad32, filterShape } = attrs; assertNotComplex([x, dy], "conv3dBackpropFilterV2"); const xStrides = util_exports.computeStrides(x.shape); const dyStrides = util_exports.computeStrides(dy.shape); - const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filterShape, strides, 1, pad3); + const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filterShape, strides, 1, pad32); const strideDepth = convInfo.strideDepth; const strideHeight = convInfo.strideHeight; const strideWidth = convInfo.strideWidth; @@ -40366,11 +42533,11 @@ var conv3DBackpropFilterV2Config = { function conv3DBackpropInputV2(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { pad: pad3, strides, inputShape } = attrs; + const { pad: pad32, strides, inputShape } = attrs; assertNotComplex([dy], "conv3dBackpropInputV2"); const dyStrides = util_exports.computeStrides(dy.shape); const filterStrides = util_exports.computeStrides(filter.shape); - const convInfo = backend_util_exports.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad3); + const convInfo = backend_util_exports.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad32); const dx = new TensorBuffer(convInfo.inShape, "float32"); const dxValues = dx.values; const [dxS0, dxS1, dxS2, dxS3] = dx.strides; @@ -40536,7 +42703,7 @@ var cropAndResizeConfig = { function cumsum2(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { axis, exclusive, reverse: reverse5 } = attrs; + const { axis, exclusive, reverse: reverse52 } = attrs; assertNotComplex(x, "cumsum"); const permutation = backend_util_exports.getAxesPermutation([axis], x.shape.length); let $x = x; @@ -40551,7 +42718,7 @@ function cumsum2(args) { const vals = util_exports.makeZerosTypedArray(util_exports.sizeFromShape($x.shape), resultDtype); const aVals = backend22.data.get($x.dataId).values; const finalDim = $x.shape[$x.shape.length - 1]; - const indexAdjuster = reverse5 ? (i, j) => i + finalDim - j - 1 : (i, j) => i + j; + const indexAdjuster = reverse52 ? (i, j) => i + finalDim - j - 1 : (i, j) => i + j; for (let i = 0; i < aVals.length; i += finalDim) { for (let j = 0; j < finalDim; j++) { const idx = indexAdjuster(i, j); @@ -40642,7 +42809,7 @@ var depthToSpaceConfig = { function depthwiseConv2dNative(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dilations, dimRoundingMode } = attrs; + const { strides, pad: pad32, dilations, dimRoundingMode } = attrs; assertNotComplex([x, filter], "depthwiseConv2DNative"); const xStrides = util_exports.computeStrides(x.shape); const filterStrides = util_exports.computeStrides(filter.shape); @@ -40651,7 +42818,7 @@ function depthwiseConv2dNative(args) { $dilations = [1, 1]; } util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad32, dimRoundingMode, true); const { filterHeight, filterWidth, dilationHeight, dilationWidth, padInfo } = convInfo; const padLeft = padInfo.left; const padTop = padInfo.top; @@ -40708,9 +42875,9 @@ var depthwiseConv2dNativeConfig = { function depthwiseConv2dNativeBackpropFilter2(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, dilations, pad: pad3, dimRoundingMode, filterShape } = attrs; + const { strides, dilations, pad: pad32, dimRoundingMode, filterShape } = attrs; assertNotComplex([x, dy], "depthwiseConv2dNativeBackpropFilter"); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad32, dimRoundingMode, true); const { strideHeight, strideWidth, filterHeight, filterWidth } = convInfo; const dW = new TensorBuffer(convInfo.filterShape, "float32"); const leftPad = convInfo.padInfo.left; @@ -40753,11 +42920,11 @@ var depthwiseConv2dNativeBackpropFilterConfig = { function depthwiseConv2dNativeBackpropInput2(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { strides, dilations, pad: pad3, dimRoundingMode, inputShape } = attrs; + const { strides, dilations, pad: pad32, dimRoundingMode, inputShape } = attrs; assertNotComplex([dy, filter], "depthwiseConv2DNativeBackpropInput"); const dyStrides = util_exports.computeStrides(dy.shape); const filterStrides = util_exports.computeStrides(filter.shape); - const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad32, dimRoundingMode, true); const dx = new TensorBuffer(convInfo.inShape, "float32"); const dxValues = dx.values; const [dxS0, dxS1, dxS2] = dx.strides; @@ -40829,13 +42996,13 @@ var dilation2dConfig = { backendName: "cpu", kernelFunc: ({ inputs, backend: backend22, attrs }) => { const { x, filter } = inputs; - const { strides, pad: pad3, dilations } = attrs; + const { strides, pad: pad32, dilations } = attrs; const cpuBackend = backend22; const xVals = cpuBackend.data.get(x.dataId).values; const xRank = x.shape.length; const filterVals = cpuBackend.data.get(filter.dataId).values; const filterRank = filter.shape.length; - const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad3, "NHWC", dilations); + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad32, "NHWC", dilations); const outSize = util_exports.sizeFromShape(outShape); const outRank = outShape.length; const outputVals = util_exports.getArrayFromDType(x.dtype, outSize); @@ -40877,11 +43044,11 @@ var dilation2dBackpropFilterConfig = { backendName: "cpu", kernelFunc: ({ inputs, backend: backend22, attrs }) => { const { x, filter, dy } = inputs; - const { strides, pad: pad3, dilations } = attrs; + const { strides, pad: pad32, dilations } = attrs; const cpuBackend = backend22; const $x = util_exports.toNestedArray(x.shape, cpuBackend.data.get(x.dataId).values); const $filter = util_exports.toNestedArray(filter.shape, cpuBackend.data.get(filter.dataId).values); - const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad3, "NHWC", dilations); + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad32, "NHWC", dilations); util_exports.assert(dy.rank === outShape.length, () => `Error in ${Dilation2DBackpropFilter}, dy must have the same rank as output ${outShape.length}, but got ${dy.rank}`); const $dy = util_exports.toNestedArray(outShape, cpuBackend.data.get(dy.dataId).values); const gradients = util_exports.makeZerosNestedTypedArray(filter.shape, filter.dtype); @@ -40924,11 +43091,11 @@ var dilation2dBackpropInputConfig = { backendName: "cpu", kernelFunc: ({ inputs, backend: backend22, attrs }) => { const { x, filter, dy } = inputs; - const { strides, pad: pad3, dilations } = attrs; + const { strides, pad: pad32, dilations } = attrs; const cpuBackend = backend22; const $x = util_exports.toNestedArray(x.shape, cpuBackend.data.get(x.dataId).values); const $filter = util_exports.toNestedArray(filter.shape, cpuBackend.data.get(filter.dataId).values); - const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad3, "NHWC", dilations); + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad32, "NHWC", dilations); util_exports.assert(dy.rank === outShape.length, () => `Error in ${Dilation2DBackpropInput}, dy must have the same rank as output ${outShape.length}, but got ${dy.rank}`); const $dy = util_exports.toNestedArray(outShape, cpuBackend.data.get(dy.dataId).values); const gradients = util_exports.makeZerosNestedTypedArray(x.shape, x.dtype); @@ -40995,11 +43162,11 @@ function sum3(args) { const aVals = backend22.data.get(permutedX.dataId).values; for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let sum6 = 0; + let sum62 = 0; for (let j = 0; j < reduceSize; ++j) { - sum6 += aVals[offset + j]; + sum62 += aVals[offset + j]; } - vals[i] = sum6; + vals[i] = sum62; } if (keepDims) { const newShape = backend_util_exports.expandShapeToKeepDim(result.shape, axes); @@ -41111,10 +43278,10 @@ var a3 = backend_util_exports.ERF_A3; var a4 = backend_util_exports.ERF_A4; var a5 = backend_util_exports.ERF_A5; var erf2 = unaryKernelFunc(Erf, (xi) => { - const sign4 = Math.sign(xi); + const sign42 = Math.sign(xi); const v = Math.abs(xi); const t = 1 / (1 + p * v); - return sign4 * (1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-v * v)); + return sign42 * (1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-v * v)); }); var erfConfig = { kernelName: Erf, @@ -41123,17 +43290,17 @@ var erfConfig = { }; function expandDims3(args) { const { inputs, backend: backend22, attrs } = args; - const { input: input2 } = inputs; + const { input: input22 } = inputs; const { dim } = attrs; - const inputRank = input2.shape.length; - const newShape = input2.shape.slice(); + const inputRank = input22.shape.length; + const newShape = input22.shape.slice(); let $dim = dim; if (dim < 0) { util_exports.assert(-(inputRank + 1) <= dim, () => `Axis must be in the interval [${-(inputRank + 1)}, ${inputRank}]`); $dim = inputRank + dim + 1; } newShape.splice($dim, 0, 1); - return reshape3({ inputs: { x: input2 }, backend: backend22, attrs: { shape: newShape } }); + return reshape3({ inputs: { x: input22 }, backend: backend22, attrs: { shape: newShape } }); } var expandDimsConfig = { kernelName: ExpandDims, @@ -41147,11 +43314,11 @@ var realDivConfig = { backendName: "cpu", kernelFunc: div2 }; -function fftBatch(input2, inverse, cpuBackend) { - const inputShape = input2.shape; +function fftBatch(input22, inverse, cpuBackend) { + const inputShape = input22.shape; const batch = inputShape[0]; const innerDim = inputShape[1]; - const inputVals = cpuBackend.data.get(input2.dataId); + const inputVals = cpuBackend.data.get(input22.dataId); const real2D = inputVals.complexTensorInfos.real; const imag2D = inputVals.complexTensorInfos.imag; const resultShape = [batch, innerDim]; @@ -41170,8 +43337,8 @@ function fftBatch(input2, inverse, cpuBackend) { attrs: { begin: [b, 0], size: [1, innerDim] } }); const input3 = complex2({ inputs: { real: r, imag: i }, backend: cpuBackend }); - const { real: real4, imag: imag4 } = fftImpl(input3, inverse, cpuBackend); - const res = backend_util_exports.mergeRealAndImagArrays(real4, imag4); + const { real: real42, imag: imag42 } = fftImpl(input3, inverse, cpuBackend); + const res = backend_util_exports.mergeRealAndImagArrays(real42, imag42); for (let d = 0; d < innerDim; d++) { const c = backend_util_exports.getComplexWithIndex(res, d); resultReal[b * innerDim + d] = c.real; @@ -41188,14 +43355,14 @@ function fftBatch(input2, inverse, cpuBackend) { cpuBackend.disposeIntermediateTensorInfo($imagInfo); return result; } -function fftImpl(input2, inverse, cpuBackend) { - const inputSize8 = util_exports.sizeFromShape(input2.shape); - const inputVals = cpuBackend.data.get(input2.dataId); +function fftImpl(input22, inverse, cpuBackend) { + const inputSize8 = util_exports.sizeFromShape(input22.shape); + const inputVals = cpuBackend.data.get(input22.dataId); const realVals = cpuBackend.data.get(inputVals.complexTensorInfos.real.dataId).values; const imagVals = cpuBackend.data.get(inputVals.complexTensorInfos.imag.dataId).values; if (isExponentOf2(inputSize8)) { const result = fftRadix2(realVals, imagVals, inputSize8, inverse, cpuBackend); - const resultShape = [input2.shape[0], input2.shape[1]]; + const resultShape = [input22.shape[0], input22.shape[1]]; if (inverse) { const realInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.real); const imagInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.imag); @@ -41319,35 +43486,35 @@ function fftRadix2(realVals, imagVals, size2, inverse, cpuBackend) { function fourierTransformByMatmul(data, size2, inverse) { const ret = new Float32Array(size2 * 2); for (let r = 0; r < size2; r++) { - let real4 = 0; - let imag4 = 0; + let real42 = 0; + let imag42 = 0; for (let c = 0; c < size2; c++) { const e = backend_util_exports.exponent(r * c, size2, inverse); const term = backend_util_exports.getComplexWithIndex(data, c); - real4 += term.real * e.real - term.imag * e.imag; - imag4 += term.real * e.imag + term.imag * e.real; + real42 += term.real * e.real - term.imag * e.imag; + imag42 += term.real * e.imag + term.imag * e.real; } if (inverse) { - real4 /= size2; - imag4 /= size2; + real42 /= size2; + imag42 /= size2; } - backend_util_exports.assignToTypedArray(ret, real4, imag4, r); + backend_util_exports.assignToTypedArray(ret, real42, imag42, r); } return ret; } function fft2(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const inputSize8 = util_exports.sizeFromShape(input2.shape); - const innerDimensionSize = input2.shape[input2.shape.length - 1]; + const { input: input22 } = inputs; + const inputSize8 = util_exports.sizeFromShape(input22.shape); + const innerDimensionSize = input22.shape[input22.shape.length - 1]; const batch = inputSize8 / innerDimensionSize; const input2D = reshape3({ - inputs: { x: input2 }, + inputs: { x: input22 }, backend: backend22, attrs: { shape: [batch, innerDimensionSize] } }); const result = fftBatch(input2D, false, backend22); - const resultReshaped = reshape3({ inputs: { x: result }, backend: backend22, attrs: { shape: input2.shape } }); + const resultReshaped = reshape3({ inputs: { x: result }, backend: backend22, attrs: { shape: input22.shape } }); backend22.disposeIntermediateTensorInfo(input2D); backend22.disposeIntermediateTensorInfo(result); return resultReshaped; @@ -41420,11 +43587,11 @@ var floorDivConfig = { function fusedConv2D(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const { strides, pad: pad32, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; let result = conv2D({ inputs: { x, filter }, backend: backend22, - attrs: { strides, pad: pad3, dataFormat, dilations, dimRoundingMode } + attrs: { strides, pad: pad32, dataFormat, dilations, dimRoundingMode } }); if (bias) { const resultOld = result; @@ -41446,11 +43613,11 @@ var fusedConv2DConfig = { function fusedDepthwiseConv2D(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const { strides, pad: pad32, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; let result = depthwiseConv2dNative({ inputs: { x, filter }, backend: backend22, - attrs: { strides, pad: pad3, dataFormat, dilations, dimRoundingMode } + attrs: { strides, pad: pad32, dataFormat, dilations, dimRoundingMode } }); if (bias) { const oldResult = result; @@ -41538,17 +43705,17 @@ var gatherV2Config = { }; function ifft2(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const inputSize8 = util_exports.sizeFromShape(input2.shape); - const innerDimensionSize = input2.shape[input2.shape.length - 1]; + const { input: input22 } = inputs; + const inputSize8 = util_exports.sizeFromShape(input22.shape); + const innerDimensionSize = input22.shape[input22.shape.length - 1]; const batch = inputSize8 / innerDimensionSize; const input2D = reshape3({ - inputs: { x: input2 }, + inputs: { x: input22 }, backend: backend22, attrs: { shape: [batch, innerDimensionSize] } }); const result = fftBatch(input2D, true, backend22); - const resultReshaped = reshape3({ inputs: { x: result }, backend: backend22, attrs: { shape: input2.shape } }); + const resultReshaped = reshape3({ inputs: { x: result }, backend: backend22, attrs: { shape: input22.shape } }); backend22.disposeIntermediateTensorInfo(input2D); backend22.disposeIntermediateTensorInfo(result); return resultReshaped; @@ -41627,16 +43794,16 @@ function lRN(args) { const currentChannel = offset % channels; let beginSumOffset = offset - currentChannel + Math.max(0, currentChannel - depthRadius); const endSumOffset = offset - currentChannel + Math.min(currentChannel + depthRadius, maxD); - let sum6 = 0; + let sum62 = 0; for (; beginSumOffset <= endSumOffset; beginSumOffset++) { const z = xValues[beginSumOffset]; - sum6 += z * z; + sum62 += z * z; } - return sum6; + return sum62; } for (let offset = 0; offset < size2; offset++) { - const sum6 = sumAcrossChannels(offset); - const val = xValues[offset] * Math.pow(bias + alpha * sum6, -beta); + const sum62 = sumAcrossChannels(offset); + const val = xValues[offset] * Math.pow(bias + alpha * sum62, -beta); result[offset] = val; } return backend22.makeTensorInfo(x.shape, x.dtype, result); @@ -41662,15 +43829,15 @@ function lRNGrad(args) { const currentChannel = offset % channels; const depthBegin = offset - currentChannel + Math.max(0, currentChannel - depthRadius); const depthEnd = offset - currentChannel + Math.min(channels, currentChannel + depthRadius + 1); - let norm2 = 0; + let norm22 = 0; for (let k = depthBegin; k < depthEnd; k++) { - norm2 += Math.pow(xValues[k], 2); + norm22 += Math.pow(xValues[k], 2); } - norm2 = alpha * norm2 + bias; + norm22 = alpha * norm22 + bias; for (let k = depthBegin; k < depthEnd; k++) { - let dyi = -2 * alpha * beta * xValues[k] * yValues[offset] / norm2; + let dyi = -2 * alpha * beta * xValues[k] * yValues[offset] / norm22; if (offset === k) { - dyi += Math.pow(norm2, -beta); + dyi += Math.pow(norm22, -beta); } dyi *= dyValues[offset]; result[k] += dyi; @@ -41725,18 +43892,18 @@ function maxPool2(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; assertNotComplex(x, "maxPool"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = 1; util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); let res; if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports.arraysEqual(convInfo.inShape, convInfo.outShape)) { res = identity2({ inputs: { x }, backend: backend22 }); } else { const xValues = backend22.data.get(x.dataId).values; const strides2 = util_exports.computeStrides(x.shape); - const buffer2 = pool2(xValues, x.shape, x.dtype, strides2, convInfo, "max"); - res = backend22.makeTensorInfo(convInfo.outShape, x.dtype, buffer2.values); + const buffer22 = pool2(xValues, x.shape, x.dtype, strides2, convInfo, "max"); + res = backend22.makeTensorInfo(convInfo.outShape, x.dtype, buffer22.values); } return res; } @@ -41748,9 +43915,9 @@ var maxPoolConfig = { function maxPool3D(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { filterSize, strides, pad: pad3, dimRoundingMode, dataFormat } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode, dataFormat } = attrs; assertNotComplex(x, "maxPool3d"); - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode, dataFormat); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode, dataFormat); const xValues = backend22.data.get(x.dataId).values; const outBuf = pool3d2(xValues, x.shape, x.dtype, util_exports.computeStrides(x.shape), convInfo, "max"); return backend22.makeTensorInfo(outBuf.shape, "float32", outBuf.values); @@ -41762,11 +43929,11 @@ var maxPool3DConfig = { }; function maxPool3DGrad(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - assertNotComplex([dy, input2], "maxPool3DGrad"); - const convInfo = backend_util_exports.computePool3DInfo(input2.shape, filterSize, strides, 1, pad3, dimRoundingMode); - const inputBuf = backend22.bufferSync(input2); + const { dy, input: input22 } = inputs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + assertNotComplex([dy, input22], "maxPool3DGrad"); + const convInfo = backend_util_exports.computePool3DInfo(input22.shape, filterSize, strides, 1, pad32, dimRoundingMode); + const inputBuf = backend22.bufferSync(input22); const maxPosBuf = maxPool3dPositions(inputBuf, convInfo); const strideDepth = convInfo.strideDepth; const strideHeight = convInfo.strideHeight; @@ -41780,7 +43947,7 @@ function maxPool3DGrad(args) { const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; - const dx = buffer(input2.shape, "float32"); + const dx = buffer(input22.shape, "float32"); const dyBuf = backend22.bufferSync(dy); for (let batch = 0; batch < convInfo.batchSize; ++batch) { for (let channel = 0; channel < convInfo.inChannels; ++channel) { @@ -41832,11 +43999,11 @@ var maxPool3DGradConfig2 = { }; function maxPoolGrad2(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2, output } = inputs; - const x = input2; - assertNotComplex([input2, output], "maxPoolGrad"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode); + const { dy, input: input22, output } = inputs; + const x = input22; + assertNotComplex([input22, output], "maxPoolGrad"); + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode); const xValues = backend22.data.get(x.dataId).values; const maxPosBuf = buffer(convInfo.outShape, x.dtype, maxPoolPositions(xValues, x.shape, x.dtype, convInfo).values); const strideHeight = convInfo.strideHeight; @@ -41900,11 +44067,11 @@ var maxPoolWithArgmaxConfig = { backendName: "cpu", kernelFunc: ({ inputs, attrs, backend: backend22 }) => { const { x } = inputs; - const { filterSize, strides, pad: pad3, includeBatchInIndex } = attrs; + const { filterSize, strides, pad: pad32, includeBatchInIndex } = attrs; const cpuBackend = backend22; assertNotComplex(x, "MaxPoolWithArgmax"); const values = cpuBackend.data.get(x.dataId).values; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, [1, 1], pad3); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, [1, 1], pad32); const [pooled, indexes] = maxPoolWithArgmaxImpl(values, x.shape, x.dtype, includeBatchInIndex, convInfo); const pooledDataId = cpuBackend.write(pooled, convInfo.outShape, x.dtype); const indexesDataId = cpuBackend.write(indexes, convInfo.outShape, x.dtype); @@ -41958,14 +44125,14 @@ function min3(args) { const aVals = backend22.data.get($x.dataId).values; for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let min6 = aVals[offset]; + let min62 = aVals[offset]; for (let j = 0; j < reduceSize; ++j) { const value = aVals[offset + j]; - if (Number.isNaN(value) || value < min6) { - min6 = value; + if (Number.isNaN(value) || value < min62) { + min62 = value; } } - vals[i] = min6; + vals[i] = min62; } if (permutedAxes != null) { backend22.disposeIntermediateTensorInfo($x); @@ -41989,9 +44156,9 @@ function mirrorPad2(args) { const { x } = inputs; const { paddings, mode } = attrs; assertNotComplex(x, "mirrorPad"); - const outShape = paddings.map((p2, i) => p2[0] + x.shape[i] + p2[1]); - const start = paddings.map((p2) => p2[0]); - const end = paddings.map((p2, i) => p2[0] + x.shape[i]); + const outShape = paddings.map((p22, i) => p22[0] + x.shape[i] + p22[1]); + const start = paddings.map((p22) => p22[0]); + const end = paddings.map((p22, i) => p22[0] + x.shape[i]); const offset = mode === "reflect" ? 0 : 1; const xVals = backend22.data.get(x.dataId).values; const xRank = x.shape.length; @@ -42035,7 +44202,7 @@ var modConfig = { backendName: "cpu", kernelFunc: mod2 }; -var seedrandom4 = __toModule(require_seedrandom2()); +var seedrandom4 = __toModule2(require_seedrandom2()); function softmax3(args) { const { inputs, backend: backend22, attrs } = args; const { logits } = inputs; @@ -42276,8 +44443,8 @@ function padV2(args) { const { x } = inputs; const { paddings, constantValue } = attrs; assertNotComplex(x, "pad"); - const outShape = paddings.map((p2, i) => p2[0] + x.shape[i] + p2[1]); - const start = paddings.map((p2) => p2[0]); + const outShape = paddings.map((p22, i) => p22[0] + x.shape[i] + p22[1]); + const start = paddings.map((p22) => p22[0]); const xVals = backend22.data.get(x.dataId).values; const xSize = util_exports.sizeFromShape(x.shape); const xRank = x.shape.length; @@ -42312,8 +44479,8 @@ var powConfig = { }; function range3(args) { const { backend: backend22, attrs } = args; - const { start, stop, dtype, step: step5 } = attrs; - const values = rangeImpl(start, stop, step5, dtype); + const { start, stop, dtype, step: step52 } = attrs; + const values = rangeImpl(start, stop, step52, dtype); return backend22.makeTensorInfo([values.length], dtype, values); } var rangeConfig = { @@ -42677,11 +44844,11 @@ var roundConfig = { backendName: "cpu", kernelFunc: round3 }; -function scatterImpl(indices, updates, shape, outputSize3, sliceSize, numUpdates, sliceRank, strides, defaultValue, sumDupeIndices) { - const flattenShape = [outputSize3 / sliceSize, sliceSize]; +function scatterImpl(indices, updates, shape, outputSize2, sliceSize, numUpdates, sliceRank, strides, defaultValue, sumDupeIndices) { + const flattenShape = [outputSize2 / sliceSize, sliceSize]; const indicesData = indices.values; const updatesData = updates.values; - if (outputSize3 === 0) { + if (outputSize2 === 0) { return buffer(shape, updates.dtype); } const outBuf = buffer(flattenShape, updates.dtype); @@ -42694,7 +44861,7 @@ function scatterImpl(indices, updates, shape, outputSize3, sliceSize, numUpdates index.push(dim); flattenIndex += dim * strides[j]; } - if (flattenIndex < 0 || flattenIndex >= outputSize3 / sliceSize) { + if (flattenIndex < 0 || flattenIndex >= outputSize2 / sliceSize) { throw new Error(`Invalid indices: ${index} does not index into ${shape}`); } for (let k = 0; k < sliceSize; k++) { @@ -42711,11 +44878,11 @@ function scatterNd(args) { const { inputs, backend: backend22, attrs } = args; const { indices, updates } = inputs; const { shape } = attrs; - const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize3 } = backend_util_exports.calculateShapes(updates, indices, shape); + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports.calculateShapes(updates, indices, shape); const sumDupeIndices = true; const indicesBuf = backend22.bufferSync(indices); const updatesBuf = backend22.bufferSync(updates); - const outBuf = scatterImpl(indicesBuf, updatesBuf, shape, outputSize3, sliceSize, numUpdates, sliceRank, strides, 0, sumDupeIndices); + const outBuf = scatterImpl(indicesBuf, updatesBuf, shape, outputSize2, sliceSize, numUpdates, sliceRank, strides, 0, sumDupeIndices); return backend22.makeTensorInfo(shape, outBuf.dtype, outBuf.values); } var scatterNdConfig = { @@ -42817,7 +44984,7 @@ function spaceToBatchND2(args) { const { x } = inputs; const { blockShape, paddings } = attrs; assertNotComplex([x], "spaceToBatchND"); - const prod5 = util_exports.sizeFromShape(blockShape); + const prod52 = util_exports.sizeFromShape(blockShape); const completePaddings = [[0, 0]]; completePaddings.push(...paddings); for (let i = 1 + blockShape.length; i < x.shape.length; ++i) { @@ -42828,9 +44995,9 @@ function spaceToBatchND2(args) { backend: backend22, attrs: { paddings: completePaddings, constantValue: 0 } }); - const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod5, false); + const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod52, false); const permutedReshapedPaddedPermutation = backend_util_exports.getPermuted(reshapedPaddedShape.length, blockShape.length, false); - const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod5, false); + const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod52, false); const reshapeInputs = { x: paddedX }; const reshapeAttrs = { shape: reshapedPaddedShape }; const paddedXReshaped = reshape3({ inputs: reshapeInputs, backend: backend22, attrs: reshapeAttrs }); @@ -42968,12 +45135,12 @@ function sparseToDense2(args) { const { inputs, backend: backend22, attrs } = args; const { sparseIndices, sparseValues, defaultValue } = inputs; const { outputShape } = attrs; - const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize3 } = backend_util_exports.calculateShapes(sparseValues, sparseIndices, outputShape); + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports.calculateShapes(sparseValues, sparseIndices, outputShape); const sumDupeIndices = false; const indicesBuf = backend22.bufferSync(sparseIndices); const updatesBuf = backend22.bufferSync(sparseValues); const $defaultValue = backend22.data.get(defaultValue.dataId).values[0]; - const outBuf = scatterImpl(indicesBuf, updatesBuf, outputShape, outputSize3, sliceSize, numUpdates, sliceRank, strides, $defaultValue, sumDupeIndices); + const outBuf = scatterImpl(indicesBuf, updatesBuf, outputShape, outputSize2, sliceSize, numUpdates, sliceRank, strides, $defaultValue, sumDupeIndices); return backend22.makeTensorInfo(outputShape, outBuf.dtype, outBuf.values); } var sparseToDenseConfig = { @@ -43063,11 +45230,11 @@ var stridedSliceConfig = { }; function stringNGrams2(args) { const { inputs, backend: backend22, attrs } = args; - const { separator, nGramWidths, leftPad, rightPad: rightPad2, padWidth, preserveShortSequences } = attrs; + const { separator, nGramWidths, leftPad, rightPad: rightPad22, padWidth, preserveShortSequences } = attrs; const { data, dataSplits } = inputs; const $data = backend22.data.get(data.dataId).values; const $dataSplits = backend22.data.get(dataSplits.dataId).values; - const [nGrams, nGramsSplits] = stringNGramsImpl($data, $dataSplits, separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences); + const [nGrams, nGramsSplits] = stringNGramsImpl($data, $dataSplits, separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences); return [ backend22.makeTensorInfo([nGrams.length], "string", nGrams), backend22.makeTensorInfo(dataSplits.shape, "int32", nGramsSplits) @@ -43081,23 +45248,23 @@ var stringNGramsConfig = { function stringSplit2(args) { const { inputs, backend: backend22, attrs } = args; const { skipEmpty } = attrs; - const { input: input2, delimiter } = inputs; - if (input2.dtype !== "string") { + const { input: input22, delimiter } = inputs; + if (input22.dtype !== "string") { throw new Error("Input must be of datatype string"); } - if (input2.shape.length !== 1) { - throw new Error(`Input must be a vector, got shape: ${input2.shape}`); + if (input22.shape.length !== 1) { + throw new Error(`Input must be a vector, got shape: ${input22.shape}`); } if (delimiter.shape.length !== 0) { throw new Error(`Delimiter must be a scalar, got shape: ${delimiter.shape}`); } - const $input = backend22.data.get(input2.dataId).values; + const $input = backend22.data.get(input22.dataId).values; const $delimiter = backend22.data.get(delimiter.dataId).values[0]; const [indices, values, shape] = stringSplitImpl($input, $delimiter, skipEmpty); - const outputSize3 = values.length; + const outputSize2 = values.length; return [ - backend22.makeTensorInfo([outputSize3, 2], "int32", indices), - backend22.makeTensorInfo([outputSize3], "string", values), + backend22.makeTensorInfo([outputSize2, 2], "int32", indices), + backend22.makeTensorInfo([outputSize2], "string", values), backend22.makeTensorInfo([2], "int32", new Int32Array(shape)) ]; } @@ -43109,16 +45276,16 @@ var stringSplitConfig = { function stringToHashBucketFast2(args) { const { inputs, backend: backend22, attrs } = args; const { numBuckets } = attrs; - const { input: input2 } = inputs; - if (input2.dtype !== "string") { + const { input: input22 } = inputs; + if (input22.dtype !== "string") { throw new Error("Input must be of datatype string"); } if (numBuckets <= 0) { throw new Error(`Number of buckets must be at least 1`); } - const $input = backend22.data.get(input2.dataId).values; + const $input = backend22.data.get(input22.dataId).values; const output = stringToHashBucketFastImpl($input, numBuckets); - return backend22.makeTensorInfo(input2.shape, "int32", output); + return backend22.makeTensorInfo(input22.shape, "int32", output); } var stringToHashBucketFastConfig = { kernelName: StringToHashBucketFast, @@ -43183,17 +45350,17 @@ function transform2(args) { const imageVals = backend22.data.get(image32.dataId).values; const transformVals = backend22.data.get(transforms.dataId).values; for (let b = 0; b < batch; ++b) { - const transform5 = transforms.shape[0] === 1 ? transformVals : transformVals.subarray(b * 8, b * 8 + 8); + const transform52 = transforms.shape[0] === 1 ? transformVals : transformVals.subarray(b * 8, b * 8 + 8); for (let outY = 0; outY < outHeight; ++outY) { for (let outX = 0; outX < outWidth; ++outX) { for (let channel = 0; channel < numChannels; ++channel) { let val; - const projection = transform5[6] * outX + transform5[7] * outY + 1; + const projection = transform52[6] * outX + transform52[7] * outY + 1; if (projection === 0) { continue; } - const inX = (transform5[0] * outX + transform5[1] * outY + transform5[2]) / projection; - const inY = (transform5[3] * outX + transform5[4] * outY + transform5[5]) / projection; + const inX = (transform52[0] * outX + transform52[1] * outY + transform52[2]) / projection; + const inY = (transform52[3] * outX + transform52[4] * outY + transform52[5]) / projection; const x = mapCoord(inX, imageWidth, fillMode); const y = mapCoord(inY, imageHeight, fillMode); switch (interpolation) { @@ -43377,13 +45544,13 @@ function unsortedSegmentSum2(args) { const segmentId = backend22.makeTensorInfo([], "int32", scalarValue); const mask = equal2({ inputs: { a: segmentId, b: $segmentIds }, backend: backend22 }); const maskCasted = cast3({ inputs: { x: mask }, backend: backend22, attrs: { dtype: "float32" } }); - const mul2 = multiply2({ inputs: { a: maskCasted, b: x }, backend: backend22 }); - const sumTensorInfo = sum3({ inputs: { x: mul2 }, backend: backend22, attrs: { axis: 0, keepDims: false } }); + const mul22 = multiply2({ inputs: { a: maskCasted, b: x }, backend: backend22 }); + const sumTensorInfo = sum3({ inputs: { x: mul22 }, backend: backend22, attrs: { axis: 0, keepDims: false } }); res.push(sumTensorInfo); intermediates.push(segmentId); intermediates.push(mask); intermediates.push(maskCasted); - intermediates.push(mul2); + intermediates.push(mul22); intermediates.push(sumTensorInfo); } const result = pack({ inputs: res, backend: backend22, attrs: { axis: 0 } }); @@ -43671,24 +45838,24 @@ function getWebGLRenderingContext(webGLVersion) { return canvas3.getContext("webgl2", WEBGL_ATTRIBUTES); } var PackingScheme; -(function(PackingScheme2) { - PackingScheme2[PackingScheme2["DENSE"] = 0] = "DENSE"; - PackingScheme2[PackingScheme2["SHARED_BATCH"] = 1] = "SHARED_BATCH"; +(function(PackingScheme22) { + PackingScheme22[PackingScheme22["DENSE"] = 0] = "DENSE"; + PackingScheme22[PackingScheme22["SHARED_BATCH"] = 1] = "SHARED_BATCH"; })(PackingScheme || (PackingScheme = {})); var TextureUsage; -(function(TextureUsage2) { - TextureUsage2[TextureUsage2["RENDER"] = 0] = "RENDER"; - TextureUsage2[TextureUsage2["UPLOAD"] = 1] = "UPLOAD"; - TextureUsage2[TextureUsage2["PIXELS"] = 2] = "PIXELS"; - TextureUsage2[TextureUsage2["DOWNLOAD"] = 3] = "DOWNLOAD"; +(function(TextureUsage22) { + TextureUsage22[TextureUsage22["RENDER"] = 0] = "RENDER"; + TextureUsage22[TextureUsage22["UPLOAD"] = 1] = "UPLOAD"; + TextureUsage22[TextureUsage22["PIXELS"] = 2] = "PIXELS"; + TextureUsage22[TextureUsage22["DOWNLOAD"] = 3] = "DOWNLOAD"; })(TextureUsage || (TextureUsage = {})); var PhysicalTextureType; -(function(PhysicalTextureType2) { - PhysicalTextureType2[PhysicalTextureType2["UNPACKED_FLOAT16"] = 0] = "UNPACKED_FLOAT16"; - PhysicalTextureType2[PhysicalTextureType2["UNPACKED_FLOAT32"] = 1] = "UNPACKED_FLOAT32"; - PhysicalTextureType2[PhysicalTextureType2["PACKED_4X1_UNSIGNED_BYTE"] = 2] = "PACKED_4X1_UNSIGNED_BYTE"; - PhysicalTextureType2[PhysicalTextureType2["PACKED_2X2_FLOAT32"] = 3] = "PACKED_2X2_FLOAT32"; - PhysicalTextureType2[PhysicalTextureType2["PACKED_2X2_FLOAT16"] = 4] = "PACKED_2X2_FLOAT16"; +(function(PhysicalTextureType22) { + PhysicalTextureType22[PhysicalTextureType22["UNPACKED_FLOAT16"] = 0] = "UNPACKED_FLOAT16"; + PhysicalTextureType22[PhysicalTextureType22["UNPACKED_FLOAT32"] = 1] = "UNPACKED_FLOAT32"; + PhysicalTextureType22[PhysicalTextureType22["PACKED_4X1_UNSIGNED_BYTE"] = 2] = "PACKED_4X1_UNSIGNED_BYTE"; + PhysicalTextureType22[PhysicalTextureType22["PACKED_2X2_FLOAT32"] = 3] = "PACKED_2X2_FLOAT32"; + PhysicalTextureType22[PhysicalTextureType22["PACKED_2X2_FLOAT16"] = 4] = "PACKED_2X2_FLOAT16"; })(PhysicalTextureType || (PhysicalTextureType = {})); function getUnpackedMatrixTextureShapeWidthHeight(rows, columns) { return [columns, rows]; @@ -43758,8 +45925,8 @@ function getTextureConfig(gl, textureHalfFloatExtension) { textureTypeFloat }; } -function callAndCheck(gl, func2) { - const returnValue = func2(); +function callAndCheck(gl, func22) { + const returnValue = func22(); if (env().getBool("DEBUG")) { checkWebGLError(gl); } @@ -43832,8 +45999,8 @@ function logShaderSourceAndInfoLog(shaderSource, shaderInfoLog) { } const lineNumber = +lineNumberRegexResult[1]; const shaderLines = shaderSource.split("\n"); - const pad3 = shaderLines.length.toString().length + 2; - const linesWithLineNumbers = shaderLines.map((line, lineNumber2) => util_exports.rightPad((lineNumber2 + 1).toString(), pad3) + line); + const pad32 = shaderLines.length.toString().length + 2; + const linesWithLineNumbers = shaderLines.map((line, lineNumber2) => util_exports.rightPad((lineNumber2 + 1).toString(), pad32) + line); let maxLineLength = 0; for (let i = 0; i < linesWithLineNumbers.length; i++) { maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength); @@ -43864,16 +46031,16 @@ function validateProgram(gl, program) { } } function createStaticVertexBuffer(gl, data) { - const buffer2 = throwIfNull(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); - callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)); + const buffer22 = throwIfNull(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); + callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer22)); callAndCheck(gl, () => gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW)); - return buffer2; + return buffer22; } function createStaticIndexBuffer(gl, data) { - const buffer2 = throwIfNull(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); - callAndCheck(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer2)); + const buffer22 = throwIfNull(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); + callAndCheck(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer22)); callAndCheck(gl, () => gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW)); - return buffer2; + return buffer22; } function getNumChannels() { if (env().getNumber("WEBGL_VERSION") === 2) { @@ -43892,19 +46059,19 @@ function validateTextureSize(width, height) { } if (width > maxTextureSize || height > maxTextureSize) { const requested = `[${width}x${height}]`; - const max6 = `[${maxTextureSize}x${maxTextureSize}]`; - throw new Error("Requested texture size " + requested + " greater than WebGL maximum on this browser / GPU " + max6 + "."); + const max62 = `[${maxTextureSize}x${maxTextureSize}]`; + throw new Error("Requested texture size " + requested + " greater than WebGL maximum on this browser / GPU " + max62 + "."); } } function createFramebuffer(gl) { return throwIfNull(gl, () => gl.createFramebuffer(), "Unable to create WebGLFramebuffer."); } -function bindVertexBufferToProgramAttribute(gl, program, attribute, buffer2, arrayEntriesPerItem, itemStrideInBytes, itemOffsetInBytes) { +function bindVertexBufferToProgramAttribute(gl, program, attribute, buffer22, arrayEntriesPerItem, itemStrideInBytes, itemOffsetInBytes) { const loc = gl.getAttribLocation(program, attribute); if (loc === -1) { return false; } - callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)); + callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer22)); callAndCheck(gl, () => gl.vertexAttribPointer(loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes, itemOffsetInBytes)); callAndCheck(gl, () => gl.enableVertexAttribArray(loc)); return true; @@ -44201,11 +46368,11 @@ function isWebGLFenceEnabled(webGLVersion) { const isEnabled = gl.fenceSync != null; return isEnabled; } -function assertNotComplex2(tensor2, opName) { - if (!Array.isArray(tensor2)) { - tensor2 = [tensor2]; +function assertNotComplex2(tensor22, opName) { + if (!Array.isArray(tensor22)) { + tensor22 = [tensor22]; } - tensor2.forEach((t) => { + tensor22.forEach((t) => { if (t != null) { util_exports.assert(t.dtype !== "complex64", () => `${opName} does not support complex64 tensors in the WebGL backend.`); } @@ -44258,16 +46425,16 @@ ENV3.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM", () => { }); ENV3.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD", () => { return -1; -}, (threshold3) => { - if (threshold3 < 0 && threshold3 !== -1) { - throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${threshold3}.`); +}, (threshold32) => { + if (threshold32 < 0 && threshold32 !== -1) { + throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${threshold32}.`); } }); ENV3.registerFlag("WEBGL_FLUSH_THRESHOLD", () => { return device_util_exports.isMobile() && ENV3.getBool("IS_CHROME") ? 1 : -1; -}, (threshold3) => { - if (threshold3 < 0 && threshold3 !== -1) { - throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${threshold3}.`); +}, (threshold32) => { + if (threshold32 < 0 && threshold32 !== -1) { + throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${threshold32}.`); } }); ENV3.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD", () => 128); @@ -44275,7 +46442,7 @@ ENV3.registerFlag("WEBGL_USE_SHAPES_UNIFORMS", () => false); ENV3.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD", () => 1e5); ENV3.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD", () => 128); function getGlslDifferences() { - let version10; + let version102; let attribute; let varyingVs; let varyingFs; @@ -44286,7 +46453,7 @@ function getGlslDifferences() { let defineSpecialInf; let defineRound; if (env().getNumber("WEBGL_VERSION") === 2) { - version10 = "#version 300 es"; + version102 = "#version 300 es"; attribute = "in"; varyingVs = "out"; varyingFs = "in"; @@ -44317,7 +46484,7 @@ function getGlslDifferences() { } `; } else { - version10 = ""; + version102 = ""; attribute = "attribute"; varyingVs = "varying"; varyingFs = "varying"; @@ -44354,7 +46521,7 @@ function getGlslDifferences() { `; } return { - version: version10, + version: version102, attribute, varyingVs, varyingFs, @@ -46029,9 +48196,9 @@ function getUniformInfoFromShape(isPacked, shape, texShape) { const { newShape, keptDims } = util_exports.squeezeShape(shape); const rank = shape.length; const useSqueezePackedShape = isPacked && rank === 3 && shape[0] === 1; - const squeezeShape2 = useSqueezePackedShape ? shape.slice(1) : newShape; + const squeezeShape22 = useSqueezePackedShape ? shape.slice(1) : newShape; const useSqueezeShape = !isPacked && rank > 1 && !util_exports.arraysEqual(shape, texShape) && newShape.length < rank || useSqueezePackedShape; - const uniformShape = useSqueezeShape ? squeezeShape2 : shape; + const uniformShape = useSqueezeShape ? squeezeShape22 : shape; return { useSqueezeShape, uniformShape, keptDims }; } function squeezeInputInfo(inInfo, squeezedShape) { @@ -46043,16 +48210,16 @@ function getSqueezedParams(params, keptDims) { return keptDims.map((d) => params[d]).join(", "); } function compileProgram(gpgpu, program, inputs, output) { - const inputInfos = inputs.map((input2, i) => { + const inputInfos = inputs.map((input22, i) => { const shapeInfo = { - logicalShape: input2.shape, - texShape: input2.isUniform ? null : input2.texData.texShape, - isUniform: input2.isUniform, - isPacked: input2.isUniform ? false : input2.texData.isPacked, + logicalShape: input22.shape, + texShape: input22.isUniform ? null : input22.texData.texShape, + isUniform: input22.isUniform, + isPacked: input22.isUniform ? false : input22.texData.isPacked, flatOffset: null }; - if (input2.texData != null && input2.texData.slice != null && input2.texData.slice.flatOffset > 0) { - shapeInfo.flatOffset = input2.texData.slice.flatOffset; + if (input22.texData != null && input22.texData.slice != null && input22.texData.slice.flatOffset > 0) { + shapeInfo.flatOffset = input22.texData.slice.flatOffset; } return { name: program.variableNames[i], shapeInfo }; }); @@ -46121,16 +48288,16 @@ function validateBinaryAndProgram(shapeInfos, inputs) { } shapeInfos.forEach((s, i) => { const shapeA = s.logicalShape; - const input2 = inputs[i]; - const shapeB = input2.shape; + const input22 = inputs[i]; + const shapeB = input22.shape; if (!util_exports.arraysEqual(shapeA, shapeB)) { throw Error(`Binary was compiled with different shapes than the current args. Shapes ${shapeA} and ${shapeB} must match`); } - if (s.isUniform && input2.isUniform) { + if (s.isUniform && input22.isUniform) { return; } const texShapeA = s.texShape; - const texShapeB = input2.isUniform ? null : input2.texData.texShape; + const texShapeB = input22.isUniform ? null : input22.texData.texShape; if (!util_exports.arraysEqual(texShapeA, texShapeB)) { throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${texShapeA} and ${texShapeB} must match`); } @@ -46157,14 +48324,14 @@ function runProgram(gpgpu, binary, inputs, output, customUniformValues) { if (binary.nanLoc !== null) { gpgpu.gl.uniform1f(binary.nanLoc, NaN); } - inputs.forEach((input2, i) => { + inputs.forEach((input22, i) => { const varName = binary.program.variableNames[i]; const varLoc = binary.uniformLocations[varName]; const varOffsetLoc = binary.uniformLocations[`offset${varName}`]; const varShapeLoc = binary.inShapesLocations[`${varName}Shape`]; const varTexShapeLoc = binary.inTexShapesLocations[`${varName}TexShape`]; if (varShapeLoc) { - const { uniformShape } = getUniformInfoFromShape(binary.program.packedInputs, input2.shape, input2.texData.texShape); + const { uniformShape } = getUniformInfoFromShape(binary.program.packedInputs, input22.shape, input22.texData.texShape); switch (uniformShape.length) { case 1: gpgpu.gl.uniform1iv(varShapeLoc, new Int32Array(uniformShape)); @@ -46183,16 +48350,16 @@ function runProgram(gpgpu, binary, inputs, output, customUniformValues) { } } if (varTexShapeLoc) { - gpgpu.gl.uniform2i(varTexShapeLoc, input2.texData.texShape[0], input2.texData.texShape[1]); + gpgpu.gl.uniform2i(varTexShapeLoc, input22.texData.texShape[0], input22.texData.texShape[1]); } if (varLoc == null) { return; } - if (input2.isUniform) { - if (util_exports.sizeFromShape(input2.shape) < 2) { - gpgpu.gl.uniform1f(varLoc, input2.uniformValues[0]); + if (input22.isUniform) { + if (util_exports.sizeFromShape(input22.shape) < 2) { + gpgpu.gl.uniform1f(varLoc, input22.uniformValues[0]); } else { - let vals = input2.uniformValues; + let vals = input22.uniformValues; if (!(vals instanceof Float32Array)) { vals = new Float32Array(vals); } @@ -46200,10 +48367,10 @@ function runProgram(gpgpu, binary, inputs, output, customUniformValues) { } return; } - if (input2.texData.slice != null && varOffsetLoc != null) { - gpgpu.gl.uniform1i(varOffsetLoc, input2.texData.slice.flatOffset); + if (input22.texData.slice != null && varOffsetLoc != null) { + gpgpu.gl.uniform1i(varOffsetLoc, input22.texData.slice.flatOffset); } - gpgpu.setInputMatrixTexture(input2.texData.texture, varLoc, i); + gpgpu.setInputMatrixTexture(input22.texData.texture, varLoc, i); }); const outShapeLoc = binary.outShapeLocation; if (outShapeLoc) { @@ -46647,20 +48814,20 @@ function uploadPixelDataToTexture(gl, texture, pixels) { callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null)); } function createBufferFromOutputTexture(gl2, rows, columns, textureConfig) { - const buffer2 = gl2.createBuffer(); - callAndCheck(gl2, () => gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer2)); + const buffer22 = gl2.createBuffer(); + callAndCheck(gl2, () => gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer22)); const bytesPerFloat = 4; const valuesPerTexel = 4; const bufferSizeBytes = bytesPerFloat * valuesPerTexel * rows * columns; callAndCheck(gl2, () => gl2.bufferData(gl2.PIXEL_PACK_BUFFER, bufferSizeBytes, gl2.STREAM_READ)); callAndCheck(gl2, () => gl2.readPixels(0, 0, columns, rows, gl2.RGBA, gl2.FLOAT, 0)); callAndCheck(gl2, () => gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null)); - return buffer2; + return buffer22; } -function downloadFloat32MatrixFromBuffer(gl, buffer2, size2) { +function downloadFloat32MatrixFromBuffer(gl, buffer22, size2) { const gl2 = gl; const downloadTarget = new Float32Array(size2); - gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer2); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer22); gl2.getBufferSubData(gl2.PIXEL_PACK_BUFFER, 0, downloadTarget); gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null); return downloadTarget; @@ -46672,10 +48839,10 @@ function downloadByteEncodedFloatMatrixFromOutputTexture(gl, rows, columns, text callAndCheck(gl, () => gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE, downloadTarget)); return new Float32Array(downloadTarget.buffer); } -function downloadPackedMatrixFromBuffer(gl, buffer2, batch, rows, cols, physicalRows, physicalCols, textureConfig) { +function downloadPackedMatrixFromBuffer(gl, buffer22, batch, rows, cols, physicalRows, physicalCols, textureConfig) { const gl2 = gl; const downloadTarget = new Float32Array(getPackedRGBAArraySizeFromMatrixShape(physicalRows, physicalCols)); - gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer2); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer22); gl2.getBufferSubData(gl2.PIXEL_PACK_BUFFER, 0, downloadTarget); gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null); return downloadTarget; @@ -46792,11 +48959,11 @@ var GPGPUContext = class { downloadByteEncodedFloatMatrixFromOutputTexture(texture, rows, columns) { return this.downloadMatrixDriver(texture, () => downloadByteEncodedFloatMatrixFromOutputTexture(this.gl, rows, columns, this.textureConfig)); } - downloadPackedMatrixFromBuffer(buffer2, batch, rows, columns, physicalRows, physicalCols) { - return downloadPackedMatrixFromBuffer(this.gl, buffer2, batch, rows, columns, physicalRows, physicalCols, this.textureConfig); + downloadPackedMatrixFromBuffer(buffer22, batch, rows, columns, physicalRows, physicalCols) { + return downloadPackedMatrixFromBuffer(this.gl, buffer22, batch, rows, columns, physicalRows, physicalCols, this.textureConfig); } - downloadFloat32MatrixFromBuffer(buffer2, size2) { - return downloadFloat32MatrixFromBuffer(this.gl, buffer2, size2); + downloadFloat32MatrixFromBuffer(buffer22, size2) { + return downloadFloat32MatrixFromBuffer(this.gl, buffer22, size2); } createBufferFromTexture(texture, rows, columns) { this.bindTextureToFrameBuffer(texture); @@ -47395,8 +49562,8 @@ function computeBytes(shape, physicalTexType, gl, textureConfig, isPacked) { const [width, height] = getUnpackedMatrixTextureShapeWidthHeight(shape[0], shape[1]); numElements = width * height; } - const bytesPerElement2 = numBytesForInternalFormat(gl, internalFormat); - return numElements * bytesPerElement2; + const bytesPerElement22 = numBytesForInternalFormat(gl, internalFormat); + return numElements * bytesPerElement22; } function internalFormatForPhysicalTexType(physicalTexType, textureConfig) { switch (physicalTexType) { @@ -47646,8 +49813,8 @@ var MathBackendWebGL = class extends KernelBackend { } readSync(dataId) { const texData = this.texData.get(dataId); - const { values, dtype, complexTensorInfos, slice: slice5, shape, isPacked } = texData; - if (slice5 != null) { + const { values, dtype, complexTensorInfos, slice: slice52, shape, isPacked } = texData; + if (slice52 != null) { let program; if (isPacked) { program = new UnaryOpPackedProgram(shape, CLONE); @@ -47689,8 +49856,8 @@ var MathBackendWebGL = class extends KernelBackend { return new Promise((resolve) => subscribers2.push(resolve)); } const texData = this.texData.get(dataId); - const { values, shape, slice: slice5, dtype, complexTensorInfos, isPacked } = texData; - if (slice5 != null) { + const { values, shape, slice: slice52, dtype, complexTensorInfos, isPacked } = texData; + if (slice52 != null) { let program; if (isPacked) { program = new UnaryOpPackedProgram(shape, CLONE); @@ -47708,12 +49875,12 @@ var MathBackendWebGL = class extends KernelBackend { if (!env().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED") && env().getNumber("WEBGL_VERSION") === 2) { throw new Error(`tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.`); } - let buffer2 = null; + let buffer22 = null; let tmpDownloadTarget; if (dtype !== "complex64" && env().get("WEBGL_BUFFER_SUPPORTED")) { tmpDownloadTarget = this.decode(dataId); const tmpData = this.texData.get(tmpDownloadTarget.dataId); - buffer2 = this.gpgpu.createBufferFromTexture(tmpData.texture, ...getDenseTexShape(shape)); + buffer22 = this.gpgpu.createBufferFromTexture(tmpData.texture, ...getDenseTexShape(shape)); } this.pendingRead.set(dataId, []); if (dtype !== "complex64") { @@ -47728,18 +49895,18 @@ var MathBackendWebGL = class extends KernelBackend { const realValues = ps[0]; const imagValues = ps[1]; vals = backend_util_exports.mergeRealAndImagArrays(realValues, imagValues); - } else if (buffer2 == null) { + } else if (buffer22 == null) { vals = this.getValuesFromTexture(dataId); } else { const size2 = util_exports.sizeFromShape(shape); - vals = this.gpgpu.downloadFloat32MatrixFromBuffer(buffer2, size2); + vals = this.gpgpu.downloadFloat32MatrixFromBuffer(buffer22, size2); } if (tmpDownloadTarget != null) { this.disposeIntermediateTensorInfo(tmpDownloadTarget); } - if (buffer2 != null) { + if (buffer22 != null) { const gl = this.gpgpu.gl; - callAndCheck(gl, () => gl.deleteBuffer(buffer2)); + callAndCheck(gl, () => gl.deleteBuffer(buffer22)); } const dTypeVals = this.convertAndCacheOnCPU(dataId, vals); const subscribers = this.pendingRead.get(dataId); @@ -47898,8 +50065,8 @@ var MathBackendWebGL = class extends KernelBackend { return true; } releaseGPUData(dataId) { - const { texture, dtype, texShape, usage, isPacked, slice: slice5 } = this.texData.get(dataId); - const key = slice5 && slice5.origDataId || dataId; + const { texture, dtype, texShape, usage, isPacked, slice: slice52 } = this.texData.get(dataId); + const key = slice52 && slice52.origDataId || dataId; const refCount = this.dataRefCount.get(key); if (refCount > 1) { this.dataRefCount.set(key, refCount - 1); @@ -47924,7 +50091,7 @@ var MathBackendWebGL = class extends KernelBackend { return this.texData.get(dataId); } shouldExecuteOnCPU(inputs, sizeThreshold = CPU_HANDOFF_SIZE_THRESHOLD) { - return env().getBool("WEBGL_CPU_FORWARD") && inputs.every((input2) => this.texData.get(input2.dataId).texture == null && util_exports.sizeFromShape(input2.shape) < sizeThreshold); + return env().getBool("WEBGL_CPU_FORWARD") && inputs.every((input22) => this.texData.get(input22.dataId).texture == null && util_exports.sizeFromShape(input22.shape) < sizeThreshold); } getGPGPUContext() { return this.gpgpu; @@ -47934,8 +50101,8 @@ var MathBackendWebGL = class extends KernelBackend { const condVals = condition.dataSync(); return whereImpl3(condition.shape, condVals); } - packedUnaryOp(x, op2, dtype) { - const program = new UnaryOpPackedProgram(x.shape, op2); + packedUnaryOp(x, op22, dtype) { + const program = new UnaryOpPackedProgram(x.shape, op22); const outInfo = this.compileAndRun(program, [x], dtype); return engine().makeTensorFromDataId(outInfo.dataId, outInfo.shape, outInfo.dtype); } @@ -47966,24 +50133,24 @@ var MathBackendWebGL = class extends KernelBackend { const { dataId } = this.makeTensorInfo(shape, dtype, values); return engine().makeTensorFromDataId(dataId, shape, dtype, this); } - unpackTensor(input2) { - const program = new UnpackProgram(input2.shape); - return this.runWebGLProgram(program, [input2], input2.dtype); + unpackTensor(input22) { + const program = new UnpackProgram(input22.shape); + return this.runWebGLProgram(program, [input22], input22.dtype); } - packTensor(input2) { - const program = new PackProgram(input2.shape); + packTensor(input22) { + const program = new PackProgram(input22.shape); const preventEagerUnpackingOutput = true; - return this.runWebGLProgram(program, [input2], input2.dtype, null, preventEagerUnpackingOutput); + return this.runWebGLProgram(program, [input22], input22.dtype, null, preventEagerUnpackingOutput); } - packedReshape(input2, afterShape) { + packedReshape(input22, afterShape) { const input3DShape = [ - getBatchDim(input2.shape), - ...getRowsCols(input2.shape) + getBatchDim(input22.shape), + ...getRowsCols(input22.shape) ]; const input3D = { - dtype: input2.dtype, + dtype: input22.dtype, shape: input3DShape, - dataId: input2.dataId + dataId: input22.dataId }; const afterShapeAs3D = [ getBatchDim(afterShape), @@ -47992,7 +50159,7 @@ var MathBackendWebGL = class extends KernelBackend { const program = new ReshapePackedProgram(afterShapeAs3D, input3DShape); const preventEagerUnpackingOfOutput = true; const customValues = [input3DShape]; - const output = this.runWebGLProgram(program, [input3D], input2.dtype, customValues, preventEagerUnpackingOfOutput); + const output = this.runWebGLProgram(program, [input3D], input22.dtype, customValues, preventEagerUnpackingOfOutput); return { dataId: output.dataId, shape: afterShape, dtype: output.dtype }; } decode(dataId) { @@ -48029,15 +50196,15 @@ var MathBackendWebGL = class extends KernelBackend { return output; } const dataToDispose = []; - const inputsData = inputs.map((input2) => { - if (input2.dtype === "complex64") { + const inputsData = inputs.map((input22) => { + if (input22.dtype === "complex64") { throw new Error(`GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.`); } - let texData = this.texData.get(input2.dataId); + let texData = this.texData.get(input22.dataId); if (texData.texture == null) { - if (!program.packedInputs && util_exports.sizeFromShape(input2.shape) <= env().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM")) { + if (!program.packedInputs && util_exports.sizeFromShape(input22.shape) <= env().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM")) { return { - shape: input2.shape, + shape: input22.shape, texData: null, isUniform: true, uniformValues: texData.values @@ -48045,23 +50212,23 @@ var MathBackendWebGL = class extends KernelBackend { } if (program.packedInputs) { texData.isPacked = true; - texData.shape = input2.shape; + texData.shape = input22.shape; } } else if (!!texData.isPacked !== !!program.packedInputs) { - input2 = texData.isPacked ? this.unpackTensor(input2) : this.packTensor(input2); - dataToDispose.push(input2); - texData = this.texData.get(input2.dataId); - } else if (texData.isPacked && !isReshapeFree(texData.shape, input2.shape)) { - const savedInput = input2; - const targetShape = input2.shape; - input2.shape = texData.shape; - input2 = this.packedReshape(input2, targetShape); - dataToDispose.push(input2); - texData = this.texData.get(input2.dataId); + input22 = texData.isPacked ? this.unpackTensor(input22) : this.packTensor(input22); + dataToDispose.push(input22); + texData = this.texData.get(input22.dataId); + } else if (texData.isPacked && !isReshapeFree(texData.shape, input22.shape)) { + const savedInput = input22; + const targetShape = input22.shape; + input22.shape = texData.shape; + input22 = this.packedReshape(input22, targetShape); + dataToDispose.push(input22); + texData = this.texData.get(input22.dataId); savedInput.shape = targetShape; } - this.uploadToGPU(input2.dataId); - return { shape: input2.shape, texData, isUniform: false }; + this.uploadToGPU(input22.dataId); + return { shape: input22.shape, texData, isUniform: false }; }); this.uploadToGPU(output.dataId); const outputData = { shape: output.shape, texData: outData, isUniform: false }; @@ -48254,13 +50421,13 @@ var CHECK_NAN_SNIPPET2 = ` if (isnan(b)) return b; `; var BinaryOpProgram = class { - constructor(op2, aShape, bShape) { + constructor(op22, aShape, bShape) { this.variableNames = ["A", "B"]; this.outputShape = backend_util_exports.assertAndGetBroadcastShape(aShape, bShape); this.enableShapeUniforms = useShapeUniforms(this.outputShape.length); this.userCode = ` float binaryOperation(float a, float b) { - ${op2} + ${op22} } void main() { @@ -48278,7 +50445,7 @@ var CHECK_NAN_SNIPPET3 = ` result.a = isNaN.a > 0. ? NAN : result.a; `; var BinaryOpPackedProgram = class { - constructor(op2, aShape, bShape, checkOutOfBounds = false) { + constructor(op22, aShape, bShape, checkOutOfBounds = false) { this.variableNames = ["A", "B"]; this.supportsBroadcasting = true; this.packedInputs = true; @@ -48341,7 +50508,7 @@ var BinaryOpPackedProgram = class { } this.userCode = ` vec4 binaryOperation(vec4 a, vec4 b) { - ${op2} + ${op22} } void main() { @@ -48369,12 +50536,12 @@ var identityConfig2 = { }; function complex3(args) { const { inputs, backend: backend22 } = args; - const { real: real4, imag: imag4 } = inputs; - const complexInfo = backend22.makeTensorInfo(real4.shape, "complex64"); - const complex4 = backend22.texData.get(complexInfo.dataId); - const realTensorInfo = identity3({ inputs: { x: real4 }, backend: backend22 }); - const imagTensorInfo = identity3({ inputs: { x: imag4 }, backend: backend22 }); - complex4.complexTensorInfos = { real: realTensorInfo, imag: imagTensorInfo }; + const { real: real42, imag: imag42 } = inputs; + const complexInfo = backend22.makeTensorInfo(real42.shape, "complex64"); + const complex42 = backend22.texData.get(complexInfo.dataId); + const realTensorInfo = identity3({ inputs: { x: real42 }, backend: backend22 }); + const imagTensorInfo = identity3({ inputs: { x: imag42 }, backend: backend22 }); + complex42.complexTensorInfos = { real: realTensorInfo, imag: imagTensorInfo }; return complexInfo; } var complexConfig2 = { @@ -48456,7 +50623,7 @@ function binaryKernelFunc2({ opSnippet, packedOpSnippet, checkOutOfBounds = fals if (supportsComplex && a.dtype === "complex64") { const aData = webglBackend.texData.get(a.dataId); const bData = webglBackend.texData.get(b.dataId); - const [real4, imag4] = [ + const [real42, imag42] = [ [aData.complexTensorInfos.real, bData.complexTensorInfos.real], [aData.complexTensorInfos.imag, bData.complexTensorInfos.imag] ].map((complexParts) => { @@ -48474,9 +50641,9 @@ function binaryKernelFunc2({ opSnippet, packedOpSnippet, checkOutOfBounds = fals const program2 = new BinaryOpProgram(opSnippet, a.shape, b.shape); return webglBackend.runWebGLProgram(program2, [aHandle, bHandle], upcastType(aPart.dtype, bPart.dtype)); }); - const complexOutput = complex3({ inputs: { real: real4, imag: imag4 }, backend: webglBackend }); - webglBackend.disposeIntermediateTensorInfo(real4); - webglBackend.disposeIntermediateTensorInfo(imag4); + const complexOutput = complex3({ inputs: { real: real42, imag: imag42 }, backend: webglBackend }); + webglBackend.disposeIntermediateTensorInfo(real42); + webglBackend.disposeIntermediateTensorInfo(imag42); return complexOutput; } const $dtype = dtype || upcastType(a.dtype, b.dtype); @@ -48628,13 +50795,13 @@ var COMPLEX_MULTIPLY = { IMAG: "return areal * bimag + aimag * breal;" }; var BinaryOpComplexProgram = class { - constructor(op2, aShape, bShape) { + constructor(op22, aShape, bShape) { this.variableNames = ["AReal", "AImag", "BReal", "BImag"]; this.outputShape = backend_util_exports.assertAndGetBroadcastShape(aShape, bShape); this.userCode = ` float binaryOpComplex( float areal, float aimag, float breal, float bimag) { - ${op2} + ${op22} } void main() { @@ -48708,15 +50875,15 @@ var multiplyConfig2 = { backendName: "webgl", kernelFunc: multiply3 }; -function packedReshape(input2, afterShape, backend22) { +function packedReshape(input22, afterShape, backend22) { const input3DShape = [ - getBatchDim(input2.shape), - ...getRowsCols(input2.shape) + getBatchDim(input22.shape), + ...getRowsCols(input22.shape) ]; const input3D = { - dtype: input2.dtype, + dtype: input22.dtype, shape: input3DShape, - dataId: input2.dataId + dataId: input22.dataId }; const afterShapeAs3D = [ getBatchDim(afterShape), @@ -48725,7 +50892,7 @@ function packedReshape(input2, afterShape, backend22) { const program = new ReshapePackedProgram(afterShapeAs3D, input3DShape); const preventEagerUnpackingOfOutput = true; const customValues = [input3DShape]; - const output = backend22.runWebGLProgram(program, [input3D], input2.dtype, customValues, preventEagerUnpackingOfOutput); + const output = backend22.runWebGLProgram(program, [input3D], input22.dtype, customValues, preventEagerUnpackingOfOutput); return { dataId: output.dataId, shape: afterShape, dtype: output.dtype }; } function reshape4(args) { @@ -49312,11 +51479,11 @@ var AddNProgram = class { this.outputShape = outputShape; this.variableNames = shapes.map((_, i) => `T${i}`); const snippets = []; - this.variableNames.forEach((variable2) => { - snippets.push(`float v${variable2} = get${variable2}AtOutCoords();`); + this.variableNames.forEach((variable22) => { + snippets.push(`float v${variable22} = get${variable22}AtOutCoords();`); }); - const operation = this.variableNames.map((variable2) => { - return `v${variable2}`; + const operation = this.variableNames.map((variable22) => { + return `v${variable22}`; }).join(" + "); this.userCode = ` void main() { @@ -49336,11 +51503,11 @@ var AddNPackedProgram = class { this.outputShape = outputShape; this.variableNames = shapes.map((_, i) => `T${i}`); const snippets = []; - this.variableNames.forEach((variable2) => { - snippets.push(`vec4 v${variable2} = get${variable2}AtOutCoords();`); + this.variableNames.forEach((variable22) => { + snippets.push(`vec4 v${variable22} = get${variable22}AtOutCoords();`); }); - const operation = this.variableNames.map((variable2) => { - return `v${variable2}`; + const operation = this.variableNames.map((variable22) => { + return `v${variable22}`; }).join(" + "); this.userCode = ` void main() { @@ -49450,14 +51617,14 @@ var anyConfig2 = { kernelFunc: any3 }; var ArgMinMaxProgram = class { - constructor(reduceInfo, op2, firstPass) { + constructor(reduceInfo, op22, firstPass) { this.variableNames = ["A"]; const { windowSize, batchSize, outSize } = reduceInfo; if (!firstPass) { this.variableNames.push("bestIndicesA"); } this.outputShape = [batchSize, outSize]; - const compOp = op2 === "max" ? ">" : "<"; + const compOp = op22 === "max" ? ">" : "<"; const indexSnippet = firstPass ? "inOffset + i;" : "round(getBestIndicesA(batch, inOffset + i));"; this.userCode = ` void main() { @@ -49483,11 +51650,11 @@ var ArgMinMaxProgram = class { } }; var ArgMinMaxPackedProgram = class { - constructor(shape, windowSize, op2, firstPass) { + constructor(shape, windowSize, op22, firstPass) { this.variableNames = ["A"]; this.packedInputs = true; this.packedOutput = true; - util_exports.assert(shape.length > 2, () => `Packed arg${op2.charAt(0).toUpperCase() + op2.slice(1)} supports only inputs with rank above 2.`); + util_exports.assert(shape.length > 2, () => `Packed arg${op22.charAt(0).toUpperCase() + op22.slice(1)} supports only inputs with rank above 2.`); const inSize = shape[shape.length - 1]; const outSize = Math.ceil(inSize / windowSize); this.outputShape = shape.slice(0, -1); @@ -49534,7 +51701,7 @@ var ArgMinMaxPackedProgram = class { const srcGCoords = getChannels("sourceLocG", sourceRank - 1).concat("inIdx.g"); const srcBCoords = getChannels("sourceLocB", sourceRank - 1).concat("inIdx.b"); const srcACoords = getChannels("sourceLocA", sourceRank - 1).concat("inIdx.a"); - const compOp = op2 === "max" ? "greaterThan" : "lessThan"; + const compOp = op22 === "max" ? "greaterThan" : "lessThan"; const fetchCandidateIdx = firstPass ? "" : ` inIdx = round(vec4(getBestIndicesAChannel(${srcRCoords.join()}), getBestIndicesAChannel(${srcGCoords.join()}), @@ -50133,10 +52300,10 @@ function avgPool3(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; assertNotComplex2(x, "avgPool"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = 1; util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports.arraysEqual(convInfo.inShape, convInfo.outShape)) { return identity3({ inputs: { x }, backend: backend22 }); } @@ -50151,9 +52318,9 @@ var avgPoolConfig2 = { function avgPool3D2(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { filterSize, strides, pad: pad3, dimRoundingMode, dataFormat } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode, dataFormat } = attrs; const dilations = [1, 1, 1]; - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode, dataFormat); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode, dataFormat); const avgPoolProgram = new Pool3DProgram(convInfo, "avg", false); return backend22.runWebGLProgram(avgPoolProgram, [x], "float32"); } @@ -50303,11 +52470,11 @@ var AvgPool3DBackpropProgram = class { }; function avgPool3DGrad2(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const x = input2; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { dy, input: input22 } = inputs; + const x = input22; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = [1, 1, 1]; - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); const avgPoolBackpropProgram = new AvgPool3DBackpropProgram(convInfo); return backend22.runWebGLProgram(avgPoolBackpropProgram, [dy], x.dtype); } @@ -50318,11 +52485,11 @@ var avgPoolGrad3DConfig = { }; function avgPoolGrad3(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const x = input2; - assertNotComplex2([dy, input2], "avgPoolGrad"); - const { filterSize, strides, pad: pad3 } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3); + const { dy, input: input22 } = inputs; + const x = input22; + assertNotComplex2([dy, input22], "avgPoolGrad"); + const { filterSize, strides, pad: pad32 } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32); const avgPoolBackpropProgram = new AvgPool2DBackpropProgram(convInfo); return backend22.runWebGLProgram(avgPoolBackpropProgram, [dy], x.dtype); } @@ -50411,15 +52578,15 @@ var BatchNormPackedProgram = class { } }; var batchNorm3 = ({ inputs, backend: backend22, attrs }) => { - const { x, mean: mean4, variance, offset, scale: scale22 } = inputs; - util_exports.assert(mean4.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); - util_exports.assert(offset == null || mean4.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); - util_exports.assert(scale22 == null || mean4.shape.length === scale22.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + const { x, mean: mean42, variance, offset, scale: scale22 } = inputs; + util_exports.assert(mean42.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); + util_exports.assert(offset == null || mean42.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); + util_exports.assert(scale22 == null || mean42.shape.length === scale22.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); let { varianceEpsilon } = attrs; if (varianceEpsilon == null) { varianceEpsilon = 1e-3; } - const finalInputs = [x, mean4, variance]; + const finalInputs = [x, mean42, variance]; let offsetShape = null; if (offset != null) { offsetShape = offset.shape; @@ -50430,7 +52597,7 @@ var batchNorm3 = ({ inputs, backend: backend22, attrs }) => { scaleShape = scale22.shape; finalInputs.push(scale22); } - const program = env().getBool("WEBGL_PACK_NORMALIZATION") ? new BatchNormPackedProgram(x.shape, mean4.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon) : new BatchNormProgram(x.shape, mean4.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon); + const program = env().getBool("WEBGL_PACK_NORMALIZATION") ? new BatchNormPackedProgram(x.shape, mean42.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon) : new BatchNormProgram(x.shape, mean42.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon); const output = backend22.runWebGLProgram(program, finalInputs, finalInputs[0].dtype); return output; }; @@ -50575,10 +52742,10 @@ var batchToSpaceND3 = (args) => { const { x } = inputs; const { blockShape, crops } = attrs; util_exports.assert(x.shape.length <= 4, () => "batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"); - const prod5 = blockShape.reduce((a, b) => a * b); - const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod5); + const prod52 = blockShape.reduce((a, b) => a * b); + const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod52); const permuted = backend_util_exports.getPermuted(reshaped.length, blockShape.length); - const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod5); + const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod52); const sliceBeginCoords = backend_util_exports.getSliceBeginCoords(crops, blockShape.length); const sliceSize = backend_util_exports.getSliceSize(reshapedPermuted, crops, blockShape.length); const toDispose = []; @@ -50628,8 +52795,8 @@ var notEqualConfig2 = { }; function real3(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const inputData = backend22.texData.get(input2.dataId); + const { input: input22 } = inputs; + const inputData = backend22.texData.get(input22.dataId); return identity3({ inputs: { x: inputData.complexTensorInfos.real }, backend: backend22 }); } var realConfig2 = { @@ -50638,9 +52805,9 @@ var realConfig2 = { kernelFunc: real3 }; var TO_INT = `return float(int(x));`; -function int(input2, backend22) { - const program = new UnaryOpProgram(input2.shape, TO_INT); - const output = backend22.runWebGLProgram(program, [input2], "int32"); +function int(input22, backend22) { + const program = new UnaryOpProgram(input22.shape, TO_INT); + const output = backend22.runWebGLProgram(program, [input22], "int32"); return { dataId: output.dataId, shape: output.shape, dtype: output.dtype }; } function cast4(args) { @@ -50909,8 +53076,8 @@ function shiftedChannels(channels, channel, shift) { } function imag3(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - const inputData = backend22.texData.get(input2.dataId); + const { input: input22 } = inputs; + const inputData = backend22.texData.get(input22.dataId); return identity3({ inputs: { x: inputData.complexTensorInfos.imag }, backend: backend22 }); } var imagConfig2 = { @@ -51512,9 +53679,9 @@ function conv2dWithIm2Row({ x, filter, convInfo, backend: backend22, bias = null function conv2d4(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dataFormat, dilations, dimRoundingMode } = attrs; + const { strides, pad: pad32, dataFormat, dilations, dimRoundingMode } = attrs; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode, false, $dataFormat); let out; if (convInfo.filterHeight === 1 && convInfo.filterWidth === 1 && convInfo.dilationHeight === 1 && convInfo.dilationWidth === 1 && convInfo.strideHeight === 1 && convInfo.strideWidth === 1 && (convInfo.padInfo.type === "SAME" || convInfo.padInfo.type === "VALID")) { out = conv2dByMatMul({ x, filter, convInfo, backend: backend22 }); @@ -51788,9 +53955,9 @@ var Conv3DDerInputProgram = class { function conv2DBackpropFilter3(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, pad: pad3, dataFormat, dimRoundingMode, filterShape } = attrs; + const { strides, pad: pad32, dataFormat, dimRoundingMode, filterShape } = attrs; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, 1, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, 1, pad32, dimRoundingMode, false, $dataFormat); const program = new Conv2DDerFilterProgram(convInfo); return backend22.runWebGLProgram(program, [x, dy], "float32"); } @@ -51802,9 +53969,9 @@ var conv2DBackpropFilterConfig2 = { function conv2DBackpropInput3(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { inputShape, strides, pad: pad3, dataFormat, dimRoundingMode } = attrs; + const { inputShape, strides, pad: pad32, dataFormat, dimRoundingMode } = attrs; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad32, dimRoundingMode, false, $dataFormat); const program = new Conv2DDerInputProgram(convInfo); return backend22.runWebGLProgram(program, [dy, filter], "float32"); } @@ -51816,8 +53983,8 @@ var conv2DBackpropInputConfig2 = { function conv3D2(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dilations } = attrs; - const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad3); + const { strides, pad: pad32, dilations } = attrs; + const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad32); const program = new Conv3DProgram(convInfo); return backend22.runWebGLProgram(program, [x, filter], "float32"); } @@ -51829,8 +53996,8 @@ var conv3DConfig2 = { function conv3DBackpropFilterV22(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, pad: pad3, filterShape } = attrs; - const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filterShape, strides, 1, pad3); + const { strides, pad: pad32, filterShape } = attrs; + const convInfo = backend_util_exports.computeConv3DInfo(x.shape, filterShape, strides, 1, pad32); const program = new Conv3DDerFilterProgram(convInfo); return backend22.runWebGLProgram(program, [x, dy], "float32"); } @@ -51842,8 +54009,8 @@ var conv3DBackpropFilterV2Config2 = { function conv3DBackpropInput2(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { pad: pad3, strides, inputShape } = attrs; - const convInfo = backend_util_exports.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad3); + const { pad: pad32, strides, inputShape } = attrs; + const convInfo = backend_util_exports.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad32); const program = new Conv3DDerInputProgram(convInfo); return backend22.runWebGLProgram(program, [dy, filter], "float32"); } @@ -51976,7 +54143,7 @@ var cropAndResizeConfig2 = { kernelFunc: cropAndResize3 }; var CumSumProgram = class { - constructor(shape, exclusive, reverse5) { + constructor(shape, exclusive, reverse52) { this.variableNames = ["x"]; this.customUniforms = [{ name: "index", type: "float" }]; this.outputShape = shape; @@ -51986,11 +54153,11 @@ var CumSumProgram = class { let condition = ""; let idxString = ""; if (exclusive) { - condition = reverse5 ? `end != ${length - 1}` : "end != 0"; - idxString = reverse5 ? "end + 1" : "end - 1"; + condition = reverse52 ? `end != ${length - 1}` : "end != 0"; + idxString = reverse52 ? "end + 1" : "end - 1"; } else { - condition = reverse5 ? `end + pow2 < ${length}` : "end >= pow2"; - idxString = reverse5 ? "end + pow2" : "end - pow2"; + condition = reverse52 ? `end + pow2 < ${length}` : "end >= pow2"; + idxString = reverse52 ? "end + pow2" : "end - pow2"; } this.userCode = ` void main() { @@ -52037,7 +54204,7 @@ function getFinalCoord(rank, name) { function cumsum3(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { axis, exclusive, reverse: reverse5 } = attrs; + const { axis, exclusive, reverse: reverse52 } = attrs; const xRank = x.shape.length; const permutation = backend_util_exports.getAxesPermutation([axis], xRank); let permutedX = x; @@ -52051,14 +54218,14 @@ function cumsum3(args) { const size2 = permutedX.shape[permutedAxis]; let result = identity3({ inputs: { x: permutedX }, backend: backend22 }); for (let i = 0; i <= Math.ceil(Math.log2(size2)) - 1; i++) { - const program = new CumSumProgram(permutedX.shape, false, reverse5); + const program = new CumSumProgram(permutedX.shape, false, reverse52); const customValues = [[i]]; const prevResult = result; result = backend22.runWebGLProgram(program, [result], result.dtype, customValues); backend22.disposeIntermediateTensorInfo(prevResult); } if (exclusive) { - const program = new CumSumProgram(permutedX.shape, exclusive, reverse5); + const program = new CumSumProgram(permutedX.shape, exclusive, reverse52); const prevResult = result; result = backend22.runWebGLProgram(program, [result], result.dtype); backend22.disposeIntermediateTensorInfo(prevResult); @@ -52570,13 +54737,13 @@ var DepthwiseConvPacked2DProgram = class { function depthwiseConv2dNative2(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dilations, dimRoundingMode } = attrs; + const { strides, pad: pad32, dilations, dimRoundingMode } = attrs; let $dilations = dilations; if ($dilations == null) { $dilations = [1, 1]; } util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad32, dimRoundingMode, true); let program; if (env().getBool("WEBGL_PACK_DEPTHWISECONV") && convInfo.strideWidth <= 2 && convInfo.outChannels / convInfo.inChannels === 1) { program = new DepthwiseConvPacked2DProgram(convInfo); @@ -52705,8 +54872,8 @@ var DepthwiseConv2DDerInputProgram = class { function depthwiseConv2dNativeBackpropFilter3(args) { const { inputs, backend: backend22, attrs } = args; const { x, dy } = inputs; - const { strides, dilations, pad: pad3, dimRoundingMode, filterShape } = attrs; - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad3, dimRoundingMode, true); + const { strides, dilations, pad: pad32, dimRoundingMode, filterShape } = attrs; + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad32, dimRoundingMode, true); const program = new DepthwiseConv2DDerFilterProgram(convInfo); return backend22.runWebGLProgram(program, [x, dy], "float32"); } @@ -52718,8 +54885,8 @@ var depthwiseConv2dNativeBackpropFilterConfig2 = { function depthwiseConv2dNativeBackpropInput3(args) { const { inputs, backend: backend22, attrs } = args; const { dy, filter } = inputs; - const { strides, dilations, pad: pad3, dimRoundingMode, inputShape } = attrs; - const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad3, dimRoundingMode, true); + const { strides, dilations, pad: pad32, dimRoundingMode, inputShape } = attrs; + const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad32, dimRoundingMode, true); const program = new DepthwiseConv2DDerInputProgram(convInfo); return backend22.runWebGLProgram(program, [dy, filter], "float32"); } @@ -52809,8 +54976,8 @@ var Dilation2DProgram = class { function dilation2D(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter } = inputs; - const { strides, pad: pad3, dilations } = attrs; - const convInfo = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad3, "NHWC", dilations); + const { strides, pad: pad32, dilations } = attrs; + const convInfo = backend_util_exports.computeDilation2DInfo(x.shape, filter.shape, strides, pad32, "NHWC", dilations); let out; const program = new Dilation2DProgram(convInfo); out = backend22.runWebGLProgram(program, [x, filter], "float32"); @@ -52967,16 +55134,16 @@ var expConfig2 = { function expandDims4(args) { const { inputs, attrs, backend: backend22 } = args; const { dim } = attrs; - const { input: input2 } = inputs; - const inputRank = input2.shape.length; - const newShape = input2.shape.slice(); + const { input: input22 } = inputs; + const inputRank = input22.shape.length; + const newShape = input22.shape.slice(); let $dim = dim; if (dim < 0) { util_exports.assert(-(inputRank + 1) <= dim, () => `Axis must be in the interval [${-(inputRank + 1)}, ${inputRank}]`); $dim = inputRank + dim + 1; } newShape.splice($dim, 0, 1); - return reshape4({ inputs: { x: input2 }, backend: backend22, attrs: { shape: newShape } }); + return reshape4({ inputs: { x: input22 }, backend: backend22, attrs: { shape: newShape } }); } var expandDimsConfig2 = { kernelName: ExpandDims, @@ -53074,8 +55241,8 @@ function fftImpl2(x, inverse, backend22) { } function fft3(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - return fftImpl2(input2, false, backend22); + const { input: input22 } = inputs; + return fftImpl2(input22, false, backend22); } var fftConfig2 = { kernelName: FFT, @@ -53310,9 +55477,9 @@ function fromPixels2(args) { function fusedConv2d(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const { strides, pad: pad32, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode, false, $dataFormat); let out; const intermediates = []; if (convInfo.filterHeight === 1 && convInfo.filterWidth === 1 && convInfo.dilationHeight === 1 && convInfo.dilationWidth === 1 && convInfo.strideHeight === 1 && convInfo.strideWidth === 1 && (convInfo.padInfo.type === "SAME" || convInfo.padInfo.type === "VALID")) { @@ -53370,14 +55537,14 @@ var fusedConv2DConfig2 = { function fusedDepthwiseConv2D2(args) { const { inputs, backend: backend22, attrs } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const { strides, pad: pad32, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; const intermediates = []; let $dilations = dilations; if ($dilations == null) { $dilations = [1, 1]; } util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad32, dimRoundingMode, true); const shouldPackDepthwiseConv = env().getBool("WEBGL_PACK_DEPTHWISECONV") && convInfo.strideWidth <= 2 && convInfo.outChannels / convInfo.inChannels === 1; const fusedActivation = activation2 ? mapActivationToShaderProgram(activation2, shouldPackDepthwiseConv) : null; const programInputs = [x, filter]; @@ -53582,8 +55749,8 @@ var greaterEqualConfig2 = { }; function ifft3(args) { const { inputs, backend: backend22 } = args; - const { input: input2 } = inputs; - return fftImpl2(input2, true, backend22); + const { input: input22 } = inputs; + return fftImpl2(input22, true, backend22); } var ifftConfig2 = { kernelName: IFFT, @@ -54015,10 +56182,10 @@ function maxPool3(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; assertNotComplex2(x, "maxPool"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = 1; util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports.arraysEqual(convInfo.inShape, convInfo.outShape)) { return identity3({ inputs: { x }, backend: backend22 }); } @@ -54033,9 +56200,9 @@ var maxPoolConfig2 = { function maxPool3d2(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { filterSize, strides, pad: pad3, dataFormat, dimRoundingMode } = attrs; + const { filterSize, strides, pad: pad32, dataFormat, dimRoundingMode } = attrs; const dilations = [1, 1, 1]; - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode, dataFormat); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode, dataFormat); const maxPoolProgram = new Pool3DProgram(convInfo, "max", false); return backend22.runWebGLProgram(maxPoolProgram, [x], x.dtype); } @@ -54191,16 +56358,16 @@ var MaxPool3DBackpropProgram = class { }; function maxPool3DGrad2(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2 } = inputs; - const x = input2; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; + const { dy, input: input22 } = inputs; + const x = input22; + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; const dilations = [1, 1, 1]; - const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad3, dimRoundingMode); + const convInfo = backend_util_exports.computePool3DInfo(x.shape, filterSize, strides, dilations, pad32, dimRoundingMode); const maxPool3dPositionsProgram = new Pool3DProgram(convInfo, "max", true); - const maxPool3dPositions2 = backend22.runWebGLProgram(maxPool3dPositionsProgram, [x], x.dtype); + const maxPool3dPositions22 = backend22.runWebGLProgram(maxPool3dPositionsProgram, [x], x.dtype); const maxPoolBackpropProgram = new MaxPool3DBackpropProgram(convInfo); - const result = backend22.runWebGLProgram(maxPoolBackpropProgram, [dy, maxPool3dPositions2], x.dtype); - backend22.disposeIntermediateTensorInfo(maxPool3dPositions2); + const result = backend22.runWebGLProgram(maxPoolBackpropProgram, [dy, maxPool3dPositions22], x.dtype); + backend22.disposeIntermediateTensorInfo(maxPool3dPositions22); return result; } var maxPoolGrad3DConfig = { @@ -54210,17 +56377,17 @@ var maxPoolGrad3DConfig = { }; function maxPoolGrad3(args) { const { inputs, backend: backend22, attrs } = args; - const { dy, input: input2, output } = inputs; - const x = input2; - assertNotComplex2([input2, output], "maxPoolGrad"); - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode); + const { dy, input: input22, output } = inputs; + const x = input22; + assertNotComplex2([input22, output], "maxPoolGrad"); + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode); const getPositions = true; const maxPoolPositionsProgram = new Pool2DProgram(convInfo, "max", getPositions); - const maxPoolPositions2 = backend22.runWebGLProgram(maxPoolPositionsProgram, [x], x.dtype); + const maxPoolPositions22 = backend22.runWebGLProgram(maxPoolPositionsProgram, [x], x.dtype); const maxPoolBackPropProgram = new MaxPool2DBackpropProgram(convInfo); - const result = backend22.runWebGLProgram(maxPoolBackPropProgram, [dy, maxPoolPositions2], x.dtype); - backend22.disposeIntermediateTensorInfo(maxPoolPositions2); + const result = backend22.runWebGLProgram(maxPoolBackPropProgram, [dy, maxPoolPositions22], x.dtype); + backend22.disposeIntermediateTensorInfo(maxPoolPositions22); return result; } var maxPoolGradConfig3 = { @@ -54240,12 +56407,12 @@ var maxPoolWithArgmaxConfig2 = { backendName: "webgl", kernelFunc: ({ inputs, attrs, backend: backend22 }) => { const { x } = inputs; - const { filterSize, strides, pad: pad3, includeBatchInIndex } = attrs; + const { filterSize, strides, pad: pad32, includeBatchInIndex } = attrs; const webglBackend = backend22; util_exports.assert(x.shape.length === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x.shape.length}.`); const dilations = [1, 1]; util_exports.assert(backend_util_exports.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad3); + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, dilations, pad32); const [result, indexes] = maxPoolWithArgmaxImpl2(x, includeBatchInIndex, convInfo, webglBackend); return [result, indexes]; } @@ -54366,11 +56533,11 @@ var minimumConfig2 = { var MirrorPadProgram = class { constructor(xShape, paddings, mode) { this.variableNames = ["x"]; - this.outputShape = paddings.map((p2, i) => p2[0] + xShape[i] + p2[1]); + this.outputShape = paddings.map((p22, i) => p22[0] + xShape[i] + p22[1]); const rank = xShape.length; const dtype = getCoordsDataType(rank); - const start = paddings.map((p2) => p2[0]).join(","); - const end = paddings.map((p2, i) => p2[0] + xShape[i]).join(","); + const start = paddings.map((p22) => p22[0]).join(","); + const end = paddings.map((p22, i) => p22[0] + xShape[i]).join(","); const unpackedCoords = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, rank); const offset = mode === "reflect" ? 0 : 1; if (rank === 1) { @@ -54414,11 +56581,11 @@ var MirrorPadPackedProgram = class { this.variableNames = ["x"]; this.packedInputs = true; this.packedOutput = true; - this.outputShape = paddings.map((p2, i) => p2[0] + xShape[i] + p2[1]); + this.outputShape = paddings.map((p22, i) => p22[0] + xShape[i] + p22[1]); const rank = xShape.length; const dtype = getCoordsDataType(rank); - const start = paddings.map((p2) => p2[0]).join(","); - const end = paddings.map((p2, i) => p2[0] + xShape[i]).join(","); + const start = paddings.map((p22) => p22[0]).join(","); + const end = paddings.map((p22, i) => p22[0] + xShape[i]).join(","); const coords22 = getChannels("rc", rank); const source = getChannels("source", rank); const cLimit = `${coords22[rank - 1]} < ${this.outputShape[rank - 1]}`; @@ -54839,11 +57006,11 @@ var PadProgram = class { constructor(xShape, paddings, constantValue) { this.variableNames = ["x"]; this.customUniforms = [{ name: "value", type: "float" }]; - this.outputShape = paddings.map((p2, i) => p2[0] + xShape[i] + p2[1]); + this.outputShape = paddings.map((p22, i) => p22[0] + xShape[i] + p22[1]); const rank = xShape.length; const type = getCoordsDataType(rank); - const start = paddings.map((p2) => p2[0]).join(","); - const end = paddings.map((p2, i) => p2[0] + xShape[i]).join(","); + const start = paddings.map((p22) => p22[0]).join(","); + const end = paddings.map((p22, i) => p22[0] + xShape[i]).join(","); const unpackedCoords = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, rank); if (rank === 1) { this.userCode = ` @@ -54883,11 +57050,11 @@ var PadPackedProgram = class { this.packedInputs = true; this.packedOutput = true; this.customUniforms = [{ name: "value", type: "float" }]; - this.outputShape = paddings.map((p2, i) => p2[0] + xShape[i] + p2[1]); + this.outputShape = paddings.map((p22, i) => p22[0] + xShape[i] + p22[1]); const rank = xShape.length; const dtype = getCoordsDataType(rank); - const start = paddings.map((p2) => p2[0]).join(","); - const end = paddings.map((p2, i) => p2[0] + xShape[i]).join(","); + const start = paddings.map((p22) => p22[0]).join(","); + const end = paddings.map((p22, i) => p22[0] + xShape[i]).join(","); const coords22 = getChannels("rc", rank); const source = getChannels("source", rank); const cLimit = `${coords22[rank - 1]} < ${this.outputShape[rank - 1]}`; @@ -54936,7 +57103,7 @@ var padV22 = (args) => { const { x } = inputs; const { paddings, constantValue } = attrs; if (util_exports.sizeFromShape(x.shape) === 0) { - const outputShape = paddings.map((p2, i) => p2[0] + x.shape[i] + p2[1]); + const outputShape = paddings.map((p22, i) => p22[0] + x.shape[i] + p22[1]); return fill3({ backend: backend22, attrs: { shape: outputShape, value: constantValue, dtype: x.dtype } @@ -55030,8 +57197,8 @@ var prodConfig2 = { }; var range4 = (args) => { const { backend: backend22, attrs } = args; - const { start, stop, step: step5, dtype } = attrs; - const values = rangeImplCPU(start, stop, step5, dtype); + const { start, stop, step: step52, dtype } = attrs; + const values = rangeImplCPU(start, stop, step52, dtype); return backend22.makeTensorInfo([values.length], dtype, values); }; var rangeConfig2 = { @@ -55861,9 +58028,9 @@ function scatterNd2(args) { const { inputs, backend: backend22, attrs } = args; const { indices, updates } = inputs; const { shape } = attrs; - const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize3 } = backend_util_exports.calculateShapes(updates, indices, shape); - const flattenShape = [outputSize3 / sliceSize, sliceSize]; - if (outputSize3 === 0) { + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports.calculateShapes(updates, indices, shape); + const flattenShape = [outputSize2 / sliceSize, sliceSize]; + if (outputSize2 === 0) { return backend22.makeTensorInfo(shape, indices.dtype); } const flattenIndices = reshape4({ inputs: { x: indices }, backend: backend22, attrs: { shape: [numUpdates, sliceRank] } }); @@ -56018,7 +58185,7 @@ var spaceToBatchND3 = (args) => { const { x } = inputs; const { blockShape, paddings } = attrs; util_exports.assert(x.shape.length <= 4, () => "spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"); - const prod5 = blockShape.reduce((a, b) => a * b); + const prod52 = blockShape.reduce((a, b) => a * b); const completePaddings = [[0, 0]]; completePaddings.push(...paddings); for (let i = 1 + blockShape.length; i < x.shape.length; ++i) { @@ -56030,9 +58197,9 @@ var spaceToBatchND3 = (args) => { backend: backend22, attrs: { paddings: completePaddings, constantValue: 0 } }); - const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod5, false); + const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod52, false); const permutedReshapedPaddedPermutation = backend_util_exports.getPermuted(reshapedPaddedShape.length, blockShape.length, false); - const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod5, false); + const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod52, false); const reshapedPaddedX = reshape4({ inputs: { x: paddedX }, backend: backend22, attrs: { shape: reshapedPaddedShape } }); const paddedXT = transpose3({ inputs: { x: reshapedPaddedX }, @@ -56167,9 +58334,9 @@ function sparseToDense3(args) { const { inputs, backend: backend22, attrs } = args; const { sparseIndices, sparseValues, defaultValue } = inputs; const { outputShape } = attrs; - const { sliceRank, numUpdates, strides, outputSize: outputSize3 } = backend_util_exports.calculateShapes(sparseValues, sparseIndices, outputShape); + const { sliceRank, numUpdates, strides, outputSize: outputSize2 } = backend_util_exports.calculateShapes(sparseValues, sparseIndices, outputShape); const sumDupeIndices = false; - const program = new ScatterProgram(numUpdates, sliceRank, sparseIndices.shape.length, sparseValues.shape.length, strides, [outputSize3, 1], sumDupeIndices); + const program = new ScatterProgram(numUpdates, sliceRank, sparseIndices.shape.length, sparseValues.shape.length, strides, [outputSize2, 1], sumDupeIndices); const res = backend22.runWebGLProgram(program, [sparseValues, sparseIndices, defaultValue], sparseValues.dtype); const reshaped = reshape4({ inputs: { x: res }, backend: backend22, attrs: { shape: outputShape } }); backend22.disposeIntermediateTensorInfo(res); @@ -56302,11 +58469,11 @@ var stridedSliceConfig2 = { }; function stringNGrams3(args) { const { inputs, backend: backend22, attrs } = args; - const { separator, nGramWidths, leftPad, rightPad: rightPad2, padWidth, preserveShortSequences } = attrs; + const { separator, nGramWidths, leftPad, rightPad: rightPad22, padWidth, preserveShortSequences } = attrs; const { data, dataSplits } = inputs; const $data = backend22.readSync(data.dataId); const $dataSplits = backend22.readSync(dataSplits.dataId); - const [nGrams, nGramsSplits] = stringNGramsImplCPU($data, $dataSplits, separator, nGramWidths, leftPad, rightPad2, padWidth, preserveShortSequences); + const [nGrams, nGramsSplits] = stringNGramsImplCPU($data, $dataSplits, separator, nGramWidths, leftPad, rightPad22, padWidth, preserveShortSequences); return [ backend22.makeTensorInfo([nGrams.length], "string", nGrams), backend22.makeTensorInfo(dataSplits.shape, "int32", nGramsSplits) @@ -56320,23 +58487,23 @@ var stringNGramsConfig2 = { function stringSplit3(args) { const { inputs, backend: backend22, attrs } = args; const { skipEmpty } = attrs; - const { input: input2, delimiter } = inputs; - if (input2.dtype !== "string") { + const { input: input22, delimiter } = inputs; + if (input22.dtype !== "string") { throw new Error("Input must be of datatype string"); } - if (input2.shape.length !== 1) { - throw new Error(`Input must be a vector, got shape: ${input2.shape}`); + if (input22.shape.length !== 1) { + throw new Error(`Input must be a vector, got shape: ${input22.shape}`); } if (delimiter.shape.length !== 0) { throw new Error(`Delimiter must be a scalar, got shape: ${delimiter.shape}`); } - const $input = backend22.readSync(input2.dataId); + const $input = backend22.readSync(input22.dataId); const $delimiter = backend22.readSync(delimiter.dataId)[0]; const [indices, values, shape] = stringSplitImplCPU($input, $delimiter, skipEmpty); - const outputSize3 = values.length; + const outputSize2 = values.length; return [ - backend22.makeTensorInfo([outputSize3, 2], "int32", indices), - backend22.makeTensorInfo([outputSize3], "string", values), + backend22.makeTensorInfo([outputSize2, 2], "int32", indices), + backend22.makeTensorInfo([outputSize2], "string", values), backend22.makeTensorInfo([2], "int32", new Int32Array(shape)) ]; } @@ -56348,16 +58515,16 @@ var stringSplitConfig2 = { function stringToHashBucketFast3(args) { const { inputs, backend: backend22, attrs } = args; const { numBuckets } = attrs; - const { input: input2 } = inputs; - if (input2.dtype !== "string") { + const { input: input22 } = inputs; + if (input22.dtype !== "string") { throw new Error("Input must be of datatype string"); } if (numBuckets <= 0) { throw new Error(`Number of buckets must be at least 1`); } - const $input = backend22.readSync(input2.dataId); + const $input = backend22.readSync(input22.dataId); const output = stringToHashBucketFastImplCPU($input, numBuckets); - return backend22.makeTensorInfo(input2.shape, "int32", output); + return backend22.makeTensorInfo(input22.shape, "int32", output); } var stringToHashBucketFastConfig2 = { kernelName: StringToHashBucketFast, @@ -57497,19 +59664,19 @@ function all4(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; - input2 = transposed; + input22 = transposed; inputId = transposedId; } - const inputRank = input2.shape.length; + const inputRank = input22.shape.length; backend_util_exports.assertAxesAreInnerMostDims("all", axes, inputRank); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, axes); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, axes); const reduceSize = util_exports.sizeFromShape(reduceShape); const out = backend22.makeOutput(outShape, x.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmAll(inputId, reduceSize, outId); } @@ -57538,19 +59705,19 @@ function any4(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; - input2 = transposed; + input22 = transposed; inputId = transposedId; } - const inputRank = input2.shape.length; + const inputRank = input22.shape.length; backend_util_exports.assertAxesAreInnerMostDims("any", axes, inputRank); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, axes); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, axes); const reduceSize = util_exports.sizeFromShape(reduceShape); const out = backend22.makeOutput(outShape, x.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmAny(inputId, reduceSize, outId); } @@ -57585,21 +59752,21 @@ function argmax(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; if (transposedId !== xId) { - input2 = transposed; + input22 = transposed; inputId = transposedId; } } - const outShape = input2.shape.slice(0, -1); + const outShape = input22.shape.slice(0, -1); const out = backend22.makeOutput(outShape, "int32"); const outId = backend22.dataIdMap.get(out.dataId).id; const outerSize = util_exports.sizeFromShape(out.shape); - const innerSize = input2.shape[axes[0]]; - wasmFunc2(inputId, CppDType[input2.dtype], outerSize, innerSize, outId); + const innerSize = input22.shape[axes[0]]; + wasmFunc2(inputId, CppDType[input22.dtype], outerSize, innerSize, outId); if (inputWasTransposed) { backend22.disposeData(transposed.dataId); } @@ -57634,8 +59801,8 @@ function avgPool4(args) { const { inputs, attrs, backend: backend22 } = args; const x = inputs.x; const xId = backend22.dataIdMap.get(x.dataId).id; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode); + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -57829,10 +59996,10 @@ function batchToSpaceND4(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; const { blockShape, crops } = attrs; - const prod5 = blockShape.reduce((a, b) => a * b); - const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod5); + const prod52 = blockShape.reduce((a, b) => a * b); + const reshaped = backend_util_exports.getReshaped(x.shape, blockShape, prod52); const permuted = backend_util_exports.getPermuted(reshaped.length, blockShape.length); - const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod5); + const reshapedPermuted = backend_util_exports.getReshapedPermuted(x.shape, blockShape, prod52); const sliceBeginCoords = backend_util_exports.getSliceBeginCoords(crops, blockShape.length); const sliceSize = backend_util_exports.getSliceSize(reshapedPermuted, crops, blockShape.length); const xReshaped = reshape5({ inputs: { x }, backend: backend22, attrs: { shape: reshaped } }); @@ -57927,12 +60094,12 @@ function concat4(args) { } const batchDim = util_exports.sizeFromShape($inputs[0].shape.slice(0, axis)); let sumInnerDims = 0; - const innerDims = $inputs.map((input2) => { - const innerDim = util_exports.sizeFromShape(input2.shape.slice(axis)); + const innerDims = $inputs.map((input22) => { + const innerDim = util_exports.sizeFromShape(input22.shape.slice(axis)); sumInnerDims += innerDim; return innerDim; }); - const inVals = $inputs.map((input2) => backend22.typedArrayFromHeap(input2)); + const inVals = $inputs.map((input22) => backend22.typedArrayFromHeap(input22)); const outVals = backend22.typedArrayFromHeap(out); for (let b = 0; b < batchDim; b++) { let outOffset = b * sumInnerDims; @@ -57980,9 +60147,9 @@ function conv2d5(args) { const { x, filter } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; const filterId = backend22.dataIdMap.get(filter.dataId).id; - const { strides, dilations, pad: pad3, dimRoundingMode, dataFormat } = attrs; + const { strides, dilations, pad: pad32, dimRoundingMode, dataFormat } = attrs; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode, false, $dataFormat); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -58045,10 +60212,10 @@ function setup10(backend22) { function conv2DBackpropInput4(args) { const { backend: backend22, inputs, attrs } = args; const { dy, filter } = inputs; - const { strides, pad: pad3, dataFormat, dimRoundingMode, inputShape } = attrs; + const { strides, pad: pad32, dataFormat, dimRoundingMode, inputShape } = attrs; const dilations = 1; const $dataFormat = backend_util_exports.convertConv2DDataFormat(dataFormat); - const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad3, dimRoundingMode, false, $dataFormat); + const convInfo = backend_util_exports.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad32, dimRoundingMode, false, $dataFormat); const { batchSize, filterHeight, filterWidth, inChannels, inHeight, inWidth, outChannels, outHeight, outWidth, strideHeight, strideWidth } = convInfo; const topPad = filterHeight - 1 - convInfo.padInfo.top; const leftPad = filterWidth - 1 - convInfo.padInfo.left; @@ -58144,7 +60311,7 @@ function setup12(backend22) { function cumsum4(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; - const { axis, exclusive, reverse: reverse5 } = attrs; + const { axis, exclusive, reverse: reverse52 } = attrs; const xRank = x.shape.length; util_exports.assert(x.dtype === "float32" || x.dtype === "int32", () => `cumsum does not support ${x.dtype} tensors in the WASM backend`); const permutation = backend_util_exports.getAxesPermutation([axis], xRank); @@ -58158,7 +60325,7 @@ function cumsum4(args) { const finalDim = permutedX.shape[permutedAxis]; const permutedXId = backend22.dataIdMap.get(permutedX.dataId).id; const permutedOutId = backend22.dataIdMap.get(permutedOut.dataId).id; - wasmCumsum(permutedXId, exclusive ? 1 : 0, reverse5 ? 1 : 0, finalDim, permutedOutId, CppDType[x.dtype]); + wasmCumsum(permutedXId, exclusive ? 1 : 0, reverse52 ? 1 : 0, finalDim, permutedOutId, CppDType[x.dtype]); let out = permutedOut; if (permutation !== null) { const undoPermutation = backend_util_exports.getUndoAxesPermutation(permutation); @@ -58247,9 +60414,9 @@ function depthwiseConv2d5(args) { const { x, filter } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; const filterId = backend22.dataIdMap.get(filter.dataId).id; - const { strides, dilations, pad: pad3, dimRoundingMode } = attrs; + const { strides, dilations, pad: pad32, dimRoundingMode } = attrs; const $dilations = dilations == null ? [1, 1] : dilations; - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad3, dimRoundingMode, true); + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad32, dimRoundingMode, true); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -58283,17 +60450,17 @@ var equalConfig3 = createBinaryKernelConfig(Equal, supportsFullBroadcast2, "bool var expConfig3 = createUnaryKernelConfig(Exp); function expandDims5(args) { const { inputs, attrs, backend: backend22 } = args; - const { input: input2 } = inputs; + const { input: input22 } = inputs; const { dim } = attrs; - const inputRank = input2.shape.length; - const newShape = input2.shape.slice(); + const inputRank = input22.shape.length; + const newShape = input22.shape.slice(); let $dim = dim; if (dim < 0) { util_exports.assert(-(inputRank + 1) <= dim, () => `Axis must be in the interval [${-(inputRank + 1)}, ${inputRank}]`); $dim = inputRank + dim + 1; } newShape.splice($dim, 0, 1); - return reshape5({ inputs: { x: input2 }, backend: backend22, attrs: { shape: newShape } }); + return reshape5({ inputs: { x: input22 }, backend: backend22, attrs: { shape: newShape } }); } var expandDimsConfig3 = { kernelName: ExpandDims, @@ -58349,9 +60516,9 @@ function setup16(backend22) { function fusedBatchNorm(args) { const { backend: backend22, inputs, attrs } = args; const { varianceEpsilon } = attrs; - const { x, mean: mean4, variance, offset, scale: scale22 } = inputs; + const { x, mean: mean42, variance, offset, scale: scale22 } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; - const meanId = backend22.dataIdMap.get(mean4.dataId).id; + const meanId = backend22.dataIdMap.get(mean42.dataId).id; const varianceId = backend22.dataIdMap.get(variance.dataId).id; const offsetId = offset != null ? backend22.dataIdMap.get(offset.dataId).id : 0; const scaleId = scale22 != null ? backend22.dataIdMap.get(scale22.dataId).id : 0; @@ -58400,8 +60567,8 @@ function setup17(backend22) { function fusedConv2d2(args) { const { inputs, attrs, backend: backend22 } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dilations, dataFormat, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode); + const { strides, pad: pad32, dilations, dataFormat, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode); const fusedActivation = FusableActivation[activation2]; if (fusedActivation == null) { throw new Error(`${activation2} activation not yet supported for FusedConv2D in the wasm backend.`); @@ -58481,8 +60648,8 @@ function setup18(backend22) { function fusedDepthwiseConv2d(args) { const { inputs, attrs, backend: backend22 } = args; const { x, filter, bias, preluActivationWeights } = inputs; - const { strides, pad: pad3, dilations, dataFormat, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; - const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad3, dimRoundingMode, true); + const { strides, pad: pad32, dilations, dataFormat, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const convInfo = backend_util_exports.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad32, dimRoundingMode, true); const fusedActivation = FusableActivation[activation2]; if (fusedActivation == null) { throw new Error(`${activation2} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`); @@ -58681,19 +60848,19 @@ function max5(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; - input2 = transposed; + input22 = transposed; inputId = transposedId; } - const inputRank = input2.shape.length; + const inputRank = input22.shape.length; backend_util_exports.assertAxesAreInnerMostDims("max", axes, inputRank); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, axes); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, axes); const reduceSize = util_exports.sizeFromShape(reduceShape); const out = backend22.makeOutput(outShape, x.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmMax(inputId, reduceSize, outId); } @@ -58740,8 +60907,8 @@ function maxPool4(args) { const { inputs, attrs, backend: backend22 } = args; const x = inputs.x; const xId = backend22.dataIdMap.get(x.dataId).id; - const { filterSize, strides, pad: pad3, dimRoundingMode } = attrs; - const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad3, dimRoundingMode); + const { filterSize, strides, pad: pad32, dimRoundingMode } = attrs; + const convInfo = backend_util_exports.computePool2DInfo(x.shape, filterSize, strides, 1, pad32, dimRoundingMode); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -58778,27 +60945,27 @@ function mean3(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); let reductionAxes = axes; if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; if (transposedId !== xId) { - input2 = transposed; + input22 = transposed; inputId = transposedId; - reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input2.shape.length); + reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input22.shape.length); } } - backend_util_exports.assertAxesAreInnerMostDims("mean", reductionAxes, input2.shape.length); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, reductionAxes); + backend_util_exports.assertAxesAreInnerMostDims("mean", reductionAxes, input22.shape.length); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, reductionAxes); const reduceSize = util_exports.sizeFromShape(reduceShape); - let castedInput = input2; - if (input2.dtype !== "float32") { - castedInput = cast5({ backend: backend22, inputs: { x: input2 }, attrs: { dtype: "float32" } }); + let castedInput = input22; + if (input22.dtype !== "float32") { + castedInput = cast5({ backend: backend22, inputs: { x: input22 }, attrs: { dtype: "float32" } }); inputId = backend22.dataIdMap.get(castedInput.dataId).id; } const out = backend22.makeOutput(outShape, "float32"); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmMean(inputId, reduceSize, outId); } @@ -58809,7 +60976,7 @@ function mean3(args) { const newShape = backend_util_exports.expandShapeToKeepDim(out.shape, originalAxes); out.shape = newShape; } - if (input2.dtype !== "float32") { + if (input22.dtype !== "float32") { backend22.disposeData(castedInput.dataId); } return out; @@ -58830,21 +60997,21 @@ function min5(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; if (transposedId !== xId) { - input2 = transposed; + input22 = transposed; inputId = transposedId; } } - const inputRank = input2.shape.length; + const inputRank = input22.shape.length; backend_util_exports.assertAxesAreInnerMostDims("min", axes, inputRank); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, axes); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, axes); const reduceSize = util_exports.sizeFromShape(reduceShape); - const out = backend22.makeOutput(outShape, input2.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + const out = backend22.makeOutput(outShape, input22.dtype); + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmMin(inputId, reduceSize, outId); } @@ -58885,7 +61052,7 @@ function setup25(backend22) { } function mirrorPad3(args) { const { inputs: { x }, backend: backend22, attrs: { paddings, mode } } = args; - const outShape = paddings.map((p2, i) => p2[0] + x.shape[i] + p2[1]); + const outShape = paddings.map((p22, i) => p22[0] + x.shape[i] + p22[1]); const xId = backend22.dataIdMap.get(x.dataId).id; const out = backend22.makeOutput(outShape, x.dtype); const outId = backend22.dataIdMap.get(out.dataId).id; @@ -59087,7 +61254,7 @@ function setup30(backend22) { } function pad2(args) { const { inputs: { x }, backend: backend22, attrs: { paddings, constantValue } } = args; - const outShape = paddings.map((p2, i) => p2[0] + x.shape[i] + p2[1]); + const outShape = paddings.map((p22, i) => p22[0] + x.shape[i] + p22[1]); if (util_exports.sizeFromShape(x.shape) === 0) { return fill4({ backend: backend22, @@ -59153,22 +61320,22 @@ function prod4(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); let reductionAxes = axes; if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; if (transposedId !== xId) { - input2 = transposed; + input22 = transposed; inputId = transposedId; - reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input2.shape.length); + reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input22.shape.length); } } - backend_util_exports.assertAxesAreInnerMostDims("prod", reductionAxes, input2.shape.length); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, reductionAxes); + backend_util_exports.assertAxesAreInnerMostDims("prod", reductionAxes, input22.shape.length); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, reductionAxes); const reduceSize = util_exports.sizeFromShape(reduceShape); - const out = backend22.makeOutput(outShape, input2.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + const out = backend22.makeOutput(outShape, input22.dtype); + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmProd(inputId, reduceSize, CppDType[out.dtype], outId); } @@ -59189,8 +61356,8 @@ var prodConfig3 = { }; var range5 = (args) => { const { backend: backend22, attrs } = args; - const { start, stop, step: step5, dtype } = attrs; - const values = rangeImpl(start, stop, step5, dtype); + const { start, stop, step: step52, dtype } = attrs; + const values = rangeImpl(start, stop, step52, dtype); const out = backend22.makeOutput([values.length], dtype); const outVals = backend22.typedArrayFromHeap(out); outVals.set(values); @@ -59313,9 +61480,9 @@ function rotateWithOffset2(args) { const [centerX, centerY] = backend_util_exports.getImageCenter(center, imageHeight, imageWidth); const fillIsBlack = fillValue === 0; const fullOpacityValue = 255; - const fillValues2 = typeof fillValue === "number" ? [fillValue, fillValue, fillValue, fillIsBlack ? 0 : fullOpacityValue] : [...fillValue, fullOpacityValue]; - const fillBytes = new Uint8Array(new Int32Array(fillValues2).buffer); - wasmRotate(imageId, batch, imageHeight, imageWidth, numChannels, radians, centerX, centerY, fillBytes, fillValues2.length, outId); + const fillValues22 = typeof fillValue === "number" ? [fillValue, fillValue, fillValue, fillIsBlack ? 0 : fullOpacityValue] : [...fillValue, fullOpacityValue]; + const fillBytes = new Uint8Array(new Int32Array(fillValues22).buffer); + wasmRotate(imageId, batch, imageHeight, imageWidth, numChannels, radians, centerX, centerY, fillBytes, fillValues22.length, outId); return out; } var rotateWithOffsetConfig3 = { @@ -59348,14 +61515,14 @@ function scatterNd3(args) { if (util_exports.sizeFromShape(shape) === 0) { return out; } - const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize3 } = scatter_nd_util_exports.calculateShapes(updates, indices, shape); + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = scatter_nd_util_exports.calculateShapes(updates, indices, shape); const indicesData = backend22.dataIdMap.get(indices.dataId); const indicesId = indicesData.id; const updatesData = backend22.dataIdMap.get(updates.dataId); const updatesId = updatesData.id; const stridesBytes = new Uint8Array(new Int32Array(strides).buffer); const outId = backend22.dataIdMap.get(out.dataId).id; - wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize3, outId); + wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize2, outId); return out; } var scatterNdConfig3 = { @@ -59448,7 +61615,7 @@ function spaceToBatchND4(args) { const { inputs, backend: backend22, attrs } = args; const { x } = inputs; const { blockShape, paddings } = attrs; - const prod5 = util_exports.sizeFromShape(blockShape); + const prod52 = util_exports.sizeFromShape(blockShape); const completePaddings = [[0, 0]]; completePaddings.push(...paddings); for (let i = 1 + blockShape.length; i < x.shape.length; ++i) { @@ -59459,9 +61626,9 @@ function spaceToBatchND4(args) { backend: backend22, attrs: { paddings: completePaddings, constantValue: 0 } }); - const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod5, false); + const reshapedPaddedShape = backend_util_exports.getReshaped(paddedX.shape, blockShape, prod52, false); const permutedReshapedPaddedPermutation = backend_util_exports.getPermuted(reshapedPaddedShape.length, blockShape.length, false); - const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod5, false); + const flattenShape = backend_util_exports.getReshapedPermuted(paddedX.shape, blockShape, prod52, false); const reshapeInputs = { x: paddedX }; const reshapeAttrs = { shape: reshapedPaddedShape }; const paddedXReshaped = reshape5({ inputs: reshapeInputs, backend: backend22, attrs: reshapeAttrs }); @@ -59626,22 +61793,22 @@ function sum5(args) { const { x } = inputs; const xId = backend22.dataIdMap.get(x.dataId).id; let inputId = xId; - let input2 = x; + let input22 = x; const { transposed, axes, originalAxes, inputWasTransposed } = permuteAxesAndTranspose(x, axis, backend22); let reductionAxes = axes; if (inputWasTransposed) { const transposedId = backend22.dataIdMap.get(transposed.dataId).id; if (transposedId !== xId) { - input2 = transposed; + input22 = transposed; inputId = transposedId; - reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input2.shape.length); + reductionAxes = backend_util_exports.getInnerMostAxes(reductionAxes.length, input22.shape.length); } } - backend_util_exports.assertAxesAreInnerMostDims("sum", reductionAxes, input2.shape.length); - const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input2.shape, reductionAxes); + backend_util_exports.assertAxesAreInnerMostDims("sum", reductionAxes, input22.shape.length); + const [outShape, reduceShape] = backend_util_exports.computeOutAndReduceShapes(input22.shape, reductionAxes); const reduceSize = util_exports.sizeFromShape(reduceShape); - const out = backend22.makeOutput(outShape, input2.dtype); - if (util_exports.sizeFromShape(input2.shape) !== 0) { + const out = backend22.makeOutput(outShape, input22.dtype); + if (util_exports.sizeFromShape(input22.shape) !== 0) { const outId = backend22.dataIdMap.get(out.dataId).id; wasmSum(inputId, reduceSize, outId); } @@ -60020,9 +62187,9 @@ ENV4.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT", async () => { return false; } }); -var import_tfjs_backend_wasm_threaded_simd = __toModule(require_tfjs_backend_wasm_threaded_simd()); +var import_tfjs_backend_wasm_threaded_simd = __toModule2(require_tfjs_backend_wasm_threaded_simd()); var wasmWorkerContents = 'var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}WasmBackendModuleThreadedSimd(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["getNoExitRuntime"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}'; -var import_tfjs_backend_wasm = __toModule(require_tfjs_backend_wasm()); +var import_tfjs_backend_wasm = __toModule2(require_tfjs_backend_wasm()); var BackendWasm = class extends KernelBackend { constructor(wasm) { super(); @@ -60128,16 +62295,16 @@ var BackendWasm = class extends KernelBackend { return { dataId, shape, dtype }; } typedArrayFromHeap({ shape, dtype, dataId }) { - const buffer2 = this.wasm.HEAPU8.buffer; + const buffer22 = this.wasm.HEAPU8.buffer; const { memoryOffset } = this.dataIdMap.get(dataId); const size2 = util_exports.sizeFromShape(shape); switch (dtype) { case "float32": - return new Float32Array(buffer2, memoryOffset, size2); + return new Float32Array(buffer22, memoryOffset, size2); case "int32": - return new Int32Array(buffer2, memoryOffset, size2); + return new Int32Array(buffer22, memoryOffset, size2); case "bool": - return new Uint8Array(buffer2, memoryOffset, size2); + return new Uint8Array(buffer22, memoryOffset, size2); default: throw new Error(`Unknown dtype ${dtype}`); } @@ -60233,14 +62400,14 @@ async function init() { }); }); } -function typedArrayFromBuffer(buffer2, dtype) { +function typedArrayFromBuffer(buffer22, dtype) { switch (dtype) { case "float32": - return new Float32Array(buffer2); + return new Float32Array(buffer22); case "int32": - return new Int32Array(buffer2); + return new Int32Array(buffer22); case "bool": - return new Uint8Array(buffer2); + return new Uint8Array(buffer22); default: throw new Error(`Unknown dtype ${dtype}`); } @@ -60456,8 +62623,8 @@ function GLImageFilter(params) { gl.uniform1f(_currentProgram.uniform.flipY, flipY ? -1 : 1); gl.drawArrays(gl.TRIANGLES, 0, 6); }; - this.apply = function(image7) { - _resize(image7.width, image7.height); + this.apply = function(image9) { + _resize(image9.width, image9.height); _drawCount = 0; if (!_sourceTexture) _sourceTexture = gl.createTexture(); @@ -60466,7 +62633,7 @@ function GLImageFilter(params) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image7); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image9); if (_filterChain.length === 0) { _draw(); return _canvas; @@ -60637,25 +62804,25 @@ function GLImageFilter(params) { }; _filter.hue = function(rotation) { rotation = (rotation || 0) / 180 * Math.PI; - const cos4 = Math.cos(rotation); - const sin4 = Math.sin(rotation); + const cos7 = Math.cos(rotation); + const sin7 = Math.sin(rotation); const lumR = 0.213; const lumG = 0.715; const lumB = 0.072; _filter.colorMatrix([ - lumR + cos4 * (1 - lumR) + sin4 * -lumR, - lumG + cos4 * -lumG + sin4 * -lumG, - lumB + cos4 * -lumB + sin4 * (1 - lumB), + lumR + cos7 * (1 - lumR) + sin7 * -lumR, + lumG + cos7 * -lumG + sin7 * -lumG, + lumB + cos7 * -lumB + sin7 * (1 - lumB), 0, 0, - lumR + cos4 * -lumR + sin4 * 0.143, - lumG + cos4 * (1 - lumG) + sin4 * 0.14, - lumB + cos4 * -lumB + sin4 * -0.283, + lumR + cos7 * -lumR + sin7 * 0.143, + lumG + cos7 * (1 - lumG) + sin7 * 0.14, + lumB + cos7 * -lumB + sin7 * -0.283, 0, 0, - lumR + cos4 * -lumR + sin4 * -(1 - lumR), - lumG + cos4 * -lumG + sin4 * lumG, - lumB + cos4 * (1 - lumB) + sin4 * lumB, + lumR + cos7 * -lumR + sin7 * -(1 - lumR), + lumG + cos7 * -lumG + sin7 * lumG, + lumB + cos7 * (1 - lumB) + sin7 * lumB, 0, 0, 0, @@ -61122,31 +63289,31 @@ function canvas(width, height) { } return c; } -function process2(input2, config3) { - let tensor2; - if (!input2) { +function process2(input3, config3) { + let tensor3; + if (!input3) { if (config3.debug) log("input is missing"); return { tensor: null, canvas: null }; } - if (!(input2 instanceof Tensor) && !(typeof Image !== "undefined" && input2 instanceof Image) && !(typeof env2.Canvas !== "undefined" && input2 instanceof env2.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input2 instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input2 instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input2 instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input2 instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input2 instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input2 instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input2 instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input2 instanceof OffscreenCanvas)) { + if (!(input3 instanceof Tensor) && !(typeof Image !== "undefined" && input3 instanceof Image) && !(typeof env2.Canvas !== "undefined" && input3 instanceof env2.Canvas) && !(typeof globalThis.Canvas !== "undefined" && input3 instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input3 instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input3 instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input3 instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input3 instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input3 instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input3 instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input3 instanceof OffscreenCanvas)) { throw new Error("input type is not recognized"); } - if (input2 instanceof Tensor) { - if (input2["isDisposedInternal"]) + if (input3 instanceof Tensor) { + if (input3["isDisposedInternal"]) throw new Error("input tensor is disposed"); - if (input2.shape && input2.shape.length === 4 && input2.shape[0] === 1 && input2.shape[3] === 3) - tensor2 = clone(input2); + if (input3.shape && input3.shape.length === 4 && input3.shape[0] === 1 && input3.shape[3] === 3) + tensor3 = clone(input3); else - throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${input2.shape}`); + throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${input3.shape}`); } else { - if (typeof input2["readyState"] !== "undefined" && input2["readyState"] <= 2) { + if (typeof input3["readyState"] !== "undefined" && input3["readyState"] <= 2) { if (config3.debug) log("input stream is not ready"); return { tensor: null, canvas: inCanvas }; } - const originalWidth = input2["naturalWidth"] || input2["videoWidth"] || input2["width"] || input2["shape"] && input2["shape"][1] > 0; - const originalHeight = input2["naturalHeight"] || input2["videoHeight"] || input2["height"] || input2["shape"] && input2["shape"][2] > 0; + const originalWidth = input3["naturalWidth"] || input3["videoWidth"] || input3["width"] || input3["shape"] && input3["shape"][1] > 0; + const originalHeight = input3["naturalHeight"] || input3["videoHeight"] || input3["height"] || input3["shape"] && input3["shape"][2] > 0; if (!originalWidth || !originalHeight) { if (config3.debug) log("cannot determine input dimensions"); @@ -61175,16 +63342,16 @@ function process2(input2, config3) { if (!inCanvas || (inCanvas == null ? void 0 : inCanvas.width) !== targetWidth || (inCanvas == null ? void 0 : inCanvas.height) !== targetHeight) inCanvas = canvas(targetWidth, targetHeight); const ctx = inCanvas.getContext("2d"); - if (typeof ImageData !== "undefined" && input2 instanceof ImageData) { - ctx.putImageData(input2, 0, 0); + if (typeof ImageData !== "undefined" && input3 instanceof ImageData) { + ctx.putImageData(input3, 0, 0); } else { if (config3.filter.flip && typeof ctx.translate !== "undefined") { ctx.translate(originalWidth, 0); ctx.scale(-1, 1); - ctx.drawImage(input2, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas == null ? void 0 : inCanvas.width, inCanvas == null ? void 0 : inCanvas.height); + ctx.drawImage(input3, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas == null ? void 0 : inCanvas.width, inCanvas == null ? void 0 : inCanvas.height); ctx.setTransform(1, 0, 0, 1, 0, 0); } else { - ctx.drawImage(input2, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas == null ? void 0 : inCanvas.width, inCanvas == null ? void 0 : inCanvas.height); + ctx.drawImage(input3, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas == null ? void 0 : inCanvas.width, inCanvas == null ? void 0 : inCanvas.height); } } if (config3.filter.enabled && env2.webgl.supported) { @@ -61232,7 +63399,7 @@ function process2(input2, config3) { if (fx) fx = null; } - if (!tensor2) { + if (!tensor3) { let pixels; if (outCanvas.data) { const shape = [outCanvas.height, outCanvas.width, 3]; @@ -61245,6 +63412,8 @@ function process2(input2, config3) { tempCanvas.height = targetHeight; const tempCtx = tempCanvas.getContext("2d"); tempCtx == null ? void 0 : tempCtx.drawImage(outCanvas, 0, 0); + console.log("PIXELS", tempCanvas); + pixels = browser_exports && env2.browser ? browser_exports.fromPixels(tempCanvas) : null; try { pixels = browser_exports && env2.browser ? browser_exports.fromPixels(tempCanvas) : null; } catch (err) { @@ -61275,33 +63444,33 @@ function process2(input2, config3) { } if (pixels) { const casted = cast(pixels, "float32"); - tensor2 = expandDims(casted, 0); + tensor3 = expandDims(casted, 0); dispose(pixels); dispose(casted); } else { - tensor2 = zeros([1, targetWidth, targetHeight, 3]); + tensor3 = zeros([1, targetWidth, targetHeight, 3]); throw new Error("cannot create tensor from input"); } } } - return { tensor: tensor2, canvas: config3.filter.return ? outCanvas : null }; + return { tensor: tensor3, canvas: config3.filter.return ? outCanvas : null }; } var lastInputSum = 0; var lastCacheDiff = 1; -async function skip(config3, input2) { +async function skip(config3, input3) { if (config3.cacheSensitivity === 0) return false; const resizeFact = 32; - if (!input2.shape[1] || !input2.shape[2]) + if (!input3.shape[1] || !input3.shape[2]) return false; - const reduced = image.resizeBilinear(input2, [Math.trunc(input2.shape[1] / resizeFact), Math.trunc(input2.shape[2] / resizeFact)]); + const reduced = image.resizeBilinear(input3, [Math.trunc(input3.shape[1] / resizeFact), Math.trunc(input3.shape[2] / resizeFact)]); const reducedData = await reduced.data(); dispose(reduced); - let sum6 = 0; + let sum10 = 0; for (let i = 0; i < reducedData.length / 3; i++) - sum6 += reducedData[3 * i + 2]; - const diff = 100 * (Math.max(sum6, lastInputSum) / Math.min(sum6, lastInputSum) - 1); - lastInputSum = sum6; + sum10 += reducedData[3 * i + 2]; + const diff = 100 * (Math.max(sum10, lastInputSum) / Math.min(sum10, lastInputSum) - 1); + lastInputSum = sum10; const skipFrame = diff < Math.max(config3.cacheSensitivity, lastCacheDiff); lastCacheDiff = diff > 10 * config3.cacheSensitivity ? 0 : diff; return skipFrame; @@ -64594,27 +66763,27 @@ var UV7 = VTX7.map((x) => UV468[x]); var createBox = (startEndTensor) => ({ startPoint: slice(startEndTensor, [0, 0], [-1, 2]), endPoint: slice(startEndTensor, [0, 2], [-1, 2]) }); var getBoxSize = (box4) => [Math.abs(box4.endPoint[0] - box4.startPoint[0]), Math.abs(box4.endPoint[1] - box4.startPoint[1])]; var getBoxCenter = (box4) => [box4.startPoint[0] + (box4.endPoint[0] - box4.startPoint[0]) / 2, box4.startPoint[1] + (box4.endPoint[1] - box4.startPoint[1]) / 2]; -var getClampedBox = (box4, input2) => box4 ? [ +var getClampedBox = (box4, input3) => box4 ? [ Math.trunc(Math.max(0, box4.startPoint[0])), Math.trunc(Math.max(0, box4.startPoint[1])), - Math.trunc(Math.min(input2.shape[2] || 0, box4.endPoint[0]) - Math.max(0, box4.startPoint[0])), - Math.trunc(Math.min(input2.shape[1] || 0, box4.endPoint[1]) - Math.max(0, box4.startPoint[1])) + Math.trunc(Math.min(input3.shape[2] || 0, box4.endPoint[0]) - Math.max(0, box4.startPoint[0])), + Math.trunc(Math.min(input3.shape[1] || 0, box4.endPoint[1]) - Math.max(0, box4.startPoint[1])) ] : [0, 0, 0, 0]; -var getRawBox = (box4, input2) => box4 ? [ - box4.startPoint[0] / (input2.shape[2] || 0), - box4.startPoint[1] / (input2.shape[1] || 0), - (box4.endPoint[0] - box4.startPoint[0]) / (input2.shape[2] || 0), - (box4.endPoint[1] - box4.startPoint[1]) / (input2.shape[1] || 0) +var getRawBox = (box4, input3) => box4 ? [ + box4.startPoint[0] / (input3.shape[2] || 0), + box4.startPoint[1] / (input3.shape[1] || 0), + (box4.endPoint[0] - box4.startPoint[0]) / (input3.shape[2] || 0), + (box4.endPoint[1] - box4.startPoint[1]) / (input3.shape[1] || 0) ] : [0, 0, 0, 0]; var scaleBoxCoordinates = (box4, factor) => { const startPoint = [box4.startPoint[0] * factor[0], box4.startPoint[1] * factor[1]]; const endPoint = [box4.endPoint[0] * factor[0], box4.endPoint[1] * factor[1]]; return { startPoint, endPoint }; }; -var cutBoxFromImageAndResize = (box4, image7, cropSize) => { - const h = image7.shape[1]; - const w = image7.shape[2]; - return image.cropAndResize(image7, [[box4.startPoint[1] / h, box4.startPoint[0] / w, box4.endPoint[1] / h, box4.endPoint[0] / w]], [0], cropSize); +var cutBoxFromImageAndResize = (box4, image9, cropSize) => { + const h = image9.shape[1]; + const w = image9.shape[2]; + return image.cropAndResize(image9, [[box4.startPoint[1] / h, box4.startPoint[0] / w, box4.endPoint[1] / h, box4.endPoint[0] / w]], [0], cropSize); }; var enlargeBox = (box4, factor = 1.5) => { const center = getBoxCenter(box4); @@ -64711,12 +66880,12 @@ function transformRawCoords(rawCoords, box4, angle, rotationMatrix, inputSize8) Math.round(coord[2] || 0) ]); } -function correctFaceRotation(box4, input2, inputSize8) { +function correctFaceRotation(box4, input3, inputSize8) { const [indexOfMouth, indexOfForehead] = box4.landmarks.length >= meshLandmarks.count ? meshLandmarks.symmetryLine : blazeFaceLandmarks.symmetryLine; const angle = computeRotation(box4.landmarks[indexOfMouth], box4.landmarks[indexOfForehead]); const faceCenter = getBoxCenter({ startPoint: box4.startPoint, endPoint: box4.endPoint }); - const faceCenterNormalized = [faceCenter[0] / input2.shape[2], faceCenter[1] / input2.shape[1]]; - const rotated = image.rotateWithOffset(input2, angle, 0, faceCenterNormalized); + const faceCenterNormalized = [faceCenter[0] / input3.shape[2], faceCenter[1] / input3.shape[1]]; + const rotated = image.rotateWithOffset(input3, angle, 0, faceCenterNormalized); const rotationMatrix = buildRotationMatrix(-angle, faceCenter); const cut = cutBoxFromImageAndResize({ startPoint: box4.startPoint, endPoint: box4.endPoint }, rotated, [inputSize8, inputSize8]); const face5 = div(cut, 255); @@ -64778,8 +66947,8 @@ async function getBoxes(inputImage, config3) { const sorted = res.sort((a, b) => a.size - b.size); const concat384 = concat([sorted[0], sorted[2]], 2); const concat512 = concat([sorted[1], sorted[3]], 2); - const concat5 = concat([concat512, concat384], 1); - batchOut = squeeze(concat5, 0); + const concat8 = concat([concat512, concat384], 1); + batchOut = squeeze(concat8, 0); } else { batchOut = squeeze(res); } @@ -64949,10 +67118,10 @@ var model4 = null; var inputSize3 = 0; var skipped = Number.MAX_SAFE_INTEGER; var detectedFaces = 0; -async function predict(input2, config3) { +async function predict(input3, config3) { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; if (!config3.skipFrame || (detectedFaces !== ((_a = config3.face.detector) == null ? void 0 : _a.maxDetected) || !((_b = config3.face.mesh) == null ? void 0 : _b.enabled)) && skipped > (((_c = config3.face.detector) == null ? void 0 : _c.skipFrames) || 0)) { - const newBoxes2 = await getBoxes(input2, config3); + const newBoxes2 = await getBoxes(input3, config3); boxCache = []; for (const possible of newBoxes2.boxes) { const startPoint = await possible.box.startPoint.data(); @@ -64989,23 +67158,23 @@ async function predict(input2, config3) { annotations: {} }; if (((_d = config3.face.detector) == null ? void 0 : _d.rotation) && ((_e = config3.face.mesh) == null ? void 0 : _e.enabled) && env2.kernels.includes("rotatewithoffset")) { - [angle, rotationMatrix, face5.tensor] = correctFaceRotation(box4, input2, inputSize3); + [angle, rotationMatrix, face5.tensor] = correctFaceRotation(box4, input3, inputSize3); } else { rotationMatrix = IDENTITY_MATRIX; - const cut = cutBoxFromImageAndResize({ startPoint: box4.startPoint, endPoint: box4.endPoint }, input2, ((_f = config3.face.mesh) == null ? void 0 : _f.enabled) ? [inputSize3, inputSize3] : [size(), size()]); + const cut = cutBoxFromImageAndResize({ startPoint: box4.startPoint, endPoint: box4.endPoint }, input3, ((_f = config3.face.mesh) == null ? void 0 : _f.enabled) ? [inputSize3, inputSize3] : [size(), size()]); face5.tensor = div(cut, 255); dispose(cut); } face5.boxScore = Math.round(100 * box4.confidence) / 100; if (!((_g = config3.face.mesh) == null ? void 0 : _g.enabled)) { - face5.box = getClampedBox(box4, input2); - face5.boxRaw = getRawBox(box4, input2); + face5.box = getClampedBox(box4, input3); + face5.boxRaw = getRawBox(box4, input3); face5.score = Math.round(100 * box4.confidence || 0) / 100; face5.mesh = box4.landmarks.map((pt) => [ (box4.startPoint[0] + box4.endPoint[0]) / 2 + (box4.endPoint[0] + box4.startPoint[0]) * pt[0] / size(), (box4.startPoint[1] + box4.endPoint[1]) / 2 + (box4.endPoint[1] + box4.startPoint[1]) * pt[1] / size() ]); - face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input2.shape[2] || 0), pt[1] / (input2.shape[1] || 0), (pt[2] || 0) / inputSize3]); + face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input3.shape[2] || 0), pt[1] / (input3.shape[1] || 0), (pt[2] || 0) / inputSize3]); for (const key of Object.keys(blazeFaceLandmarks)) face5.annotations[key] = [face5.mesh[blazeFaceLandmarks[key]]]; } else if (!model4) { @@ -65026,16 +67195,16 @@ async function predict(input2, config3) { if ((_i = config3.face.iris) == null ? void 0 : _i.enabled) rawCoords = await augmentIris(rawCoords, face5.tensor, config3, inputSize3); face5.mesh = transformRawCoords(rawCoords, box4, angle, rotationMatrix, inputSize3); - face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input2.shape[2] || 0), pt[1] / (input2.shape[1] || 0), (pt[2] || 0) / inputSize3]); + face5.meshRaw = face5.mesh.map((pt) => [pt[0] / (input3.shape[2] || 0), pt[1] / (input3.shape[1] || 0), (pt[2] || 0) / inputSize3]); box4 = { ...enlargeBox(calculateLandmarksBoundingBox(face5.mesh), 1.5), confidence: box4.confidence }; for (const key of Object.keys(meshAnnotations)) face5.annotations[key] = meshAnnotations[key].map((index) => face5.mesh[index]); if (((_j = config3.face.detector) == null ? void 0 : _j.rotation) && config3.face.mesh.enabled && ((_k = config3.face.description) == null ? void 0 : _k.enabled) && env2.kernels.includes("rotatewithoffset")) { dispose(face5.tensor); - [angle, rotationMatrix, face5.tensor] = correctFaceRotation(box4, input2, inputSize3); + [angle, rotationMatrix, face5.tensor] = correctFaceRotation(box4, input3, inputSize3); } - face5.box = getClampedBox(box4, input2); - face5.boxRaw = getRawBox(box4, input2); + face5.box = getClampedBox(box4, input3); + face5.boxRaw = getRawBox(box4, input3); face5.score = Math.round(100 * faceConfidence || 100 * box4.confidence || 0) / 100; face5.faceScore = Math.round(100 * faceConfidence) / 100; box4 = { ...squarifyBox(box4), confidence: box4.confidence, faceConfidence }; @@ -65092,32 +67261,32 @@ async function load4(config3) { log("cached model:", modelUrl); return model5; } -function enhance(input2) { - const image7 = tidy(() => { - const tensor2 = input2.image || input2.tensor || input2; - if (!(tensor2 instanceof Tensor)) +function enhance(input3) { + const image9 = tidy(() => { + const tensor3 = input3.image || input3.tensor || input3; + if (!(tensor3 instanceof Tensor)) return null; const box4 = [[0.05, 0.15, 0.85, 0.85]]; if (!(model5 == null ? void 0 : model5.inputs[0].shape)) return null; - const crop = tensor2.shape.length === 3 ? image.cropAndResize(expandDims(tensor2, 0), box4, [0], [model5.inputs[0].shape[2], model5.inputs[0].shape[1]]) : image.cropAndResize(tensor2, box4, [0], [model5.inputs[0].shape[2], model5.inputs[0].shape[1]]); - const norm2 = mul(crop, 255); - return norm2; + const crop = tensor3.shape.length === 3 ? image.cropAndResize(expandDims(tensor3, 0), box4, [0], [model5.inputs[0].shape[2], model5.inputs[0].shape[1]]) : image.cropAndResize(tensor3, box4, [0], [model5.inputs[0].shape[2], model5.inputs[0].shape[1]]); + const norm3 = mul(crop, 255); + return norm3; }); - return image7; + return image9; } -async function predict2(image7, config3, idx, count3) { +async function predict2(image9, config3, idx, count4) { var _a, _b, _c; if (!model5) return null; - if (skipped2 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count3 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) { + if (skipped2 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount === count4 && ((_b = last[idx]) == null ? void 0 : _b.age) && ((_c = last[idx]) == null ? void 0 : _c.age) > 0) { skipped2++; return last[idx]; } skipped2 = 0; return new Promise(async (resolve) => { var _a2, _b2; - const enhanced = enhance(image7); + const enhanced = enhance(image9); let resT; const obj = { age: 0, @@ -65138,15 +67307,15 @@ async function predict2(image7, config3, idx, count3) { const argmax2 = argMax(resT.find((t) => t.shape[1] === 100), 1); const age = (await argmax2.data())[0]; dispose(argmax2); - const all6 = await resT.find((t) => t.shape[1] === 100).data(); - obj.age = Math.round(all6[age - 1] > all6[age + 1] ? 10 * age - 100 * all6[age - 1] : 10 * age + 100 * all6[age + 1]) / 10; + const all9 = await resT.find((t) => t.shape[1] === 100).data(); + obj.age = Math.round(all9[age - 1] > all9[age + 1] ? 10 * age - 100 * all9[age - 1] : 10 * age + 100 * all9[age + 1]) / 10; const desc = resT.find((t) => t.shape[1] === 1024); const descriptor = await desc.data(); obj.descriptor = [...descriptor]; resT.forEach((t) => dispose(t)); } last[idx] = obj; - lastCount = count3; + lastCount = count4; resolve(obj); }); } @@ -65172,18 +67341,18 @@ async function load5(config3) { log("cached model:", model6["modelUrl"]); return model6; } -async function predict3(image7, config3, idx, count3) { +async function predict3(image9, config3, idx, count4) { var _a; if (!model6) return null; - if (skipped3 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count3 && last2[idx] && last2[idx].length > 0) { + if (skipped3 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && lastCount2 === count4 && last2[idx] && last2[idx].length > 0) { skipped3++; return last2[idx]; } skipped3 = 0; return new Promise(async (resolve) => { var _a2, _b; - const resize = image.resizeBilinear(image7, [(model6 == null ? void 0 : model6.inputs[0].shape) ? model6.inputs[0].shape[2] : 0, (model6 == null ? void 0 : model6.inputs[0].shape) ? model6.inputs[0].shape[1] : 0], false); + const resize = image.resizeBilinear(image9, [(model6 == null ? void 0 : model6.inputs[0].shape) ? model6.inputs[0].shape[2] : 0, (model6 == null ? void 0 : model6.inputs[0].shape) ? model6.inputs[0].shape[1] : 0], false); const [red, green, blue] = split(resize, 3, 3); dispose(resize); const redNorm = mul(red, rgb[0]); @@ -65211,7 +67380,7 @@ async function predict3(image7, config3, idx, count3) { } dispose(normalize); last2[idx] = obj; - lastCount2 = count3; + lastCount2 = count4; resolve(obj); }); } @@ -65320,11 +67489,11 @@ var MaxHeap = class { this.swim(this.numberOfElements); } dequeue() { - const max6 = this.priorityQueue[0]; + const max10 = this.priorityQueue[0]; this.exchange(0, this.numberOfElements--); this.sink(0); this.priorityQueue[this.numberOfElements + 1] = null; - return max6; + return max10; } empty() { return this.numberOfElements === -1; @@ -65381,11 +67550,11 @@ function getImageCoords(part, outputStride2, offsets) { y: part.heatmapY * outputStride2 + y }; } -function clamp2(a, min6, max6) { - if (a < min6) - return min6; - if (a > max6) - return max6; +function clamp2(a, min10, max10) { + if (a < min10) + return min10; + if (a > max10) + return max10; return a; } function squaredDistance(y1, x1, y2, x2) { @@ -65524,24 +67693,24 @@ function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected } return poses; } -async function predict4(input2, config3) { +async function predict4(input3, config3) { const res = tidy(() => { if (!model7.inputs[0].shape) return []; - const resized = image.resizeBilinear(input2, [model7.inputs[0].shape[2], model7.inputs[0].shape[1]]); + const resized = image.resizeBilinear(input3, [model7.inputs[0].shape[2], model7.inputs[0].shape[1]]); const normalized = sub(div(cast(resized, "float32"), 127.5), 1); const results = model7.execute(normalized, poseNetOutputs); const results3d = results.map((y) => squeeze(y, [0])); results3d[1] = results3d[1].sigmoid(); return results3d; }); - const buffers = await Promise.all(res.map((tensor2) => tensor2.buffer())); + const buffers = await Promise.all(res.map((tensor3) => tensor3.buffer())); for (const t of res) dispose(t); const decoded = await decode(buffers[0], buffers[1], buffers[2], buffers[3], config3.body.maxDetected, config3.body.minConfidence); if (!model7.inputs[0].shape) return []; - const scaled = scalePoses(decoded, [input2.shape[1], input2.shape[2]], [model7.inputs[0].shape[2], model7.inputs[0].shape[1]]); + const scaled = scalePoses(decoded, [input3.shape[1], input3.shape[2]], [model7.inputs[0].shape[2], model7.inputs[0].shape[1]]); return scaled; } async function load6(config3) { @@ -65569,16 +67738,16 @@ function getBoxCenter2(box4) { box4.startPoint[1] + (box4.endPoint[1] - box4.startPoint[1]) / 2 ]; } -function cutBoxFromImageAndResize2(box4, image7, cropSize) { - const h = image7.shape[1]; - const w = image7.shape[2]; +function cutBoxFromImageAndResize2(box4, image9, cropSize) { + const h = image9.shape[1]; + const w = image9.shape[2]; const boxes = [[ box4.startPoint[1] / h, box4.startPoint[0] / w, box4.endPoint[1] / h, box4.endPoint[0] / w ]]; - return image.cropAndResize(image7, boxes, [0], cropSize); + return image.cropAndResize(image9, boxes, [0], cropSize); } function scaleBoxCoordinates2(box4, factor) { const startPoint = [box4.startPoint[0] * factor[0], box4.startPoint[1] * factor[1]]; @@ -68557,14 +70726,14 @@ var anchors2 = [ // src/handpose/handdetector.ts var HandDetector = class { - constructor(model14) { + constructor(model15) { __publicField(this, "model"); __publicField(this, "anchors"); __publicField(this, "anchorsTensor"); __publicField(this, "inputSize"); __publicField(this, "inputSizeTensor"); __publicField(this, "doubleInputSizeTensor"); - this.model = model14; + this.model = model15; this.anchors = anchors2.map((anchor) => [anchor.x, anchor.y]); this.anchorsTensor = tensor2d(this.anchors); this.inputSize = this.model && this.model.inputs && this.model.inputs[0].shape ? this.model.inputs[0].shape[2] : 0; @@ -68588,9 +70757,9 @@ var HandDetector = class { return mul(landmarks, this.inputSizeTensor); }); } - async getBoxes(input2, config3) { + async getBoxes(input3, config3) { const t = {}; - t.batched = this.model.predict(input2); + t.batched = this.model.predict(input3); t.predictions = squeeze(t.batched); t.scores = tidy(() => squeeze(sigmoid(slice(t.predictions, [0, 0], [-1, 1])))); const scores = await t.scores.data(); @@ -68604,16 +70773,16 @@ var HandDetector = class { const palmLandmarks = tidy(() => reshape(this.normalizeLandmarks(slice(t.predictions, [index, 5], [1, 14]), index), [-1, 2])); hands.push({ box: palmBox, palmLandmarks, confidence: scores[index] }); } - for (const tensor2 of Object.keys(t)) - dispose(t[tensor2]); + for (const tensor3 of Object.keys(t)) + dispose(t[tensor3]); return hands; } - async estimateHandBounds(input2, config3) { - const inputHeight = input2.shape[1]; - const inputWidth = input2.shape[2]; - const image7 = tidy(() => sub(div(image.resizeBilinear(input2, [this.inputSize, this.inputSize]), 127.5), 1)); - const predictions = await this.getBoxes(image7, config3); - dispose(image7); + async estimateHandBounds(input3, config3) { + const inputHeight = input3.shape[1]; + const inputWidth = input3.shape[2]; + const image9 = tidy(() => sub(div(image.resizeBilinear(input3, [this.inputSize, this.inputSize]), 127.5), 1)); + const predictions = await this.getBoxes(image9, config3); + dispose(image9); const hands = []; if (!predictions || predictions.length === 0) return hands; @@ -68760,11 +70929,11 @@ var HandPipeline = class { Math.trunc(coord[2]) ]); } - async estimateHands(image7, config3) { + async estimateHands(image9, config3) { let useFreshBox = false; let boxes; if (this.skipped === 0 || this.skipped > config3.hand.skipFrames || !config3.hand.landmarks || !config3.skipFrame) { - boxes = await this.handDetector.estimateHandBounds(image7, config3); + boxes = await this.handDetector.estimateHandBounds(image9, config3); this.skipped = 0; } if (config3.skipFrame) @@ -68783,8 +70952,8 @@ var HandPipeline = class { if (config3.hand.landmarks) { const angle = config3.hand.rotation ? computeRotation2(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0; const palmCenter = getBoxCenter2(currentBox); - const palmCenterNormalized = [palmCenter[0] / image7.shape[2], palmCenter[1] / image7.shape[1]]; - const rotatedImage = config3.hand.rotation && env2.kernels.includes("rotatewithoffset") ? image.rotateWithOffset(image7, angle, 0, palmCenterNormalized) : image7.clone(); + const palmCenterNormalized = [palmCenter[0] / image9.shape[2], palmCenter[1] / image9.shape[1]]; + const rotatedImage = config3.hand.rotation && env2.kernels.includes("rotatewithoffset") ? image.rotateWithOffset(image9, angle, 0, palmCenterNormalized) : image9.clone(); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const croppedInput = cutBoxFromImageAndResize2(newBox, rotatedImage, [this.inputSize, this.inputSize]); @@ -68800,11 +70969,11 @@ var HandPipeline = class { const rawCoords = await keypointsReshaped.array(); dispose(keypoints3); dispose(keypointsReshaped); - const coords5 = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix); - const nextBoundingBox = this.getBoxForHandLandmarks(coords5); + const coords9 = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix); + const nextBoundingBox = this.getBoxForHandLandmarks(coords9); this.storedBoxes[i] = { ...nextBoundingBox, confidence }; const result = { - landmarks: coords5, + landmarks: coords9, confidence, boxConfidence: currentBox.confidence, fingerConfidence: confidence, @@ -69225,16 +71394,16 @@ var meshAnnotations2 = { var handDetectorModel; var handPoseModel; var handPipeline; -async function predict5(input2, config3) { - const predictions = await handPipeline.estimateHands(input2, config3); +async function predict5(input3, config3) { + const predictions = await handPipeline.estimateHands(input3, config3); if (!predictions) return []; const hands = []; for (let i = 0; i < predictions.length; i++) { - const annotations3 = {}; + const annotations2 = {}; if (predictions[i].landmarks) { for (const key of Object.keys(meshAnnotations2)) { - annotations3[key] = meshAnnotations2[key].map((index) => predictions[i].landmarks[index]); + annotations2[key] = meshAnnotations2[key].map((index) => predictions[i].landmarks[index]); } } const keypoints3 = predictions[i].landmarks; @@ -69253,19 +71422,19 @@ async function predict5(input2, config3) { } box4[2] -= box4[0]; box4[3] -= box4[1]; - boxRaw2 = [box4[0] / (input2.shape[2] || 0), box4[1] / (input2.shape[1] || 0), box4[2] / (input2.shape[2] || 0), box4[3] / (input2.shape[1] || 0)]; + boxRaw2 = [box4[0] / (input3.shape[2] || 0), box4[1] / (input3.shape[1] || 0), box4[2] / (input3.shape[2] || 0), box4[3] / (input3.shape[1] || 0)]; } else { box4 = predictions[i].box ? [ Math.trunc(Math.max(0, predictions[i].box.topLeft[0])), Math.trunc(Math.max(0, predictions[i].box.topLeft[1])), - Math.trunc(Math.min(input2.shape[2] || 0, predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])), - Math.trunc(Math.min(input2.shape[1] || 0, predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])) + Math.trunc(Math.min(input3.shape[2] || 0, predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])), + Math.trunc(Math.min(input3.shape[1] || 0, predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])) ] : [0, 0, 0, 0]; boxRaw2 = [ - predictions[i].box.topLeft[0] / (input2.shape[2] || 0), - predictions[i].box.topLeft[1] / (input2.shape[1] || 0), - (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input2.shape[2] || 0), - (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input2.shape[1] || 0) + predictions[i].box.topLeft[0] / (input3.shape[2] || 0), + predictions[i].box.topLeft[1] / (input3.shape[1] || 0), + (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input3.shape[2] || 0), + (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input3.shape[1] || 0) ]; } const landmarks = analyze(keypoints3); @@ -69278,7 +71447,7 @@ async function predict5(input2, config3) { box: box4, boxRaw: boxRaw2, keypoints: keypoints3, - annotations: annotations3, + annotations: annotations2, landmarks }); } @@ -69317,9 +71486,9 @@ async function load7(config3) { } // src/util/box.ts -function scale2(keypoints3, boxScaleFact2, outputSize3) { - const coords5 = [keypoints3.map((pt) => pt[0]), keypoints3.map((pt) => pt[1])]; - const maxmin = [Math.max(...coords5[0]), Math.min(...coords5[0]), Math.max(...coords5[1]), Math.min(...coords5[1])]; +function scale2(keypoints3, boxScaleFact2, outputSize2) { + const coords9 = [keypoints3.map((pt) => pt[0]), keypoints3.map((pt) => pt[1])]; + const maxmin = [Math.max(...coords9[0]), Math.min(...coords9[0]), Math.max(...coords9[1]), Math.min(...coords9[1])]; const center = [(maxmin[0] + maxmin[1]) / 2, (maxmin[2] + maxmin[3]) / 2]; const diff = Math.max(center[0] - maxmin[1], center[1] - maxmin[3], -center[0] + maxmin[0], -center[1] + maxmin[2]) * boxScaleFact2; const box4 = [ @@ -69329,10 +71498,10 @@ function scale2(keypoints3, boxScaleFact2, outputSize3) { Math.trunc(2 * diff) ]; const boxRaw2 = [ - box4[0] / outputSize3[0], - box4[1] / outputSize3[1], - box4[2] / outputSize3[0], - box4[3] / outputSize3[1] + box4[0] / outputSize2[0], + box4[1] / outputSize2[1], + box4[2] / outputSize2[0], + box4[3] / outputSize2[1] ]; const yxBox = [ boxRaw2[1], @@ -69399,15 +71568,15 @@ async function loadSkeleton(config3) { log("cached model:", models[1]["modelUrl"]); return models[1]; } -async function detectHands(input2, config3) { +async function detectHands(input3, config3) { const hands = []; - if (!input2 || !models[0]) + if (!input3 || !models[0]) return hands; const t = {}; - const ratio = (input2.shape[2] || 1) / (input2.shape[1] || 1); - const height = Math.min(Math.round((input2.shape[1] || 0) / 8) * 8, 512); + const ratio = (input3.shape[2] || 1) / (input3.shape[1] || 1); + const height = Math.min(Math.round((input3.shape[1] || 0) / 8) * 8, 512); const width = Math.round(height * ratio / 8) * 8; - t.resize = image.resizeBilinear(input2, [height, width]); + t.resize = image.resizeBilinear(input3, [height, width]); t.cast = cast(t.resize, "int32"); [t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes); t.boxes = squeeze(t.rawBoxes, [0, 2]); @@ -69441,14 +71610,14 @@ async function detectHands(input2, config3) { hands.push(hand3); } } - classScores.forEach((tensor2) => dispose(tensor2)); - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + classScores.forEach((tensor3) => dispose(tensor3)); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); hands.sort((a, b) => b.score - a.score); if (hands.length > (config3.hand.maxDetected || 1)) hands.length = config3.hand.maxDetected || 1; return hands; } -async function detectFingers(input2, h, config3) { +async function detectFingers(input3, h, config3) { const hand3 = { id: h.id, score: Math.round(100 * h.score) / 100, @@ -69461,11 +71630,11 @@ async function detectFingers(input2, h, config3) { landmarks: {}, annotations: {} }; - if (input2 && models[1] && config3.hand.landmarks) { + if (input3 && models[1] && config3.hand.landmarks) { const t = {}; if (!h.yxBox) return hand3; - t.crop = image.cropAndResize(input2, [h.yxBox], [0], [inputSize4[1][0], inputSize4[1][1]], "bilinear"); + t.crop = image.cropAndResize(input3, [h.yxBox], [0], [inputSize4[1][0], inputSize4[1][1]], "bilinear"); t.cast = cast(t.crop, "float32"); t.div = div(t.cast, 255); [t.score, t.keypoints] = models[1].execute(t.div); @@ -69489,16 +71658,16 @@ async function detectFingers(input2, h, config3) { for (const key of Object.keys(fingerMap)) { hand3.annotations[key] = fingerMap[key].map((index) => hand3.landmarks && hand3.keypoints[index] ? hand3.keypoints[index] : null); } - const ratioBoxFrame = Math.min(h.box[2] / (input2.shape[2] || 1), h.box[3] / (input2.shape[1] || 1)); + const ratioBoxFrame = Math.min(h.box[2] / (input3.shape[2] || 1), h.box[3] / (input3.shape[1] || 1)); if (ratioBoxFrame > 0.05) cache.tmpBoxes.push(h); } - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); } return hand3; } -async function predict6(input2, config3) { - outputSize = [input2.shape[2] || 0, input2.shape[1] || 0]; +async function predict6(input3, config3) { + outputSize = [input3.shape[2] || 0, input3.shape[1] || 0]; let hands = []; cache.tmpBoxes = []; if (!config3.hand.landmarks) @@ -69507,21 +71676,50546 @@ async function predict6(input2, config3) { cache.fingerBoxes = []; if (skipped4 < (config3.hand.skipFrames || 0) && config3.skipFrame) { skipped4++; - hands = await Promise.all(cache.fingerBoxes.map((hand3) => detectFingers(input2, hand3, config3))); + hands = await Promise.all(cache.fingerBoxes.map((hand3) => detectFingers(input3, hand3, config3))); } else { skipped4 = 0; - hands = await Promise.all(cache.fingerBoxes.map((hand3) => detectFingers(input2, hand3, config3))); + hands = await Promise.all(cache.fingerBoxes.map((hand3) => detectFingers(input3, hand3, config3))); if (hands.length !== config3.hand.maxDetected) { - cache.handBoxes = await detectHands(input2, config3); - hands = await Promise.all(cache.handBoxes.map((hand3) => detectFingers(input2, hand3, config3))); + cache.handBoxes = await detectHands(input3, config3); + hands = await Promise.all(cache.handBoxes.map((hand3) => detectFingers(input3, hand3, config3))); } } cache.fingerBoxes = [...cache.tmpBoxes]; return hands; } -// src/body/annotations.ts -var full = [ +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/backend.js +var EPSILON_FLOAT323 = 1e-7; +var EPSILON_FLOAT163 = 1e-4; +var DataStorage2 = class { + constructor(backend4, dataMover) { + this.backend = backend4; + this.dataMover = dataMover; + this.data = new WeakMap(); + this.dataIdsCount = 0; + } + get(dataId) { + if (!this.data.has(dataId)) { + this.dataMover.moveData(this.backend, dataId); + } + return this.data.get(dataId); + } + set(dataId, value) { + this.dataIdsCount++; + this.data.set(dataId, value); + } + has(dataId) { + return this.data.has(dataId); + } + delete(dataId) { + this.dataIdsCount--; + return this.data.delete(dataId); + } + numDataIds() { + return this.dataIdsCount; + } +}; +var KernelBackend2 = class { + refCount(dataId) { + return notYetImplemented2("refCount"); + } + incRef(dataId) { + return notYetImplemented2("incRef"); + } + timerAvailable() { + return true; + } + time(f) { + return notYetImplemented2("time"); + } + read(dataId) { + return notYetImplemented2("read"); + } + readSync(dataId) { + return notYetImplemented2("readSync"); + } + numDataIds() { + return notYetImplemented2("numDataIds"); + } + disposeData(dataId, force) { + return notYetImplemented2("disposeData"); + } + write(values, shape, dtype) { + return notYetImplemented2("write"); + } + move(dataId, values, shape, dtype, refCount) { + return notYetImplemented2("move"); + } + memory() { + return notYetImplemented2("memory"); + } + floatPrecision() { + return notYetImplemented2("floatPrecision"); + } + epsilon() { + return this.floatPrecision() === 32 ? EPSILON_FLOAT323 : EPSILON_FLOAT163; + } + dispose() { + return notYetImplemented2("dispose"); + } +}; +function notYetImplemented2(kernelName) { + throw new Error(`'${kernelName}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/util_base.js +function shuffle2(array3) { + let counter = array3.length; + let index = 0; + while (counter > 0) { + index = Math.random() * counter | 0; + counter--; + swap2(array3, counter, index); + } +} +function shuffleCombo2(array3, array22) { + if (array3.length !== array22.length) { + throw new Error(`Array sizes must match to be shuffled together First array length was ${array3.length}Second array length was ${array22.length}`); + } + let counter = array3.length; + let index = 0; + while (counter > 0) { + index = Math.random() * counter | 0; + counter--; + swap2(array3, counter, index); + swap2(array22, counter, index); + } +} +function clamp3(min10, x, max10) { + return Math.max(min10, Math.min(x, max10)); +} +function nearestLargerEven2(val) { + return val % 2 === 0 ? val : val + 1; +} +function swap2(object2, left, right) { + const temp = object2[left]; + object2[left] = object2[right]; + object2[right] = temp; +} +function sum6(arr) { + let sum10 = 0; + for (let i = 0; i < arr.length; i++) { + sum10 += arr[i]; + } + return sum10; +} +function randUniform2(a, b) { + const r = Math.random(); + return b * r + (1 - r) * a; +} +function distSquared2(a, b) { + let result = 0; + for (let i = 0; i < a.length; i++) { + const diff = Number(a[i]) - Number(b[i]); + result += diff * diff; + } + return result; +} +function assert3(expr, msg) { + if (!expr) { + throw new Error(typeof msg === "string" ? msg : msg()); + } +} +function assertShapesMatch2(shapeA, shapeB, errorMessagePrefix = "") { + assert3(arraysEqual2(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); +} +function assertNonNull2(a) { + assert3(a != null, () => `The input to the tensor constructor must be a non-null value.`); +} +function flatten4(arr, result = [], skipTypedArray = false) { + if (result == null) { + result = []; + } + if (Array.isArray(arr) || isTypedArray2(arr) && !skipTypedArray) { + for (let i = 0; i < arr.length; ++i) { + flatten4(arr[i], result, skipTypedArray); + } + } else { + result.push(arr); + } + return result; +} +function sizeFromShape2(shape) { + if (shape.length === 0) { + return 1; + } + let size2 = shape[0]; + for (let i = 1; i < shape.length; i++) { + size2 *= shape[i]; + } + return size2; +} +function isScalarShape2(shape) { + return shape.length === 0; +} +function arraysEqual2(n1, n2) { + if (n1 === n2) { + return true; + } + if (n1 == null || n2 == null) { + return false; + } + if (n1.length !== n2.length) { + return false; + } + for (let i = 0; i < n1.length; i++) { + if (n1[i] !== n2[i]) { + return false; + } + } + return true; +} +function isInt2(a) { + return a % 1 === 0; +} +function tanh5(x) { + if (Math.tanh != null) { + return Math.tanh(x); + } + if (x === Infinity) { + return 1; + } else if (x === -Infinity) { + return -1; + } else { + const e2x = Math.exp(2 * x); + return (e2x - 1) / (e2x + 1); + } +} +function sizeToSquarishShape2(size2) { + const width = Math.ceil(Math.sqrt(size2)); + return [width, Math.ceil(size2 / width)]; +} +function createShuffledIndices2(n) { + const shuffledIndices = new Uint32Array(n); + for (let i = 0; i < n; ++i) { + shuffledIndices[i] = i; + } + shuffle2(shuffledIndices); + return shuffledIndices; +} +function rightPad2(a, size2) { + if (size2 <= a.length) { + return a; + } + return a + " ".repeat(size2 - a.length); +} +function repeatedTry2(checkFn, delayFn = (counter) => 0, maxCounter) { + return new Promise((resolve, reject) => { + let tryCount = 0; + const tryFn = () => { + if (checkFn()) { + resolve(); + return; + } + tryCount++; + const nextBackoff = delayFn(tryCount); + if (maxCounter != null && tryCount >= maxCounter) { + reject(); + return; + } + setTimeout(tryFn, nextBackoff); + }; + tryFn(); + }); +} +function inferFromImplicitShape2(shape, size2) { + let shapeProd = 1; + let implicitIdx = -1; + for (let i = 0; i < shape.length; ++i) { + if (shape[i] >= 0) { + shapeProd *= shape[i]; + } else if (shape[i] === -1) { + if (implicitIdx !== -1) { + throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${implicitIdx} and dim ${i}`); + } + implicitIdx = i; + } else if (shape[i] < 0) { + throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`); + } + } + if (implicitIdx === -1) { + if (size2 > 0 && size2 !== shapeProd) { + throw Error(`Size(${size2}) must match the product of shape ${shape}`); + } + return shape; + } + if (shapeProd === 0) { + throw Error(`Cannot infer the missing size in [${shape}] when there are 0 elements`); + } + if (size2 % shapeProd !== 0) { + throw Error(`The implicit shape can't be a fractional number. Got ${size2} / ${shapeProd}`); + } + const newShape = shape.slice(); + newShape[implicitIdx] = size2 / shapeProd; + return newShape; +} +function parseAxisParam2(axis, shape) { + const rank = shape.length; + axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); + assert3(axis.every((ax) => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but got axis ${axis}`); + assert3(axis.every((ax) => isInt2(ax)), () => `All values in axis param must be integers but got axis ${axis}`); + return axis.map((a) => a < 0 ? rank + a : a); +} +function squeezeShape2(shape, axis) { + const newShape = []; + const keptDims = []; + const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; + const axes = axis == null || isEmptyArray ? null : parseAxisParam2(axis, shape).sort(); + let j = 0; + for (let i = 0; i < shape.length; ++i) { + if (axes != null) { + if (axes[j] === i && shape[i] !== 1) { + throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); + } + if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + if (axes[j] <= i) { + j++; + } + } + if (shape[i] !== 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + } + return { newShape, keptDims }; +} +function getTypedArrayFromDType2(dtype, size2) { + let values = null; + if (dtype == null || dtype === "float32") { + values = new Float32Array(size2); + } else if (dtype === "int32") { + values = new Int32Array(size2); + } else if (dtype === "bool") { + values = new Uint8Array(size2); + } else { + throw new Error(`Unknown data type ${dtype}`); + } + return values; +} +function getArrayFromDType2(dtype, size2) { + let values = null; + if (dtype == null || dtype === "float32") { + values = new Float32Array(size2); + } else if (dtype === "int32") { + values = new Int32Array(size2); + } else if (dtype === "bool") { + values = new Uint8Array(size2); + } else if (dtype === "string") { + values = new Array(size2); + } else { + throw new Error(`Unknown data type ${dtype}`); + } + return values; +} +function checkConversionForErrors2(vals, dtype) { + for (let i = 0; i < vals.length; i++) { + const num = vals[i]; + if (isNaN(num) || !isFinite(num)) { + throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); + } + } +} +function isValidDtype2(dtype) { + return dtype === "bool" || dtype === "complex64" || dtype === "float32" || dtype === "int32" || dtype === "string"; +} +function hasEncodingLoss2(oldType, newType) { + if (newType === "complex64") { + return false; + } + if (newType === "float32" && oldType !== "complex64") { + return false; + } + if (newType === "int32" && oldType !== "float32" && oldType !== "complex64") { + return false; + } + if (newType === "bool" && oldType === "bool") { + return false; + } + return true; +} +function isTypedArray2(a) { + return a instanceof Float32Array || a instanceof Int32Array || a instanceof Uint8Array; +} +function bytesPerElement2(dtype) { + if (dtype === "float32" || dtype === "int32") { + return 4; + } else if (dtype === "complex64") { + return 8; + } else if (dtype === "bool") { + return 1; + } else { + throw new Error(`Unknown dtype ${dtype}`); + } +} +function bytesFromStringArray2(arr) { + if (arr == null) { + return 0; + } + let bytes = 0; + arr.forEach((x) => bytes += x.length); + return bytes; +} +function isString2(value) { + return typeof value === "string" || value instanceof String; +} +function isBoolean2(value) { + return typeof value === "boolean"; +} +function isNumber2(value) { + return typeof value === "number"; +} +function inferDtype2(values) { + if (Array.isArray(values)) { + return inferDtype2(values[0]); + } + if (values instanceof Float32Array) { + return "float32"; + } else if (values instanceof Int32Array || values instanceof Uint8Array) { + return "int32"; + } else if (isNumber2(values)) { + return "float32"; + } else if (isString2(values)) { + return "string"; + } else if (isBoolean2(values)) { + return "bool"; + } + return "float32"; +} +function isFunction2(f) { + return !!(f && f.constructor && f.call && f.apply); +} +function nearestDivisor2(size2, start) { + for (let i = start; i < size2; ++i) { + if (size2 % i === 0) { + return i; + } + } + return size2; +} +function computeStrides2(shape) { + const rank = shape.length; + if (rank < 2) { + return []; + } + const strides = new Array(rank - 1); + strides[rank - 2] = shape[rank - 1]; + for (let i = rank - 3; i >= 0; --i) { + strides[i] = strides[i + 1] * shape[i + 1]; + } + return strides; +} +function createNestedArray2(offset, shape, a, isComplex = false) { + const ret = new Array(); + if (shape.length === 1) { + const d = shape[0] * (isComplex ? 2 : 1); + for (let i = 0; i < d; i++) { + ret[i] = a[offset + i]; + } + } else { + const d = shape[0]; + const rest = shape.slice(1); + const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); + for (let i = 0; i < d; i++) { + ret[i] = createNestedArray2(offset + i * len, rest, a, isComplex); + } + } + return ret; +} +function toNestedArray2(shape, a, isComplex = false) { + if (shape.length === 0) { + return a[0]; + } + const size2 = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1); + if (size2 === 0) { + return []; + } + if (size2 !== a.length) { + throw new Error(`[${shape}] does not match the input size ${a.length}${isComplex ? " for a complex tensor" : ""}.`); + } + return createNestedArray2(0, shape, a, isComplex); +} +function makeOnesTypedArray2(size2, dtype) { + const array3 = makeZerosTypedArray2(size2, dtype); + for (let i = 0; i < array3.length; i++) { + array3[i] = 1; + } + return array3; +} +function makeZerosTypedArray2(size2, dtype) { + if (dtype == null || dtype === "float32" || dtype === "complex64") { + return new Float32Array(size2); + } else if (dtype === "int32") { + return new Int32Array(size2); + } else if (dtype === "bool") { + return new Uint8Array(size2); + } else { + throw new Error(`Unknown data type ${dtype}`); + } +} +function makeZerosNestedTypedArray2(shape, dtype) { + const size2 = shape.reduce((prev, curr) => prev * curr, 1); + if (dtype == null || dtype === "float32") { + return toNestedArray2(shape, new Float32Array(size2)); + } else if (dtype === "int32") { + return toNestedArray2(shape, new Int32Array(size2)); + } else if (dtype === "bool") { + return toNestedArray2(shape, new Uint8Array(size2)); + } else { + throw new Error(`Unknown data type ${dtype}`); + } +} +function assertNonNegativeIntegerDimensions2(shape) { + shape.forEach((dimSize) => { + assert3(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got shape [${shape}].`); + }); +} +function locToIndex2(locs, rank, strides) { + if (rank === 0) { + return 0; + } else if (rank === 1) { + return locs[0]; + } + let index = locs[locs.length - 1]; + for (let i = 0; i < locs.length - 1; ++i) { + index += strides[i] * locs[i]; + } + return index; +} +function indexToLoc2(index, rank, strides) { + if (rank === 0) { + return []; + } else if (rank === 1) { + return [index]; + } + const locs = new Array(rank); + for (let i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / strides[i]); + index -= locs[i] * strides[i]; + } + locs[locs.length - 1] = index; + return locs; +} +function isPromise2(object2) { + return object2 && object2.then && typeof object2.then === "function"; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/log.js +function warn2(...msg) { + if (!(env3().getBool("IS_TEST") || env3().getBool("PROD"))) { + console.warn(...msg); + } +} +function log3(...msg) { + if (!(env3().getBool("IS_TEST") || env3().getBool("PROD"))) { + console.log(...msg); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/environment.js +var TENSORFLOWJS_FLAGS_PREFIX2 = "tfjsflags"; +var Environment2 = class { + constructor(global2) { + this.global = global2; + this.flags = {}; + this.flagRegistry = {}; + this.urlFlags = {}; + this.getQueryParams = getQueryParams2; + this.populateURLFlags(); + } + setPlatform(platformName, platform) { + if (this.platform != null) { + warn2(`Platform ${this.platformName} has already been set. Overwriting the platform with ${platform}.`); + } + this.platformName = platformName; + this.platform = platform; + } + registerFlag(flagName, evaluationFn, setHook) { + this.flagRegistry[flagName] = { evaluationFn, setHook }; + if (this.urlFlags[flagName] != null) { + const flagValue = this.urlFlags[flagName]; + warn2(`Setting feature override from URL ${flagName}: ${flagValue}.`); + this.set(flagName, flagValue); + } + } + async getAsync(flagName) { + if (flagName in this.flags) { + return this.flags[flagName]; + } + this.flags[flagName] = await this.evaluateFlag(flagName); + return this.flags[flagName]; + } + get(flagName) { + if (flagName in this.flags) { + return this.flags[flagName]; + } + const flagValue = this.evaluateFlag(flagName); + if (isPromise2(flagValue)) { + throw new Error(`Flag ${flagName} cannot be synchronously evaluated. Please use getAsync() instead.`); + } + this.flags[flagName] = flagValue; + return this.flags[flagName]; + } + getNumber(flagName) { + return this.get(flagName); + } + getBool(flagName) { + return this.get(flagName); + } + getFlags() { + return this.flags; + } + get features() { + return this.flags; + } + set(flagName, value) { + if (this.flagRegistry[flagName] == null) { + throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); + } + this.flags[flagName] = value; + if (this.flagRegistry[flagName].setHook != null) { + this.flagRegistry[flagName].setHook(value); + } + } + evaluateFlag(flagName) { + if (this.flagRegistry[flagName] == null) { + throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); + } + return this.flagRegistry[flagName].evaluationFn(); + } + setFlags(flags) { + this.flags = Object.assign({}, flags); + } + reset() { + this.flags = {}; + this.urlFlags = {}; + this.populateURLFlags(); + } + populateURLFlags() { + if (typeof this.global === "undefined" || typeof this.global.location === "undefined" || typeof this.global.location.search === "undefined") { + return; + } + const urlParams = this.getQueryParams(this.global.location.search); + if (TENSORFLOWJS_FLAGS_PREFIX2 in urlParams) { + const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX2].split(","); + keyValues.forEach((keyValue) => { + const [key, value] = keyValue.split(":"); + this.urlFlags[key] = parseValue2(key, value); + }); + } + } +}; +function getQueryParams2(queryString) { + const params = {}; + queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { + decodeParam2(params, t[0], t[1]); + return t.join("="); + }); + return params; +} +function decodeParam2(params, name, value) { + params[decodeURIComponent(name)] = decodeURIComponent(value || ""); +} +function parseValue2(flagName, value) { + value = value.toLowerCase(); + if (value === "true" || value === "false") { + return value === "true"; + } else if (`${+value}` === value) { + return +value; + } + throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); +} +function env3() { + return ENV5; +} +var ENV5 = null; +function setEnvironmentGlobal2(environment) { + ENV5 = environment; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/global_util.js +var globalNameSpace2; +function getGlobalNamespace2() { + if (globalNameSpace2 == null) { + let ns; + if (typeof window !== "undefined") { + ns = window; + } else if (typeof global !== "undefined") { + ns = global; + } else if (typeof process !== "undefined") { + ns = process; + } else if (typeof self !== "undefined") { + ns = self; + } else { + throw new Error("Could not find a global object"); + } + globalNameSpace2 = ns; + } + return globalNameSpace2; +} +function getGlobalMap2() { + const ns = getGlobalNamespace2(); + if (ns._tfGlobals == null) { + ns._tfGlobals = new Map(); + } + return ns._tfGlobals; +} +function getGlobal2(key, init2) { + const globalMap = getGlobalMap2(); + if (globalMap.has(key)) { + return globalMap.get(key); + } else { + const singleton = init2(); + globalMap.set(key, singleton); + return globalMap.get(key); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/kernel_names.js +var Abs2 = "Abs"; +var Acos2 = "Acos"; +var Acosh2 = "Acosh"; +var Add3 = "Add"; +var AddN2 = "AddN"; +var All2 = "All"; +var Any2 = "Any"; +var ArgMax2 = "ArgMax"; +var ArgMin2 = "ArgMin"; +var Asin2 = "Asin"; +var Asinh2 = "Asinh"; +var Atan3 = "Atan"; +var Atanh2 = "Atanh"; +var Atan22 = "Atan2"; +var AvgPool2 = "AvgPool"; +var AvgPoolGrad2 = "AvgPoolGrad"; +var AvgPool3D2 = "AvgPool3D"; +var AvgPool3DGrad2 = "AvgPool3DGrad"; +var BatchMatMul2 = "BatchMatMul"; +var BatchToSpaceND2 = "BatchToSpaceND"; +var Bincount2 = "Bincount"; +var BroadcastTo2 = "BroadcastTo"; +var BroadcastArgs2 = "BroadcastArgs"; +var Cast2 = "Cast"; +var Ceil2 = "Ceil"; +var ClipByValue2 = "ClipByValue"; +var Complex2 = "Complex"; +var ComplexAbs2 = "ComplexAbs"; +var Concat2 = "Concat"; +var Conv2D3 = "Conv2D"; +var Conv2DBackpropFilter2 = "Conv2DBackpropFilter"; +var Conv2DBackpropInput2 = "Conv2DBackpropInput"; +var Conv3D3 = "Conv3D"; +var Conv3DBackpropFilterV22 = "Conv3DBackpropFilterV2"; +var Conv3DBackpropInputV22 = "Conv3DBackpropInputV2"; +var Cos2 = "Cos"; +var Cosh2 = "Cosh"; +var Cumsum2 = "Cumsum"; +var CropAndResize2 = "CropAndResize"; +var DenseBincount2 = "DenseBincount"; +var DepthToSpace2 = "DepthToSpace"; +var DepthwiseConv2dNative2 = "DepthwiseConv2dNative"; +var DepthwiseConv2dNativeBackpropFilter2 = "DepthwiseConv2dNativeBackpropFilter"; +var DepthwiseConv2dNativeBackpropInput2 = "DepthwiseConv2dNativeBackpropInput"; +var Diag2 = "Diag"; +var Dilation2D2 = "Dilation2D"; +var Dilation2DBackpropInput2 = "Dilation2DBackpropInput"; +var Dilation2DBackpropFilter2 = "Dilation2DBackpropFilter"; +var RealDiv2 = "RealDiv"; +var Einsum2 = "Einsum"; +var Elu3 = "Elu"; +var EluGrad2 = "EluGrad"; +var Erf2 = "Erf"; +var Equal2 = "Equal"; +var Exp2 = "Exp"; +var ExpandDims2 = "ExpandDims"; +var Expm12 = "Expm1"; +var FFT2 = "FFT"; +var Fill2 = "Fill"; +var FlipLeftRight2 = "FlipLeftRight"; +var Floor2 = "Floor"; +var FloorDiv2 = "FloorDiv"; +var FusedBatchNorm2 = "FusedBatchNorm"; +var GatherV22 = "GatherV2"; +var GatherNd2 = "GatherNd"; +var Greater2 = "Greater"; +var GreaterEqual2 = "GreaterEqual"; +var Identity3 = "Identity"; +var IFFT2 = "IFFT"; +var Imag2 = "Imag"; +var IsFinite2 = "IsFinite"; +var IsInf2 = "IsInf"; +var IsNan2 = "IsNan"; +var LeakyRelu2 = "LeakyRelu"; +var Less2 = "Less"; +var LessEqual2 = "LessEqual"; +var LinSpace2 = "LinSpace"; +var Log2 = "Log"; +var Log1p2 = "Log1p"; +var LogicalAnd2 = "LogicalAnd"; +var LogicalNot2 = "LogicalNot"; +var LogicalOr2 = "LogicalOr"; +var LogSoftmax3 = "LogSoftmax"; +var LRN2 = "LRN"; +var LRNGrad2 = "LRNGrad"; +var Max2 = "Max"; +var Maximum3 = "Maximum"; +var MaxPool2 = "MaxPool"; +var MaxPoolGrad2 = "MaxPoolGrad"; +var MaxPool3D2 = "MaxPool3D"; +var MaxPool3DGrad2 = "MaxPool3DGrad"; +var MaxPoolWithArgmax2 = "MaxPoolWithArgmax"; +var Mean2 = "Mean"; +var Min2 = "Min"; +var Minimum3 = "Minimum"; +var MirrorPad2 = "MirrorPad"; +var Mod2 = "Mod"; +var Multinomial2 = "Multinomial"; +var Multiply3 = "Multiply"; +var Neg2 = "Neg"; +var NotEqual2 = "NotEqual"; +var NonMaxSuppressionV32 = "NonMaxSuppressionV3"; +var NonMaxSuppressionV42 = "NonMaxSuppressionV4"; +var NonMaxSuppressionV52 = "NonMaxSuppressionV5"; +var OnesLike2 = "OnesLike"; +var OneHot2 = "OneHot"; +var Pack2 = "Pack"; +var PadV22 = "PadV2"; +var Pow2 = "Pow"; +var Prelu2 = "Prelu"; +var Prod2 = "Prod"; +var Range2 = "Range"; +var Real2 = "Real"; +var Reciprocal2 = "Reciprocal"; +var Relu3 = "Relu"; +var Reshape3 = "Reshape"; +var ResizeNearestNeighbor2 = "ResizeNearestNeighbor"; +var ResizeNearestNeighborGrad2 = "ResizeNearestNeighborGrad"; +var ResizeBilinear2 = "ResizeBilinear"; +var ResizeBilinearGrad2 = "ResizeBilinearGrad"; +var Relu63 = "Relu6"; +var Reverse2 = "Reverse"; +var Round2 = "Round"; +var Rsqrt2 = "Rsqrt"; +var ScatterNd2 = "ScatterNd"; +var Select2 = "Select"; +var Selu3 = "Selu"; +var Slice2 = "Slice"; +var Sin2 = "Sin"; +var Sinh2 = "Sinh"; +var Sign2 = "Sign"; +var Sigmoid3 = "Sigmoid"; +var Softplus3 = "Softplus"; +var Sqrt2 = "Sqrt"; +var Sum2 = "Sum"; +var SpaceToBatchND2 = "SpaceToBatchND"; +var SplitV2 = "SplitV"; +var Softmax4 = "Softmax"; +var SparseFillEmptyRows2 = "SparseFillEmptyRows"; +var SparseReshape2 = "SparseReshape"; +var SparseSegmentMean2 = "SparseSegmentMean"; +var SparseSegmentSum2 = "SparseSegmentSum"; +var SparseToDense2 = "SparseToDense"; +var SquaredDifference2 = "SquaredDifference"; +var Square2 = "Square"; +var StridedSlice2 = "StridedSlice"; +var StringNGrams2 = "StringNGrams"; +var StringSplit2 = "StringSplit"; +var StringToHashBucketFast2 = "StringToHashBucketFast"; +var Sub2 = "Sub"; +var Tan2 = "Tan"; +var Tanh3 = "Tanh"; +var Tile2 = "Tile"; +var TopK2 = "TopK"; +var Transform2 = "Transform"; +var Transpose2 = "Transpose"; +var Unique2 = "Unique"; +var Unpack2 = "Unpack"; +var UnsortedSegmentSum2 = "UnsortedSegmentSum"; +var ZerosLike2 = "ZerosLike"; +var Step2 = "Step"; +var FromPixels2 = "FromPixels"; +var RotateWithOffset2 = "RotateWithOffset"; +var _FusedMatMul2 = "_FusedMatMul"; +var FusedConv2D2 = "FusedConv2D"; +var FusedDepthwiseConv2D2 = "FusedDepthwiseConv2D"; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.js +var kernelRegistry2 = getGlobal2("kernelRegistry", () => new Map()); +var gradRegistry2 = getGlobal2("gradRegistry", () => new Map()); +function getKernel2(kernelName, backendName) { + const key = makeKey2(kernelName, backendName); + return kernelRegistry2.get(key); +} +function getGradient2(kernelName) { + return gradRegistry2.get(kernelName); +} +function getKernelsForBackend2(backendName) { + const it = kernelRegistry2.entries(); + const result = []; + while (true) { + const { done, value } = it.next(); + if (done) { + break; + } + const [key, config3] = value; + const [backend4] = key.split("_"); + if (backend4 === backendName) { + result.push(config3); + } + } + return result; +} +function registerKernel2(config3) { + const { kernelName, backendName } = config3; + const key = makeKey2(kernelName, backendName); + if (kernelRegistry2.has(key)) { + warn2(`The kernel '${kernelName}' for backend '${backendName}' is already registered`); + } + kernelRegistry2.set(key, config3); +} +function registerGradient2(config3) { + const { kernelName } = config3; + if (gradRegistry2.has(kernelName)) { + if (env3().getBool("DEBUG")) { + warn2(`Overriding the gradient for '${kernelName}'`); + } + } + gradRegistry2.set(kernelName, config3); +} +function makeKey2(kernelName, backendName) { + return `${backendName}_${kernelName}`; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/util.js +var util_exports2 = {}; +__export(util_exports2, { + arraysEqual: () => arraysEqual2, + assert: () => assert3, + assertNonNegativeIntegerDimensions: () => assertNonNegativeIntegerDimensions2, + assertNonNull: () => assertNonNull2, + assertShapesMatch: () => assertShapesMatch2, + bytesFromStringArray: () => bytesFromStringArray2, + bytesPerElement: () => bytesPerElement2, + checkConversionForErrors: () => checkConversionForErrors2, + clamp: () => clamp3, + computeStrides: () => computeStrides2, + createScalarValue: () => createScalarValue2, + createShuffledIndices: () => createShuffledIndices2, + decodeString: () => decodeString2, + distSquared: () => distSquared2, + encodeString: () => encodeString2, + fetch: () => fetch5, + fingerPrint64: () => fingerPrint642, + flatten: () => flatten4, + getArrayFromDType: () => getArrayFromDType2, + getTypedArrayFromDType: () => getTypedArrayFromDType2, + hasEncodingLoss: () => hasEncodingLoss2, + hexToLong: () => hexToLong2, + indexToLoc: () => indexToLoc2, + inferDtype: () => inferDtype2, + inferFromImplicitShape: () => inferFromImplicitShape2, + isBoolean: () => isBoolean2, + isFunction: () => isFunction2, + isInt: () => isInt2, + isNumber: () => isNumber2, + isPromise: () => isPromise2, + isScalarShape: () => isScalarShape2, + isString: () => isString2, + isTypedArray: () => isTypedArray2, + isValidDtype: () => isValidDtype2, + locToIndex: () => locToIndex2, + makeOnesTypedArray: () => makeOnesTypedArray2, + makeZerosNestedTypedArray: () => makeZerosNestedTypedArray2, + makeZerosTypedArray: () => makeZerosTypedArray2, + nearestDivisor: () => nearestDivisor2, + nearestLargerEven: () => nearestLargerEven2, + now: () => now3, + parseAxisParam: () => parseAxisParam2, + randUniform: () => randUniform2, + repeatedTry: () => repeatedTry2, + rightPad: () => rightPad2, + shuffle: () => shuffle2, + shuffleCombo: () => shuffleCombo2, + sizeFromShape: () => sizeFromShape2, + sizeToSquarishShape: () => sizeToSquarishShape2, + squeezeShape: () => squeezeShape2, + sum: () => sum6, + swap: () => swap2, + tanh: () => tanh5, + toNestedArray: () => toNestedArray2, + toTypedArray: () => toTypedArray2 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/hash_util.js +var LongExports2 = __toModule(require_long2()); +var Long2 = LongExports2.default || LongExports2; +function hexToLong2(hex) { + return Long2.fromString(hex, true, 16); +} +var k02 = hexToLong2("c3a5c85c97cb3127"); +var k12 = hexToLong2("b492b66fbe98f273"); +var k22 = hexToLong2("9ae16a3b2f90404f"); +function shiftMix2(val) { + return val.xor(val.shru(47)); +} +function fetch4(s, offset, numBytes) { + const bytes = s.slice(offset, offset + numBytes); + return Long2.fromBytes(Array.from(bytes), true, true); +} +function fetch642(s, offset) { + return fetch4(s, offset, 8); +} +function fetch322(s, offset) { + return fetch4(s, offset, 4); +} +function rotate642(val, shift) { + return shift === 0 ? val : val.shru(shift).or(val.shl(64 - shift)); +} +function hashLen162(u, v, mul3 = hexToLong2("9ddfea08eb382d69")) { + let a = u.xor(v).mul(mul3); + a = a.xor(a.shru(47)); + let b = v.xor(a).mul(mul3); + b = b.xor(b.shru(47)); + b = b.mul(mul3); + return b; +} +function weakHashLen32WithSeeds2(w, x, y, z, a, b) { + a = a.add(w); + b = rotate642(b.add(a).add(z), 21); + const c = a; + a = a.add(x); + a = a.add(y); + b = b.add(rotate642(a, 44)); + return [a.add(z), b.add(c)]; +} +function weakHashLen32WithSeedsStr2(s, offset, a, b) { + return weakHashLen32WithSeeds2(fetch642(s, offset), fetch642(s, offset + 8), fetch642(s, offset + 16), fetch642(s, offset + 24), a, b); +} +function hashLen0to162(s, len = s.length) { + if (len >= 8) { + const mul3 = k22.add(len * 2); + const a = fetch642(s, 0).add(k22); + const b = fetch642(s, len - 8); + const c = rotate642(b, 37).mul(mul3).add(a); + const d = rotate642(a, 25).add(b).mul(mul3); + return hashLen162(c, d, mul3); + } + if (len >= 4) { + const mul3 = k22.add(len * 2); + const a = fetch322(s, 0); + return hashLen162(a.shl(3).add(len), fetch322(s, len - 4), mul3); + } + if (len > 0) { + const a = s[0]; + const b = s[len >> 1]; + const c = s[len - 1]; + const y = a + (b << 8); + const z = len + (c << 2); + return shiftMix2(k22.mul(y).xor(k02.mul(z))).mul(k22); + } + return k22; +} +function hashLen17to322(s, len = s.length) { + const mul3 = k22.add(len * 2); + const a = fetch642(s, 0).mul(k12); + const b = fetch642(s, 8); + const c = fetch642(s, len - 8).mul(mul3); + const d = fetch642(s, len - 16).mul(k22); + return hashLen162(rotate642(a.add(b), 43).add(rotate642(c, 30)).add(d), a.add(rotate642(b.add(k22), 18)).add(c), mul3); +} +function hashLen33to642(s, len = s.length) { + const mul3 = k22.add(len * 2); + const a = fetch642(s, 0).mul(k22); + const b = fetch642(s, 8); + const c = fetch642(s, len - 8).mul(mul3); + const d = fetch642(s, len - 16).mul(k22); + const y = rotate642(a.add(b), 43).add(rotate642(c, 30)).add(d); + const z = hashLen162(y, a.add(rotate642(b.add(k22), 18)).add(c), mul3); + const e = fetch642(s, 16).mul(mul3); + const f = fetch642(s, 24); + const g = y.add(fetch642(s, len - 32)).mul(mul3); + const h = z.add(fetch642(s, len - 24)).mul(mul3); + return hashLen162(rotate642(e.add(f), 43).add(rotate642(g, 30)).add(h), e.add(rotate642(f.add(a), 18)).add(g), mul3); +} +function fingerPrint642(s, len = s.length) { + const seed = Long2.fromNumber(81, true); + if (len <= 32) { + if (len <= 16) { + return hashLen0to162(s, len); + } else { + return hashLen17to322(s, len); + } + } else if (len <= 64) { + return hashLen33to642(s, len); + } + let x = seed; + let y = seed.mul(k12).add(113); + let z = shiftMix2(y.mul(k22).add(113)).mul(k22); + let v = [Long2.UZERO, Long2.UZERO]; + let w = [Long2.UZERO, Long2.UZERO]; + x = x.mul(k22).add(fetch642(s, 0)); + let offset = 0; + const end = (len - 1 >> 6) * 64; + const last64 = end + (len - 1 & 63) - 63; + do { + x = rotate642(x.add(y).add(v[0]).add(fetch642(s, offset + 8)), 37).mul(k12); + y = rotate642(y.add(v[1]).add(fetch642(s, offset + 48)), 42).mul(k12); + x = x.xor(w[1]); + y = y.add(v[0]).add(fetch642(s, offset + 40)); + z = rotate642(z.add(w[0]), 33).mul(k12); + v = weakHashLen32WithSeedsStr2(s, offset, v[1].mul(k12), x.add(w[0])); + w = weakHashLen32WithSeedsStr2(s, offset + 32, z.add(w[1]), y.add(fetch642(s, offset + 16))); + [z, x] = [x, z]; + offset += 64; + } while (offset !== end); + const mul3 = k12.add(z.and(255).shl(1)); + offset = last64; + w[0] = w[0].add(len - 1 & 63); + v[0] = v[0].add(w[0]); + w[0] = w[0].add(v[0]); + x = rotate642(x.add(y).add(v[0]).add(fetch642(s, offset + 8)), 37).mul(mul3); + y = rotate642(y.add(v[1]).add(fetch642(s, offset + 48)), 42).mul(mul3); + x = x.xor(w[1].mul(9)); + y = y.add(v[0].mul(9).add(fetch642(s, offset + 40))); + z = rotate642(z.add(w[0]), 33).mul(mul3); + v = weakHashLen32WithSeedsStr2(s, offset, v[1].mul(mul3), x.add(w[0])); + w = weakHashLen32WithSeedsStr2(s, offset + 32, z.add(w[1]), y.add(fetch642(s, offset + 16))); + [z, x] = [x, z]; + return hashLen162(hashLen162(v[0], w[0], mul3).add(shiftMix2(y).mul(k02)).add(z), hashLen162(v[1], w[1], mul3).add(x), mul3); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/util.js +function createScalarValue2(value, dtype) { + if (dtype === "string") { + return encodeString2(value); + } + return toTypedArray2([value], dtype); +} +function noConversionNeeded2(a, dtype) { + return a instanceof Float32Array && dtype === "float32" || a instanceof Int32Array && dtype === "int32" || a instanceof Uint8Array && dtype === "bool"; +} +function toTypedArray2(a, dtype) { + if (dtype === "string") { + throw new Error("Cannot convert a string[] to a TypedArray"); + } + if (Array.isArray(a)) { + a = flatten4(a); + } + if (env3().getBool("DEBUG")) { + checkConversionForErrors2(a, dtype); + } + if (noConversionNeeded2(a, dtype)) { + return a; + } + if (dtype == null || dtype === "float32" || dtype === "complex64") { + return new Float32Array(a); + } else if (dtype === "int32") { + return new Int32Array(a); + } else if (dtype === "bool") { + const bool = new Uint8Array(a.length); + for (let i = 0; i < bool.length; ++i) { + if (Math.round(a[i]) !== 0) { + bool[i] = 1; + } + } + return bool; + } else { + throw new Error(`Unknown data type ${dtype}`); + } +} +function now3() { + return env3().platform.now(); +} +function fetch5(path, requestInits) { + return env3().platform.fetch(path, requestInits); +} +function encodeString2(s, encoding = "utf-8") { + encoding = encoding || "utf-8"; + return env3().platform.encode(s, encoding); +} +function decodeString2(bytes, encoding = "utf-8") { + encoding = encoding || "utf-8"; + return env3().platform.decode(bytes, encoding); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/profiler.js +var Profiler2 = class { + constructor(backendTimer, logger) { + this.backendTimer = backendTimer; + this.logger = logger; + if (logger == null) { + this.logger = new Logger2(); + } + } + profileKernel(kernelName, inputs, f) { + let outputs; + const holdResultWrapperFn = () => { + outputs = f(); + }; + let timer; + const start = now3(); + if (this.backendTimer.timerAvailable()) { + timer = this.backendTimer.time(holdResultWrapperFn); + } else { + holdResultWrapperFn(); + for (const output of outputs) { + output.dataSync(); + } + timer = Promise.resolve({ kernelMs: now3() - start }); + } + if (env3().getBool("CHECK_COMPUTATION_FOR_ERRORS")) { + for (let i = 0; i < outputs.length; i++) { + const output = outputs[i]; + output.data().then((tensorVals) => { + checkComputationForErrors2(tensorVals, output.dtype, kernelName); + }); + } + } + const kernelProfile = { + kernelName, + outputs, + inputs, + timeMs: timer.then((timing) => timing.kernelMs), + extraInfo: timer.then((timing) => timing.getExtraProfileInfo != null ? timing.getExtraProfileInfo() : "") + }; + return kernelProfile; + } + logKernelProfile(kernelProfile) { + const { kernelName, outputs, timeMs, inputs, extraInfo } = kernelProfile; + outputs.forEach((result) => { + Promise.all([result.data(), timeMs, extraInfo]).then((valueContainer) => { + this.logger.logKernelProfile(kernelName, result, valueContainer[0], valueContainer[1], inputs, valueContainer[2]); + }); + }); + } +}; +function checkComputationForErrors2(vals, dtype, kernelName) { + if (dtype !== "float32") { + return false; + } + for (let i = 0; i < vals.length; i++) { + const num = vals[i]; + if (isNaN(num) || !isFinite(num)) { + console.warn(`Found ${num} in the result of '${kernelName}'`); + return true; + } + } + return false; +} +var Logger2 = class { + logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { + const time2 = typeof timeMs === "number" ? rightPad2(`${timeMs}ms`, 9) : timeMs["error"]; + const paddedName = rightPad2(name, 25); + const rank = result.rank; + const size2 = result.size; + const shape = rightPad2(result.shape.toString(), 14); + let inputShapesDescription = ""; + for (const name2 in inputs) { + const input3 = inputs[name2]; + if (input3 != null) { + const inputShape = input3.shape || result.shape; + const inputRank = inputShape.length; + inputShapesDescription += `${name2}: ${inputRank}D ${inputRank > 0 ? inputShape : ""} `; + } + } + console.log(`%c${paddedName} %c${time2} %c${rank}D ${shape} %c${size2} %c${inputShapesDescription} %c${extraInfo}`, "font-weight:bold", "color:red", "color:blue", "color: orange", "color: green", "color: steelblue"); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tape.js +function getFilteredNodesXToY2(tape, xs, y) { + const tensorsFromX = {}; + const nodesFromX = {}; + for (let i = 0; i < xs.length; i++) { + tensorsFromX[xs[i].id] = true; + } + for (let i = 0; i < tape.length; i++) { + const node2 = tape[i]; + const nodeInputs = node2.inputs; + for (const inputName in nodeInputs) { + const input3 = nodeInputs[inputName]; + let anyInputFromX = false; + for (let j = 0; j < xs.length; j++) { + if (tensorsFromX[input3.id]) { + node2.outputs.forEach((output) => tensorsFromX[output.id] = true); + anyInputFromX = true; + nodesFromX[node2.id] = true; + break; + } + } + if (anyInputFromX) { + break; + } + } + } + const tensorsLeadToY = {}; + tensorsLeadToY[y.id] = true; + const nodesToY = {}; + for (let i = tape.length - 1; i >= 0; i--) { + const node2 = tape[i]; + const nodeInputs = node2.inputs; + for (let j = 0; j < node2.outputs.length; j++) { + if (tensorsLeadToY[node2.outputs[j].id]) { + for (const inputName in nodeInputs) { + tensorsLeadToY[nodeInputs[inputName].id] = true; + nodesToY[node2.id] = true; + } + break; + } + } + } + const filteredTape = []; + for (let i = 0; i < tape.length; i++) { + const node2 = tape[i]; + if (nodesFromX[node2.id] && nodesToY[node2.id]) { + const prunedInputs = {}; + for (const inputName in node2.inputs) { + const nodeInput = node2.inputs[inputName]; + if (tensorsFromX[nodeInput.id]) { + prunedInputs[inputName] = nodeInput; + } + } + const prunedNode = Object.assign({}, node2); + prunedNode.inputs = prunedInputs; + prunedNode.outputs = node2.outputs; + filteredTape.push(prunedNode); + } + } + return filteredTape; +} +function backpropagateGradients2(tensorAccumulatedGradientMap, filteredTape, tidy3, add8) { + for (let i = filteredTape.length - 1; i >= 0; i--) { + const node2 = filteredTape[i]; + const dys = []; + node2.outputs.forEach((o) => { + const gradTensor = tensorAccumulatedGradientMap[o.id]; + if (gradTensor != null) { + dys.push(gradTensor); + } else { + dys.push(null); + } + }); + if (node2.gradient == null) { + throw new Error(`Cannot compute gradient: gradient function not found for ${node2.kernelName}.`); + } + const inputGradients = node2.gradient(dys); + for (const inputName in node2.inputs) { + if (!(inputName in inputGradients)) { + throw new Error(`Cannot backprop through input ${inputName}. Available gradients found: ${Object.keys(inputGradients)}.`); + } + const dx = tidy3(() => inputGradients[inputName]()); + if (dx.dtype !== "float32") { + throw new Error(`Error in gradient for op ${node2.kernelName}. The gradient of input ${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); + } + const x = node2.inputs[inputName]; + if (!arraysEqual2(dx.shape, x.shape)) { + throw new Error(`Error in gradient for op ${node2.kernelName}. The gradient of input '${inputName}' has shape '${dx.shape}', which does not match the shape of the input '${x.shape}'`); + } + if (tensorAccumulatedGradientMap[x.id] == null) { + tensorAccumulatedGradientMap[x.id] = dx; + } else { + const curGradient = tensorAccumulatedGradientMap[x.id]; + tensorAccumulatedGradientMap[x.id] = add8(curGradient, dx); + curGradient.dispose(); + } + } + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js +var FORMAT_LIMIT_NUM_VALS2 = 20; +var FORMAT_NUM_FIRST_LAST_VALS2 = 3; +var FORMAT_NUM_SIG_DIGITS2 = 7; +function tensorToString2(vals, shape, dtype, verbose) { + const strides = computeStrides2(shape); + const padPerCol = computeMaxSizePerColumn2(vals, shape, dtype, strides); + const rank = shape.length; + const valsLines = subTensorToString2(vals, shape, dtype, strides, padPerCol); + const lines2 = ["Tensor"]; + if (verbose) { + lines2.push(` dtype: ${dtype}`); + lines2.push(` rank: ${rank}`); + lines2.push(` shape: [${shape}]`); + lines2.push(` values:`); + } + lines2.push(valsLines.map((l) => " " + l).join("\n")); + return lines2.join("\n"); +} +function computeMaxSizePerColumn2(vals, shape, dtype, strides) { + const n = sizeFromShape2(shape); + const numCols = strides[strides.length - 1]; + const padPerCol = new Array(numCols).fill(0); + const rank = shape.length; + const valuesOrTuples = dtype === "complex64" ? createComplexTuples2(vals) : vals; + if (rank > 1) { + for (let row = 0; row < n / numCols; row++) { + const offset = row * numCols; + for (let j = 0; j < numCols; j++) { + padPerCol[j] = Math.max(padPerCol[j], valToString2(valuesOrTuples[offset + j], 0, dtype).length); + } + } + } + return padPerCol; +} +function valToString2(val, pad4, dtype) { + let valStr; + if (Array.isArray(val)) { + valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS2))} + ${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS2))}j`; + } else if (isString2(val)) { + valStr = `'${val}'`; + } else if (dtype === "bool") { + valStr = boolNumToString2(val); + } else { + valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS2)).toString(); + } + return rightPad2(valStr, pad4); +} +function boolNumToString2(v) { + return v === 0 ? "false" : "true"; +} +function subTensorToString2(vals, shape, dtype, strides, padPerCol, isLast = true) { + const storagePerElement = dtype === "complex64" ? 2 : 1; + const size2 = shape[0]; + const rank = shape.length; + if (rank === 0) { + if (dtype === "complex64") { + const complexTuple = createComplexTuples2(vals); + return [valToString2(complexTuple[0], 0, dtype)]; + } + if (dtype === "bool") { + return [boolNumToString2(vals[0])]; + } + return [vals[0].toString()]; + } + if (rank === 1) { + if (size2 > FORMAT_LIMIT_NUM_VALS2) { + const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS2 * storagePerElement; + let firstVals = Array.from(vals.slice(0, firstValsSize)); + let lastVals = Array.from(vals.slice((size2 - FORMAT_NUM_FIRST_LAST_VALS2) * storagePerElement, size2 * storagePerElement)); + if (dtype === "complex64") { + firstVals = createComplexTuples2(firstVals); + lastVals = createComplexTuples2(lastVals); + } + return [ + "[" + firstVals.map((x, i) => valToString2(x, padPerCol[i], dtype)).join(", ") + ", ..., " + lastVals.map((x, i) => valToString2(x, padPerCol[size2 - FORMAT_NUM_FIRST_LAST_VALS2 + i], dtype)).join(", ") + "]" + ]; + } + const displayVals = dtype === "complex64" ? createComplexTuples2(vals) : Array.from(vals); + return [ + "[" + displayVals.map((x, i) => valToString2(x, padPerCol[i], dtype)).join(", ") + "]" + ]; + } + const subshape = shape.slice(1); + const substrides = strides.slice(1); + const stride = strides[0] * storagePerElement; + const lines2 = []; + if (size2 > FORMAT_LIMIT_NUM_VALS2) { + for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS2; i++) { + const start = i * stride; + const end = start + stride; + lines2.push(...subTensorToString2(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false)); + } + lines2.push("..."); + for (let i = size2 - FORMAT_NUM_FIRST_LAST_VALS2; i < size2; i++) { + const start = i * stride; + const end = start + stride; + lines2.push(...subTensorToString2(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size2 - 1)); + } + } else { + for (let i = 0; i < size2; i++) { + const start = i * stride; + const end = start + stride; + lines2.push(...subTensorToString2(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size2 - 1)); + } + } + const sep = rank === 2 ? "," : ""; + lines2[0] = "[" + lines2[0] + sep; + for (let i = 1; i < lines2.length - 1; i++) { + lines2[i] = " " + lines2[i] + sep; + } + let newLineSep = ",\n"; + for (let i = 2; i < rank; i++) { + newLineSep += "\n"; + } + lines2[lines2.length - 1] = " " + lines2[lines2.length - 1] + "]" + (isLast ? "" : newLineSep); + return lines2; +} +function createComplexTuples2(vals) { + const complexTuples = []; + for (let i = 0; i < vals.length; i += 2) { + complexTuples.push([vals[i], vals[i + 1]]); + } + return complexTuples; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tensor.js +var TensorBuffer2 = class { + constructor(shape, dtype, values) { + this.dtype = dtype; + this.shape = shape.slice(); + this.size = sizeFromShape2(shape); + if (values != null) { + const n = values.length; + assert3(n === this.size, () => `Length of values '${n}' does not match the size inferred by the shape '${this.size}'.`); + } + if (dtype === "complex64") { + throw new Error(`complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).`); + } + this.values = values || getArrayFromDType2(dtype, this.size); + this.strides = computeStrides2(shape); + } + set(value, ...locs) { + if (locs.length === 0) { + locs = [0]; + } + assert3(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must match the rank (${this.rank})`); + const index = this.locToIndex(locs); + this.values[index] = value; + } + get(...locs) { + if (locs.length === 0) { + locs = [0]; + } + let i = 0; + for (const loc of locs) { + if (loc < 0 || loc >= this.shape[i]) { + const msg = `Requested out of range element at ${locs}. Buffer shape=${this.shape}`; + throw new Error(msg); + } + i++; + } + let index = locs[locs.length - 1]; + for (let i2 = 0; i2 < locs.length - 1; ++i2) { + index += this.strides[i2] * locs[i2]; + } + return this.values[index]; + } + locToIndex(locs) { + if (this.rank === 0) { + return 0; + } else if (this.rank === 1) { + return locs[0]; + } + let index = locs[locs.length - 1]; + for (let i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return index; + } + indexToLoc(index) { + if (this.rank === 0) { + return []; + } else if (this.rank === 1) { + return [index]; + } + const locs = new Array(this.shape.length); + for (let i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / this.strides[i]); + index -= locs[i] * this.strides[i]; + } + locs[locs.length - 1] = index; + return locs; + } + get rank() { + return this.shape.length; + } + toTensor() { + return trackerFn2().makeTensor(this.values, this.shape, this.dtype); + } +}; +var trackerFn2 = null; +var opHandler3 = null; +var deprecationWarningFn2 = null; +function setTensorTracker2(fn) { + trackerFn2 = fn; +} +function setOpHandler2(handler) { + opHandler3 = handler; +} +function setDeprecationWarningFn2(fn) { + deprecationWarningFn2 = fn; +} +var Tensor2 = class { + constructor(shape, dtype, dataId, id) { + this.kept = false; + this.isDisposedInternal = false; + this.shape = shape.slice(); + this.dtype = dtype || "float32"; + this.size = sizeFromShape2(shape); + this.strides = computeStrides2(shape); + this.dataId = dataId; + this.id = id; + this.rankType = this.rank < 5 ? this.rank.toString() : "higher"; + } + get rank() { + return this.shape.length; + } + async buffer() { + const vals = await this.data(); + return opHandler3.buffer(this.shape, this.dtype, vals); + } + bufferSync() { + return opHandler3.buffer(this.shape, this.dtype, this.dataSync()); + } + async array() { + const vals = await this.data(); + return toNestedArray2(this.shape, vals, this.dtype === "complex64"); + } + arraySync() { + return toNestedArray2(this.shape, this.dataSync(), this.dtype === "complex64"); + } + async data() { + this.throwIfDisposed(); + const data = trackerFn2().read(this.dataId); + if (this.dtype === "string") { + const bytes = await data; + try { + return bytes.map((b) => decodeString2(b)); + } catch (_a) { + throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes()."); + } + } + return data; + } + dataSync() { + this.throwIfDisposed(); + const data = trackerFn2().readSync(this.dataId); + if (this.dtype === "string") { + try { + return data.map((b) => decodeString2(b)); + } catch (_a) { + throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes()."); + } + } + return data; + } + async bytes() { + this.throwIfDisposed(); + const data = await trackerFn2().read(this.dataId); + if (this.dtype === "string") { + return data; + } else { + return new Uint8Array(data.buffer); + } + } + dispose() { + if (this.isDisposed) { + return; + } + trackerFn2().disposeTensor(this); + this.isDisposedInternal = true; + } + get isDisposed() { + return this.isDisposedInternal; + } + throwIfDisposed() { + if (this.isDisposed) { + throw new Error(`Tensor is disposed.`); + } + } + print(verbose = false) { + return opHandler3.print(this, verbose); + } + clone() { + this.throwIfDisposed(); + return opHandler3.clone(this); + } + toString(verbose = false) { + const vals = this.dataSync(); + return tensorToString2(vals, this.shape, this.dtype, verbose); + } + cast(dtype) { + this.throwIfDisposed(); + return opHandler3.cast(this, dtype); + } + variable(trainable = true, name, dtype) { + this.throwIfDisposed(); + return trackerFn2().makeVariable(this, trainable, name, dtype); + } +}; +Object.defineProperty(Tensor2, Symbol.hasInstance, { + value: (instance) => { + return !!instance && instance.data != null && instance.dataSync != null && instance.throwIfDisposed != null; + } +}); +function getGlobalTensorClass2() { + return getGlobal2("Tensor", () => { + return Tensor2; + }); +} +getGlobalTensorClass2(); +var Variable2 = class extends Tensor2 { + constructor(initialValue, trainable, name, tensorId) { + super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); + this.trainable = trainable; + this.name = name; + } + assign(newValue) { + if (newValue.dtype !== this.dtype) { + throw new Error(`dtype of the new value (${newValue.dtype}) and previous value (${this.dtype}) must match`); + } + if (!arraysEqual2(newValue.shape, this.shape)) { + throw new Error(`shape of the new value (${newValue.shape}) and previous value (${this.shape}) must match`); + } + trackerFn2().disposeTensor(this); + this.dataId = newValue.dataId; + trackerFn2().incRef(this, null); + } + dispose() { + trackerFn2().disposeVariable(this); + this.isDisposedInternal = true; + } +}; +Object.defineProperty(Variable2, Symbol.hasInstance, { + value: (instance) => { + return instance instanceof Tensor2 && instance.assign != null && instance.assign instanceof Function; + } +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js +var tensor_util_exports2 = {}; +__export(tensor_util_exports2, { + assertTypesMatch: () => assertTypesMatch2, + getTensorsInContainer: () => getTensorsInContainer2, + isTensorInList: () => isTensorInList2, + makeTypesMatch: () => makeTypesMatch2 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/types.js +var Rank2; +(function(Rank3) { + Rank3["R0"] = "R0"; + Rank3["R1"] = "R1"; + Rank3["R2"] = "R2"; + Rank3["R3"] = "R3"; + Rank3["R4"] = "R4"; + Rank3["R5"] = "R5"; + Rank3["R6"] = "R6"; +})(Rank2 || (Rank2 = {})); +var UpcastInt32AndMap2; +(function(UpcastInt32AndMap3) { + UpcastInt32AndMap3["float32"] = "float32"; + UpcastInt32AndMap3["int32"] = "int32"; + UpcastInt32AndMap3["bool"] = "int32"; + UpcastInt32AndMap3["complex64"] = "complex64"; +})(UpcastInt32AndMap2 || (UpcastInt32AndMap2 = {})); +var UpcastBoolAndMap2; +(function(UpcastBoolAndMap3) { + UpcastBoolAndMap3["float32"] = "float32"; + UpcastBoolAndMap3["int32"] = "int32"; + UpcastBoolAndMap3["bool"] = "bool"; + UpcastBoolAndMap3["complex64"] = "complex64"; +})(UpcastBoolAndMap2 || (UpcastBoolAndMap2 = {})); +var UpcastFloat32AndMap2; +(function(UpcastFloat32AndMap3) { + UpcastFloat32AndMap3["float32"] = "float32"; + UpcastFloat32AndMap3["int32"] = "float32"; + UpcastFloat32AndMap3["bool"] = "float32"; + UpcastFloat32AndMap3["complex64"] = "complex64"; +})(UpcastFloat32AndMap2 || (UpcastFloat32AndMap2 = {})); +var UpcastComplex64AndMap2; +(function(UpcastComplex64AndMap3) { + UpcastComplex64AndMap3["float32"] = "complex64"; + UpcastComplex64AndMap3["int32"] = "complex64"; + UpcastComplex64AndMap3["bool"] = "complex64"; + UpcastComplex64AndMap3["complex64"] = "complex64"; +})(UpcastComplex64AndMap2 || (UpcastComplex64AndMap2 = {})); +var upcastTypeMap2 = { + "float32": UpcastFloat32AndMap2, + "int32": UpcastInt32AndMap2, + "bool": UpcastBoolAndMap2, + "complex64": UpcastComplex64AndMap2 +}; +function upcastType2(typeA, typeB) { + if (typeA === "string" || typeB === "string") { + if (typeA === "string" && typeB === "string") { + return "string"; + } + throw new Error(`Can not upcast ${typeA} with ${typeB}`); + } + return upcastTypeMap2[typeA][typeB]; +} +function sumOutType2(type) { + return upcastType2(type, "int32"); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js +function makeTypesMatch2(a, b) { + if (a.dtype === b.dtype) { + return [a, b]; + } + const dtype = upcastType2(a.dtype, b.dtype); + return [a.cast(dtype), b.cast(dtype)]; +} +function assertTypesMatch2(a, b) { + assert3(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and second(${b.dtype}) input must match`); +} +function isTensorInList2(tensor3, tensorList) { + return tensorList.some((x) => x.id === tensor3.id); +} +function getTensorsInContainer2(result) { + const list = []; + const seen = new Set(); + walkTensorContainer2(result, list, seen); + return list; +} +function walkTensorContainer2(container, list, seen) { + if (container == null) { + return; + } + if (container instanceof Tensor2) { + list.push(container); + return; + } + if (!isIterable3(container)) { + return; + } + const iterable = container; + for (const k in iterable) { + const val = iterable[k]; + if (!seen.has(val)) { + seen.add(val); + walkTensorContainer2(val, list, seen); + } + } +} +function isIterable3(obj) { + return Array.isArray(obj) || typeof obj === "object"; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/engine.js +function isRegisteredKernelInvocation2(kernelInvocation) { + return kernelInvocation.kernelName != null; +} +var EngineState2 = class { + constructor() { + this.registeredVariables = {}; + this.nextTapeNodeId = 0; + this.numBytes = 0; + this.numTensors = 0; + this.numStringTensors = 0; + this.numDataBuffers = 0; + this.gradientDepth = 0; + this.kernelDepth = 0; + this.scopeStack = []; + this.numDataMovesStack = []; + this.nextScopeId = 0; + this.tensorInfo = new WeakMap(); + this.profiling = false; + this.activeProfile = { + newBytes: 0, + newTensors: 0, + peakBytes: 0, + kernels: [], + result: null, + get kernelNames() { + return Array.from(new Set(this.kernels.map((k) => k.name))); + } + }; + } + dispose() { + for (const variableName in this.registeredVariables) { + this.registeredVariables[variableName].dispose(); + } + } +}; +var Engine2 = class { + constructor(ENV8) { + this.ENV = ENV8; + this.registry = {}; + this.registryFactory = {}; + this.pendingBackendInitId = 0; + this.state = new EngineState2(); + } + async ready() { + if (this.pendingBackendInit != null) { + return this.pendingBackendInit.then(() => { + }); + } + if (this.backendInstance != null) { + return; + } + const sortedBackends = this.getSortedBackends(); + for (let i = 0; i < sortedBackends.length; i++) { + const backendName = sortedBackends[i]; + const success = await this.initializeBackend(backendName).success; + if (success) { + await this.setBackend(backendName); + return; + } + } + throw new Error(`Could not initialize any backends, all backend initializations failed.`); + } + get backend() { + if (this.pendingBackendInit != null) { + throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`); + } + if (this.backendInstance == null) { + const { name, asyncInit } = this.initializeBackendsAndReturnBest(); + if (asyncInit) { + throw new Error(`The highest priority backend '${name}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`); + } + this.setBackend(name); + } + return this.backendInstance; + } + backendNames() { + return Object.keys(this.registryFactory); + } + findBackend(backendName) { + if (!(backendName in this.registry)) { + if (backendName in this.registryFactory) { + const { asyncInit } = this.initializeBackend(backendName); + if (asyncInit) { + return null; + } + } else { + return null; + } + } + return this.registry[backendName]; + } + findBackendFactory(backendName) { + if (!(backendName in this.registryFactory)) { + return null; + } + return this.registryFactory[backendName].factory; + } + registerBackend(backendName, factory, priority = 1) { + if (backendName in this.registryFactory) { + warn2(`${backendName} backend was already registered. Reusing existing backend factory.`); + return false; + } + this.registryFactory[backendName] = { factory, priority }; + return true; + } + async setBackend(backendName) { + if (this.registryFactory[backendName] == null) { + throw new Error(`Backend name '${backendName}' not found in registry`); + } + this.backendName = backendName; + if (this.registry[backendName] == null) { + this.backendInstance = null; + const { success, asyncInit } = this.initializeBackend(backendName); + const result = asyncInit ? await success : success; + if (!result) { + return false; + } + } + this.backendInstance = this.registry[backendName]; + this.setupRegisteredKernels(); + this.profiler = new Profiler2(this.backendInstance); + return true; + } + setupRegisteredKernels() { + const kernels = getKernelsForBackend2(this.backendName); + kernels.forEach((kernel) => { + if (kernel.setupFunc != null) { + kernel.setupFunc(this.backendInstance); + } + }); + } + disposeRegisteredKernels(backendName) { + const kernels = getKernelsForBackend2(backendName); + kernels.forEach((kernel) => { + if (kernel.disposeFunc != null) { + kernel.disposeFunc(this.registry[backendName]); + } + }); + } + initializeBackend(backendName) { + const registryFactoryEntry = this.registryFactory[backendName]; + if (registryFactoryEntry == null) { + throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); + } + try { + const backend4 = registryFactoryEntry.factory(); + if (backend4 && !(backend4 instanceof KernelBackend2) && typeof backend4.then === "function") { + const promiseId = ++this.pendingBackendInitId; + const success = backend4.then((backendInstance) => { + if (promiseId < this.pendingBackendInitId) { + return false; + } + this.registry[backendName] = backendInstance; + this.pendingBackendInit = null; + return true; + }).catch((err) => { + if (promiseId < this.pendingBackendInitId) { + return false; + } + this.pendingBackendInit = null; + warn2(`Initialization of backend ${backendName} failed`); + warn2(err.stack || err.message); + return false; + }); + this.pendingBackendInit = success; + return { success, asyncInit: true }; + } else { + this.registry[backendName] = backend4; + return { success: true, asyncInit: false }; + } + } catch (err) { + warn2(`Initialization of backend ${backendName} failed`); + warn2(err.stack || err.message); + return { success: false, asyncInit: false }; + } + } + removeBackend(backendName) { + if (!(backendName in this.registryFactory)) { + throw new Error(`${backendName} backend not found in registry`); + } + if (this.backendName === backendName && this.pendingBackendInit != null) { + this.pendingBackendInitId++; + } + if (backendName in this.registry) { + this.disposeRegisteredKernels(backendName); + this.registry[backendName].dispose(); + delete this.registry[backendName]; + } + delete this.registryFactory[backendName]; + if (this.backendName === backendName) { + this.pendingBackendInit = null; + this.backendName = null; + this.backendInstance = null; + } + } + getSortedBackends() { + if (Object.keys(this.registryFactory).length === 0) { + throw new Error("No backend found in registry."); + } + return Object.keys(this.registryFactory).sort((a, b) => { + return this.registryFactory[b].priority - this.registryFactory[a].priority; + }); + } + initializeBackendsAndReturnBest() { + const sortedBackends = this.getSortedBackends(); + for (let i = 0; i < sortedBackends.length; i++) { + const backendName = sortedBackends[i]; + const { success, asyncInit } = this.initializeBackend(backendName); + if (asyncInit || success) { + return { name: backendName, asyncInit }; + } + } + throw new Error(`Could not initialize any backends, all backend initializations failed.`); + } + moveData(backend4, dataId) { + const info = this.state.tensorInfo.get(dataId); + const srcBackend = info.backend; + const values = this.readSync(dataId); + const refCount = srcBackend.refCount(dataId); + srcBackend.disposeData(dataId, true); + info.backend = backend4; + backend4.move(dataId, values, info.shape, info.dtype, refCount); + if (this.shouldCheckForMemLeaks()) { + this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; + } + } + tidy(nameOrFn, fn) { + let name = null; + if (fn == null) { + if (typeof nameOrFn !== "function") { + throw new Error("Please provide a function to tidy()"); + } + fn = nameOrFn; + } else { + if (typeof nameOrFn !== "string" && !(nameOrFn instanceof String)) { + throw new Error("When calling with two arguments, the first argument to tidy() must be a string"); + } + if (typeof fn !== "function") { + throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function"); + } + name = nameOrFn; + } + let result; + return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { + result = fn(); + if (result instanceof Promise) { + console.error("Cannot return a Promise inside of tidy."); + } + return result; + }); + } + scopedRun(start, end, f) { + start(); + try { + const res = f(); + end(); + return res; + } catch (ex) { + end(); + throw ex; + } + } + nextTensorId() { + return Engine2.nextTensorId++; + } + nextVariableId() { + return Engine2.nextVariableId++; + } + clone(x) { + const y = ENGINE2.runKernel(Identity3, { x }); + const inputs = { x }; + const grad2 = (dy) => ({ + x: () => { + const dtype = "float32"; + const gradInputs = { x: dy }; + const attrs = { dtype }; + return ENGINE2.runKernel(Cast2, gradInputs, attrs); + } + }); + const saved = []; + this.addTapeNode(this.state.activeScope.name, inputs, [y], grad2, saved, {}); + return y; + } + runKernel(kernelName, inputs, attrs) { + if (this.backendName == null) { + this.backend; + } + const hasKernel = getKernel2(kernelName, this.backendName) != null; + if (!hasKernel) { + throw new Error(`Kernel '${kernelName}' not registered for backend '${this.backendName}'`); + } + return this.runKernelFunc({ kernelName, inputs, attrs }); + } + shouldCheckForMemLeaks() { + return this.ENV.getBool("IS_TEST"); + } + checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { + const numDataIdsAfter = this.backend.numDataIds(); + let numOutputDataIds = 0; + outInfos.forEach((info) => { + numOutputDataIds += info.dtype === "complex64" ? 3 : 1; + }); + const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; + const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; + if (dataIdsLeaked > 0) { + throw new Error(`Backend '${this.backendName}' has an internal memory leak (${dataIdsLeaked} data ids) after running '${kernelName}'`); + } + } + runKernelFunc(kernelParams) { + let outputs; + let saved = []; + const isTapeOn = this.isTapeOn(); + const startingBytecount = this.state.numBytes; + const startingNumTensors = this.state.numTensors; + if (this.shouldCheckForMemLeaks()) { + this.state.numDataMovesStack.push(0); + } + let kernelFunc3; + if (this.backendName == null) { + this.backend; + } + let out; + const kernelOrScopeName = isRegisteredKernelInvocation2(kernelParams) ? kernelParams.kernelName : this.state.activeScope != null ? this.state.activeScope.name : ""; + if (isRegisteredKernelInvocation2(kernelParams)) { + const { kernelName, inputs: inputs2, attrs: attrs2 } = kernelParams; + if (this.backendName == null) { + this.backend; + } + const kernel = getKernel2(kernelName, this.backendName); + assert3(kernel != null, () => `Cannot find registered kernel '${kernelName}' for backend '${this.backendName}'`); + kernelFunc3 = () => { + const numDataIdsBefore = this.backend.numDataIds(); + out = kernel.kernelFunc({ inputs: inputs2, attrs: attrs2, backend: this.backend }); + const outInfos = Array.isArray(out) ? out : [out]; + if (this.shouldCheckForMemLeaks()) { + this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); + } + const outTensors = outInfos.map((outInfo) => { + if (outInfo.rank != null) { + return outInfo; + } + const { dataId, shape, dtype } = outInfo; + return this.makeTensorFromDataId(dataId, shape, dtype); + }); + if (isTapeOn) { + const tensorsToSave = this.getTensorsForGradient(kernelName, inputs2, outTensors); + saved = this.saveTensorsForBackwardMode(tensorsToSave); + } + return outTensors; + }; + } else { + const { forwardFunc } = kernelParams; + const saveFunc = (tensors) => { + if (!isTapeOn) { + return; + } + saved = tensors.map((tensor3) => this.keep(this.clone(tensor3))); + }; + kernelFunc3 = () => { + const numDataIdsBefore = this.backend.numDataIds(); + out = this.tidy(() => forwardFunc(this.backend, saveFunc)); + const outs = Array.isArray(out) ? out : [out]; + if (this.shouldCheckForMemLeaks()) { + this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs); + } + return outs; + }; + } + const { inputs, attrs } = kernelParams; + const backwardsFunc = isRegisteredKernelInvocation2(kernelParams) ? null : kernelParams.backwardsFunc; + let kernelProfile; + this.scopedRun(() => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { + if (!this.ENV.getBool("DEBUG") && !this.state.profiling) { + outputs = kernelFunc3(); + } else { + kernelProfile = this.profiler.profileKernel(kernelOrScopeName, inputs, () => kernelFunc3()); + if (this.ENV.getBool("DEBUG")) { + this.profiler.logKernelProfile(kernelProfile); + } + outputs = kernelProfile.outputs; + } + }); + if (isTapeOn) { + this.addTapeNode(kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs); + } + if (this.state.profiling) { + this.state.activeProfile.kernels.push({ + name: kernelOrScopeName, + bytesAdded: this.state.numBytes - startingBytecount, + totalBytesSnapshot: this.state.numBytes, + tensorsAdded: this.state.numTensors - startingNumTensors, + totalTensorsSnapshot: this.state.numTensors, + inputShapes: Object.keys(inputs).map((key) => inputs[key] != null ? inputs[key].shape : null), + outputShapes: outputs.map((item) => item.shape), + kernelTimeMs: kernelProfile.timeMs, + extraInfo: kernelProfile.extraInfo + }); + } + return Array.isArray(out) ? outputs : outputs[0]; + } + saveTensorsForBackwardMode(tensors) { + const saved = tensors.map((tensor3) => this.keep(this.clone(tensor3))); + return saved; + } + getTensorsForGradient(kernelName, inputs, outputs) { + const gradConfig = getGradient2(kernelName); + if (gradConfig != null) { + const inputsToSave = gradConfig.inputsToSave || []; + const outputsToSave = gradConfig.outputsToSave || []; + let inputTensorsToSave; + if (gradConfig.saveAllInputs) { + assert3(Array.isArray(inputs), () => "saveAllInputs is true, expected inputs to be an array."); + inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); + } else { + inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); + } + const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); + return inputTensorsToSave.concat(outputTensorsToSave); + } + return []; + } + makeTensor(values, shape, dtype, backend4) { + if (values == null) { + throw new Error("Values passed to engine.makeTensor() are null"); + } + dtype = dtype || "float32"; + backend4 = backend4 || this.backend; + let backendVals = values; + if (dtype === "string" && isString2(values[0])) { + backendVals = values.map((d) => encodeString2(d)); + } + const dataId = backend4.write(backendVals, shape, dtype); + const t = new Tensor2(shape, dtype, dataId, this.nextTensorId()); + this.trackTensor(t, backend4); + if (dtype === "string") { + const info = this.state.tensorInfo.get(dataId); + const newBytes = bytesFromStringArray2(backendVals); + this.state.numBytes += newBytes - info.bytes; + info.bytes = newBytes; + } + return t; + } + makeTensorFromDataId(dataId, shape, dtype, backend4) { + dtype = dtype || "float32"; + const t = new Tensor2(shape, dtype, dataId, this.nextTensorId()); + this.trackTensor(t, backend4); + return t; + } + makeVariable(initialValue, trainable = true, name, dtype) { + name = name || this.nextVariableId().toString(); + if (dtype != null && dtype !== initialValue.dtype) { + initialValue = initialValue.cast(dtype); + } + const v = new Variable2(initialValue, trainable, name, this.nextTensorId()); + if (this.state.registeredVariables[v.name] != null) { + throw new Error(`Variable with name ${v.name} was already registered`); + } + this.state.registeredVariables[v.name] = v; + this.incRef(v, this.backend); + return v; + } + trackTensor(a, backend4) { + this.state.numTensors++; + if (a.dtype === "string") { + this.state.numStringTensors++; + } + let bytes = 0; + if (a.dtype !== "complex64" && a.dtype !== "string") { + bytes = a.size * bytesPerElement2(a.dtype); + } + this.state.numBytes += bytes; + if (!this.state.tensorInfo.has(a.dataId)) { + this.state.numDataBuffers++; + this.state.tensorInfo.set(a.dataId, { + backend: backend4 || this.backend, + dtype: a.dtype, + shape: a.shape, + bytes + }); + } + if (!(a instanceof Variable2)) { + this.track(a); + } + } + incRef(a, backend4) { + this.trackTensor(a, backend4); + this.backend.incRef(a.dataId); + } + removeDataId(dataId, backend4) { + if (this.state.tensorInfo.has(dataId) && this.state.tensorInfo.get(dataId).backend === backend4) { + this.state.tensorInfo.delete(dataId); + this.state.numDataBuffers--; + } + } + disposeTensor(a) { + if (!this.state.tensorInfo.has(a.dataId)) { + return; + } + const info = this.state.tensorInfo.get(a.dataId); + this.state.numTensors--; + if (a.dtype === "string") { + this.state.numStringTensors--; + this.state.numBytes -= info.bytes; + } + if (a.dtype !== "complex64" && a.dtype !== "string") { + const bytes = a.size * bytesPerElement2(a.dtype); + this.state.numBytes -= bytes; + } + if (info.backend.disposeData(a.dataId)) { + this.removeDataId(a.dataId, info.backend); + } + } + disposeVariables() { + for (const varName in this.state.registeredVariables) { + const v = this.state.registeredVariables[varName]; + this.disposeVariable(v); + } + } + disposeVariable(v) { + this.disposeTensor(v); + if (this.state.registeredVariables[v.name] != null) { + delete this.state.registeredVariables[v.name]; + } + } + memory() { + const info = this.backend.memory(); + info.numTensors = this.state.numTensors; + info.numDataBuffers = this.state.numDataBuffers; + info.numBytes = this.state.numBytes; + if (this.state.numStringTensors > 0) { + info.unreliable = true; + if (info.reasons == null) { + info.reasons = []; + } + info.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)"); + } + return info; + } + async profile(query) { + this.state.profiling = true; + const startBytes = this.state.numBytes; + const startNumTensors = this.state.numTensors; + this.state.activeProfile.kernels = []; + this.state.activeProfile.result = await query(); + this.state.profiling = false; + this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map((d) => d.totalBytesSnapshot)); + this.state.activeProfile.newBytes = this.state.numBytes - startBytes; + this.state.activeProfile.newTensors = this.state.numTensors - startNumTensors; + for (const kernel of this.state.activeProfile.kernels) { + kernel.kernelTimeMs = await kernel.kernelTimeMs; + kernel.extraInfo = await kernel.extraInfo; + } + return this.state.activeProfile; + } + isTapeOn() { + return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; + } + addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { + const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; + const gradConfig = getGradient2(kernelName); + if (gradConfig != null) { + gradientsFunc = gradConfig.gradFunc; + } + if (gradientsFunc != null) { + tapeNode.gradient = (dys) => { + dys = dys.map((dy, i) => { + if (dy == null) { + const output = outputs[i]; + const vals = makeZerosTypedArray2(output.size, output.dtype); + return this.makeTensor(vals, output.shape, output.dtype); + } + return dy; + }); + return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); + }; + } + this.state.activeTape.push(tapeNode); + } + keep(result) { + result.kept = true; + return result; + } + startTape() { + if (this.state.gradientDepth === 0) { + this.state.activeTape = []; + } + this.state.gradientDepth++; + } + endTape() { + this.state.gradientDepth--; + } + startScope(name) { + const scopeInfo = { + track: [], + name: "unnamed scope", + id: this.state.nextScopeId++ + }; + if (name) { + scopeInfo.name = name; + } + this.state.scopeStack.push(scopeInfo); + this.state.activeScope = scopeInfo; + } + endScope(result) { + const tensorsToTrackInParent = getTensorsInContainer2(result); + const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map((t) => t.id)); + for (let i = 0; i < this.state.activeScope.track.length; i++) { + const tensor3 = this.state.activeScope.track[i]; + if (!tensor3.kept && !tensorsToTrackInParentSet.has(tensor3.id)) { + tensor3.dispose(); + } + } + const oldScope = this.state.scopeStack.pop(); + this.state.activeScope = this.state.scopeStack.length === 0 ? null : this.state.scopeStack[this.state.scopeStack.length - 1]; + tensorsToTrackInParent.forEach((tensor3) => { + if (!tensor3.kept && tensor3.scopeId === oldScope.id) { + this.track(tensor3); + } + }); + } + gradients(f, xs, dy, allowNoGradients = false) { + assert3(xs.length > 0, () => "gradients() received an empty list of xs."); + if (dy != null && dy.dtype !== "float32") { + throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); + } + const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy("forward", f)); + assert3(y instanceof Tensor2, () => "The result y returned by f() must be a tensor."); + const filteredTape = getFilteredNodesXToY2(this.state.activeTape, xs, y); + if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { + throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y."); + } + return this.tidy("backward", () => { + const accumulatedGradientMap = {}; + accumulatedGradientMap[y.id] = dy == null ? ones4(y.shape) : dy; + backpropagateGradients2(accumulatedGradientMap, filteredTape, (f2) => this.tidy(f2), add5); + const grads2 = xs.map((x) => accumulatedGradientMap[x.id]); + if (this.state.gradientDepth === 0) { + this.state.activeTape.forEach((node2) => { + for (const tensor3 of node2.saved) { + tensor3.dispose(); + } + }); + this.state.activeTape = null; + } + return { value: y, grads: grads2 }; + }); + } + customGrad(f) { + assert3(isFunction2(f), () => "The f passed in customGrad(f) must be a function."); + return (...inputs) => { + assert3(inputs.every((t) => t instanceof Tensor2), () => "The args passed in customGrad(f)(x1, x2,...) must all be tensors"); + let res; + const inputMap = {}; + inputs.forEach((input3, i) => { + inputMap[i] = input3; + }); + const forwardFunc = (_, save) => { + res = f(...[...inputs, save]); + assert3(res.value instanceof Tensor2, () => "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"); + assert3(isFunction2(res.gradFunc), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."); + return res.value; + }; + const backwardsFunc = (dy, saved) => { + const gradRes = res.gradFunc(dy, saved); + const grads2 = Array.isArray(gradRes) ? gradRes : [gradRes]; + assert3(grads2.length === inputs.length, () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."); + assert3(grads2.every((t) => t instanceof Tensor2), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."); + const gradMap = {}; + grads2.forEach((grad2, i) => { + gradMap[i] = () => grad2; + }); + return gradMap; + }; + return this.runKernelFunc({ + forwardFunc, + backwardsFunc, + inputs: inputMap + }); + }; + } + readSync(dataId) { + const info = this.state.tensorInfo.get(dataId); + return info.backend.readSync(dataId); + } + read(dataId) { + const info = this.state.tensorInfo.get(dataId); + return info.backend.read(dataId); + } + async time(query) { + const start = now3(); + const timingInfo = await this.backend.time(query); + timingInfo.wallMs = now3() - start; + return timingInfo; + } + track(result) { + if (this.state.activeScope != null) { + result.scopeId = this.state.activeScope.id; + this.state.activeScope.track.push(result); + } + return result; + } + get registeredVariables() { + return this.state.registeredVariables; + } + reset() { + this.pendingBackendInitId++; + this.state.dispose(); + this.ENV.reset(); + this.state = new EngineState2(); + for (const backendName in this.registry) { + this.disposeRegisteredKernels(backendName); + this.registry[backendName].dispose(); + delete this.registry[backendName]; + } + this.backendName = null; + this.backendInstance = null; + this.pendingBackendInit = null; + } +}; +Engine2.nextTensorId = 0; +Engine2.nextVariableId = 0; +function ones4(shape) { + const values = makeOnesTypedArray2(sizeFromShape2(shape), "float32"); + return ENGINE2.makeTensor(values, shape, "float32"); +} +function getOrMakeEngine2() { + const ns = getGlobalNamespace2(); + if (ns._tfengine == null) { + const environment = new Environment2(ns); + ns._tfengine = new Engine2(environment); + } + setEnvironmentGlobal2(ns._tfengine.ENV); + setTensorTracker2(() => ns._tfengine); + return ns._tfengine; +} +var ENGINE2 = getOrMakeEngine2(); +function add5(a, b) { + const inputs = { a, b }; + return ENGINE2.runKernel(Add3, inputs); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/device_util.js +var device_util_exports2 = {}; +__export(device_util_exports2, { + isBrowser: () => isBrowser2, + isMobile: () => isMobile2 +}); +function _isNavigatorDefined2() { + return typeof navigator !== "undefined" && navigator != null; +} +function isMobile2(nav) { + if (nav || _isNavigatorDefined2()) { + if (!nav) { + nav = navigator; + } + if (nav.product === "ReactNative") { + return true; + } + const a = nav.userAgent || nav.vendor || (typeof window !== "undefined" ? window.opera : ""); + if (!a) { + const navAny = nav; + return navAny.userAgentData && navAny.userAgentData.mobile; + } + return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)); + } + return false; +} +function isBrowser2() { + return typeof window !== "undefined" && window.document != null || typeof WorkerGlobalScope !== "undefined"; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/flags.js +var ENV6 = env3(); +ENV6.registerFlag("DEBUG", () => false, (debugValue) => { + if (debugValue) { + console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance."); + } +}); +ENV6.registerFlag("IS_BROWSER", () => isBrowser2()); +ENV6.registerFlag("IS_NODE", () => typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined"); +ENV6.registerFlag("IS_CHROME", () => typeof navigator !== "undefined" && navigator != null && navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); +ENV6.registerFlag("PROD", () => false); +ENV6.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY", () => ENV6.getBool("DEBUG")); +ENV6.registerFlag("DEPRECATION_WARNINGS_ENABLED", () => true); +ENV6.registerFlag("IS_TEST", () => false); +ENV6.registerFlag("CHECK_COMPUTATION_FOR_ERRORS", () => true); +ENV6.registerFlag("WRAP_TO_IMAGEBITMAP", () => false); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js +function inferShape2(val, dtype) { + let firstElem = val; + if (isTypedArray2(val)) { + return dtype === "string" ? [] : [val.length]; + } + if (!Array.isArray(val)) { + return []; + } + const shape = []; + while (Array.isArray(firstElem) || isTypedArray2(firstElem) && dtype !== "string") { + shape.push(firstElem.length); + firstElem = firstElem[0]; + } + if (Array.isArray(val) && env3().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")) { + deepAssertShapeConsistency2(val, shape, []); + } + return shape; +} +function deepAssertShapeConsistency2(val, shape, indices) { + indices = indices || []; + if (!Array.isArray(val) && !isTypedArray2(val)) { + assert3(shape.length === 0, () => `Element arr[${indices.join("][")}] is a primitive, but should be an array/TypedArray of ${shape[0]} elements`); + return; + } + assert3(shape.length > 0, () => `Element arr[${indices.join("][")}] should be a primitive, but is an array of ${val.length} elements`); + assert3(val.length === shape[0], () => `Element arr[${indices.join("][")}] should have ${shape[0]} elements, but has ${val.length} elements`); + const subShape = shape.slice(1); + for (let i = 0; i < val.length; ++i) { + deepAssertShapeConsistency2(val[i], subShape, indices.concat(i)); + } +} +function assertDtype2(expectedDtype, actualDType, argName, functionName) { + if (expectedDtype === "string_or_numeric") { + return; + } + if (expectedDtype == null) { + throw new Error(`Expected dtype cannot be null.`); + } + if (expectedDtype !== "numeric" && expectedDtype !== actualDType || expectedDtype === "numeric" && actualDType === "string") { + throw new Error(`Argument '${argName}' passed to '${functionName}' must be ${expectedDtype} tensor, but got ${actualDType} tensor`); + } +} +function convertToTensor2(x, argName, functionName, parseAsDtype = "numeric") { + if (x instanceof Tensor2) { + assertDtype2(parseAsDtype, x.dtype, argName, functionName); + return x; + } + let inferredDtype = inferDtype2(x); + if (inferredDtype !== "string" && ["bool", "int32", "float32"].indexOf(parseAsDtype) >= 0) { + inferredDtype = parseAsDtype; + } + assertDtype2(parseAsDtype, inferredDtype, argName, functionName); + if (x == null || !isTypedArray2(x) && !Array.isArray(x) && typeof x !== "number" && typeof x !== "boolean" && typeof x !== "string") { + const type = x == null ? "null" : x.constructor.name; + throw new Error(`Argument '${argName}' passed to '${functionName}' must be a Tensor or TensorLike, but got '${type}'`); + } + const inferredShape = inferShape2(x, inferredDtype); + if (!isTypedArray2(x) && !Array.isArray(x)) { + x = [x]; + } + const skipTypedArray = true; + const values = inferredDtype !== "string" ? toTypedArray2(x, inferredDtype) : flatten4(x, [], skipTypedArray); + return ENGINE2.makeTensor(values, inferredShape, inferredDtype); +} +function convertToTensorArray2(arg, argName, functionName, parseAsDtype = "numeric") { + if (!Array.isArray(arg)) { + throw new Error(`Argument ${argName} passed to ${functionName} must be a \`Tensor[]\` or \`TensorLike[]\``); + } + const tensors = arg; + return tensors.map((t, i) => convertToTensor2(t, `${argName}[${i}]`, functionName, parseAsDtype)); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js +var OP_SCOPE_SUFFIX2 = "__op"; +function op2(f) { + const keys = Object.keys(f); + if (keys.length !== 1) { + throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${keys.length} keys.`); + } + let opName = keys[0]; + const fn = f[opName]; + if (opName.endsWith("_")) { + opName = opName.substring(0, opName.length - 1); + } + opName = opName + OP_SCOPE_SUFFIX2; + const f2 = (...args) => { + ENGINE2.startScope(opName); + try { + const result = fn(...args); + if (isPromise2(result)) { + console.error("Cannot return a Promise inside of tidy."); + } + ENGINE2.endScope(result); + return result; + } catch (ex) { + ENGINE2.endScope(null); + throw ex; + } + }; + Object.defineProperty(f2, "name", { value: opName, configurable: true }); + return f2; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/complex.js +function complex_2(real7, imag7) { + const $real = convertToTensor2(real7, "real", "complex"); + const $imag = convertToTensor2(imag7, "imag", "complex"); + assertShapesMatch2($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, must match in call to tf.complex().`); + const inputs = { real: $real, imag: $imag }; + return ENGINE2.runKernel(Complex2, inputs); +} +var complex4 = op2({ complex_: complex_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops_util.js +function makeTensor2(values, shape, inferredShape, dtype) { + if (dtype == null) { + dtype = inferDtype2(values); + } + if (dtype === "complex64") { + throw new Error(`Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).`); + } + if (!isTypedArray2(values) && !Array.isArray(values) && typeof values !== "number" && typeof values !== "boolean" && typeof values !== "string") { + throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray"); + } + if (shape != null) { + assertNonNegativeIntegerDimensions2(shape); + const providedSize = sizeFromShape2(shape); + const inferredSize = sizeFromShape2(inferredShape); + assert3(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ${providedSize} values but has ${inferredSize}`); + for (let i = 0; i < inferredShape.length; ++i) { + const inferred = inferredShape[i]; + const flatDimsDontMatch = i === inferredShape.length - 1 ? inferred !== sizeFromShape2(shape.slice(i)) : true; + assert3(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape (${inferredShape}) does not match the provided shape (${shape}). `); + } + } + if (!isTypedArray2(values) && !Array.isArray(values)) { + values = [values]; + } + shape = shape || inferredShape; + values = dtype !== "string" ? toTypedArray2(values, dtype) : flatten4(values, [], true); + return ENGINE2.makeTensor(values, shape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.js +function tensor2(values, shape, dtype) { + const inferredShape = inferShape2(values, dtype); + return makeTensor2(values, shape, inferredShape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/types.js +var DTYPE_VALUE_SIZE_MAP2 = { + "float32": 4, + "float16": 2, + "int32": 4, + "uint16": 2, + "uint8": 1, + "bool": 1, + "complex64": 8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js +var NUM_BYTES_STRING_LENGTH2 = 4; +async function encodeWeights2(tensors, group) { + const specs = []; + const dataPromises = []; + const names = Array.isArray(tensors) ? tensors.map((tensor3) => tensor3.name) : Object.keys(tensors); + for (let i = 0; i < names.length; ++i) { + const name = names[i]; + const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name]; + if (t.dtype !== "float32" && t.dtype !== "int32" && t.dtype !== "bool" && t.dtype !== "string" && t.dtype !== "complex64") { + throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`); + } + const spec = { name, shape: t.shape, dtype: t.dtype }; + if (t.dtype === "string") { + const utf8bytes = new Promise(async (resolve) => { + const vals = await t.bytes(); + const totalNumBytes = vals.reduce((p3, c) => p3 + c.length, 0) + NUM_BYTES_STRING_LENGTH2 * vals.length; + const bytes = new Uint8Array(totalNumBytes); + let offset = 0; + for (let i2 = 0; i2 < vals.length; i2++) { + const val = vals[i2]; + const bytesOfLength = new Uint8Array(new Uint32Array([val.length]).buffer); + bytes.set(bytesOfLength, offset); + offset += NUM_BYTES_STRING_LENGTH2; + bytes.set(val, offset); + offset += val.length; + } + resolve(bytes); + }); + dataPromises.push(utf8bytes); + } else { + dataPromises.push(t.data()); + } + if (group != null) { + spec.group = group; + } + specs.push(spec); + } + const tensorValues = await Promise.all(dataPromises); + return { data: concatenateTypedArrays2(tensorValues), specs }; +} +function decodeWeights2(buffer3, specs) { + const out = {}; + let float16Decode; + let offset = 0; + for (const spec of specs) { + const name = spec.name; + const dtype = spec.dtype; + const shape = spec.shape; + const size2 = sizeFromShape2(shape); + let values; + if ("quantization" in spec) { + const quantization = spec.quantization; + if (quantization.dtype === "uint8" || quantization.dtype === "uint16") { + if (!("min" in quantization && "scale" in quantization)) { + throw new Error(`Weight ${spec.name} with quantization ${quantization.dtype} doesn't have corresponding metadata min and scale.`); + } + } else if (quantization.dtype === "float16") { + if (dtype !== "float32") { + throw new Error(`Weight ${spec.name} is quantized with ${quantization.dtype} which only supports weights of type float32 not ${dtype}.`); + } + } else { + throw new Error(`Weight ${spec.name} has unknown quantization dtype ${quantization.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`); + } + const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP2[quantization.dtype]; + const byteBuffer = buffer3.slice(offset, offset + size2 * quantizationSizeFactor); + const quantizedArray = quantization.dtype === "uint8" ? new Uint8Array(byteBuffer) : new Uint16Array(byteBuffer); + if (dtype === "float32") { + if (quantization.dtype === "uint8" || quantization.dtype === "uint16") { + values = new Float32Array(quantizedArray.length); + for (let i = 0; i < quantizedArray.length; i++) { + const v = quantizedArray[i]; + values[i] = v * quantization.scale + quantization.min; + } + } else if (quantization.dtype === "float16") { + if (float16Decode === void 0) { + float16Decode = getFloat16Decoder2(); + } + values = float16Decode(quantizedArray); + } else { + throw new Error(`Unsupported quantization type ${quantization.dtype} for weight type float32.`); + } + } else if (dtype === "int32") { + if (quantization.dtype !== "uint8" && quantization.dtype !== "uint16") { + throw new Error(`Unsupported quantization type ${quantization.dtype} for weight type int32.`); + } + values = new Int32Array(quantizedArray.length); + for (let i = 0; i < quantizedArray.length; i++) { + const v = quantizedArray[i]; + values[i] = Math.round(v * quantization.scale + quantization.min); + } + } else { + throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`); + } + offset += size2 * quantizationSizeFactor; + } else if (dtype === "string") { + const size3 = sizeFromShape2(spec.shape); + values = []; + for (let i = 0; i < size3; i++) { + const byteLength = new Uint32Array(buffer3.slice(offset, offset + NUM_BYTES_STRING_LENGTH2))[0]; + offset += NUM_BYTES_STRING_LENGTH2; + const bytes = new Uint8Array(buffer3.slice(offset, offset + byteLength)); + values.push(bytes); + offset += byteLength; + } + } else { + const dtypeFactor = DTYPE_VALUE_SIZE_MAP2[dtype]; + const byteBuffer = buffer3.slice(offset, offset + size2 * dtypeFactor); + if (dtype === "float32") { + values = new Float32Array(byteBuffer); + } else if (dtype === "int32") { + values = new Int32Array(byteBuffer); + } else if (dtype === "bool") { + values = new Uint8Array(byteBuffer); + } else if (dtype === "complex64") { + values = new Float32Array(byteBuffer); + const real7 = new Float32Array(values.length / 2); + const image9 = new Float32Array(values.length / 2); + for (let i = 0; i < real7.length; i++) { + real7[i] = values[i * 2]; + image9[i] = values[i * 2 + 1]; + } + const realTensor = tensor2(real7, shape, "float32"); + const imageTensor = tensor2(image9, shape, "float32"); + out[name] = complex4(realTensor, imageTensor); + realTensor.dispose(); + imageTensor.dispose(); + } else { + throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`); + } + offset += size2 * dtypeFactor; + } + if (dtype !== "complex64") { + out[name] = tensor2(values, shape, dtype); + } + } + return out; +} +function concatenateTypedArrays2(xs) { + if (xs === null) { + throw new Error(`Invalid input value: ${JSON.stringify(xs)}`); + } + let totalByteLength = 0; + const normalizedXs = []; + xs.forEach((x) => { + totalByteLength += x.byteLength; + normalizedXs.push(x.byteLength === x.buffer.byteLength ? x : new x.constructor(x)); + if (!(x instanceof Float32Array || x instanceof Int32Array || x instanceof Uint8Array)) { + throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`); + } + }); + const y = new Uint8Array(totalByteLength); + let offset = 0; + normalizedXs.forEach((x) => { + y.set(new Uint8Array(x.buffer), offset); + offset += x.byteLength; + }); + return y.buffer; +} +var useNodeBuffer2 = typeof Buffer !== "undefined" && (typeof Blob === "undefined" || typeof atob === "undefined" || typeof btoa === "undefined"); +function stringByteLength2(str) { + if (useNodeBuffer2) { + return Buffer.byteLength(str); + } + return new Blob([str]).size; +} +function arrayBufferToBase64String2(buffer3) { + if (useNodeBuffer2) { + return Buffer.from(buffer3).toString("base64"); + } + const buf = new Uint8Array(buffer3); + let s = ""; + for (let i = 0, l = buf.length; i < l; i++) { + s += String.fromCharCode(buf[i]); + } + return btoa(s); +} +function base64StringToArrayBuffer2(str) { + if (useNodeBuffer2) { + const buf = Buffer.from(str, "base64"); + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + } + const s = atob(str); + const buffer3 = new Uint8Array(s.length); + for (let i = 0; i < s.length; ++i) { + buffer3.set([s.charCodeAt(i)], i); + } + return buffer3.buffer; +} +function concatenateArrayBuffers2(buffers) { + if (buffers.length === 1) { + return buffers[0]; + } + let totalByteLength = 0; + buffers.forEach((buffer3) => { + totalByteLength += buffer3.byteLength; + }); + const temp = new Uint8Array(totalByteLength); + let offset = 0; + buffers.forEach((buffer3) => { + temp.set(new Uint8Array(buffer3), offset); + offset += buffer3.byteLength; + }); + return temp.buffer; +} +function basename2(path) { + const SEPARATOR = "/"; + path = path.trim(); + while (path.endsWith(SEPARATOR)) { + path = path.slice(0, path.length - 1); + } + const items = path.split(SEPARATOR); + return items[items.length - 1]; +} +function getModelJSONForModelArtifacts2(artifacts, manifest) { + const result = { + modelTopology: artifacts.modelTopology, + format: artifacts.format, + generatedBy: artifacts.generatedBy, + convertedBy: artifacts.convertedBy, + weightsManifest: manifest + }; + if (artifacts.signature != null) { + result.signature = artifacts.signature; + } + if (artifacts.userDefinedMetadata != null) { + result.userDefinedMetadata = artifacts.userDefinedMetadata; + } + if (artifacts.modelInitializer != null) { + result.modelInitializer = artifacts.modelInitializer; + } + if (artifacts.trainingConfig != null) { + result.trainingConfig = artifacts.trainingConfig; + } + return result; +} +async function getModelArtifactsForJSON2(modelJSON, loadWeights3) { + const modelArtifacts = { + modelTopology: modelJSON.modelTopology, + format: modelJSON.format, + generatedBy: modelJSON.generatedBy, + convertedBy: modelJSON.convertedBy + }; + if (modelJSON.trainingConfig != null) { + modelArtifacts.trainingConfig = modelJSON.trainingConfig; + } + if (modelJSON.weightsManifest != null) { + const [weightSpecs, weightData] = await loadWeights3(modelJSON.weightsManifest); + modelArtifacts.weightSpecs = weightSpecs; + modelArtifacts.weightData = weightData; + } + if (modelJSON.signature != null) { + modelArtifacts.signature = modelJSON.signature; + } + if (modelJSON.userDefinedMetadata != null) { + modelArtifacts.userDefinedMetadata = modelJSON.userDefinedMetadata; + } + if (modelJSON.modelInitializer != null) { + modelArtifacts.modelInitializer = modelJSON.modelInitializer; + } + return modelArtifacts; +} +function getModelArtifactsInfoForJSON2(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error("Expected JSON model topology, received ArrayBuffer."); + } + return { + dateSaved: new Date(), + modelTopologyType: "JSON", + modelTopologyBytes: modelArtifacts.modelTopology == null ? 0 : stringByteLength2(JSON.stringify(modelArtifacts.modelTopology)), + weightSpecsBytes: modelArtifacts.weightSpecs == null ? 0 : stringByteLength2(JSON.stringify(modelArtifacts.weightSpecs)), + weightDataBytes: modelArtifacts.weightData == null ? 0 : modelArtifacts.weightData.byteLength + }; +} +function computeFloat16MantisaTable2() { + const convertMantissa = (i) => { + let m = i << 13; + let e = 0; + while ((m & 8388608) === 0) { + e -= 8388608; + m <<= 1; + } + m &= ~8388608; + e += 947912704; + return m | e; + }; + const mantisaTable = new Uint32Array(2048); + mantisaTable[0] = 0; + for (let i = 1; i < 1024; i++) { + mantisaTable[i] = convertMantissa(i); + } + for (let i = 1024; i < 2048; i++) { + mantisaTable[i] = 939524096 + (i - 1024 << 13); + } + return mantisaTable; +} +function computeFloat16ExponentTable2() { + const exponentTable = new Uint32Array(64); + exponentTable[0] = 0; + exponentTable[31] = 1199570944; + exponentTable[32] = 2147483648; + exponentTable[63] = 3347054592; + for (let i = 1; i < 31; i++) { + exponentTable[i] = i << 23; + } + for (let i = 33; i < 63; i++) { + exponentTable[i] = 2147483648 + (i - 32 << 23); + } + return exponentTable; +} +function computeFloat16OffsetTable2() { + const offsetTable = new Uint32Array(64); + for (let i = 0; i < 64; i++) { + offsetTable[i] = 1024; + } + offsetTable[0] = offsetTable[32] = 0; + return offsetTable; +} +function getFloat16Decoder2() { + const mantisaTable = computeFloat16MantisaTable2(); + const exponentTable = computeFloat16ExponentTable2(); + const offsetTable = computeFloat16OffsetTable2(); + return (quantizedArray) => { + const buffer3 = new ArrayBuffer(4 * quantizedArray.length); + const bufferUint32View = new Uint32Array(buffer3); + for (let index = 0; index < quantizedArray.length; index++) { + const float16Bits = quantizedArray[index]; + const float32Bits = mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 1023)] + exponentTable[float16Bits >> 10]; + bufferUint32View[index] = float32Bits; + } + return new Float32Array(buffer3); + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js +var IORouterRegistry2 = class { + constructor() { + this.saveRouters = []; + this.loadRouters = []; + } + static getInstance() { + if (IORouterRegistry2.instance == null) { + IORouterRegistry2.instance = new IORouterRegistry2(); + } + return IORouterRegistry2.instance; + } + static registerSaveRouter(saveRouter) { + IORouterRegistry2.getInstance().saveRouters.push(saveRouter); + } + static registerLoadRouter(loadRouter) { + IORouterRegistry2.getInstance().loadRouters.push(loadRouter); + } + static getSaveHandlers(url) { + return IORouterRegistry2.getHandlers(url, "save"); + } + static getLoadHandlers(url, loadOptions) { + return IORouterRegistry2.getHandlers(url, "load", loadOptions); + } + static getHandlers(url, handlerType, loadOptions) { + const validHandlers = []; + const routers = handlerType === "load" ? IORouterRegistry2.getInstance().loadRouters : IORouterRegistry2.getInstance().saveRouters; + routers.forEach((router) => { + const handler = router(url, loadOptions); + if (handler !== null) { + validHandlers.push(handler); + } + }); + return validHandlers; + } +}; +var registerSaveRouter2 = (loudRouter) => IORouterRegistry2.registerSaveRouter(loudRouter); +var registerLoadRouter2 = (loudRouter) => IORouterRegistry2.registerLoadRouter(loudRouter); +var getSaveHandlers2 = (url) => IORouterRegistry2.getSaveHandlers(url); +var getLoadHandlers2 = (url, loadOptions) => IORouterRegistry2.getLoadHandlers(url, loadOptions); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js +var DATABASE_NAME2 = "tensorflowjs"; +var DATABASE_VERSION2 = 1; +var MODEL_STORE_NAME2 = "models_store"; +var INFO_STORE_NAME2 = "model_info_store"; +function getIndexedDBFactory2() { + if (!env3().getBool("IS_BROWSER")) { + throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser."); + } + const theWindow = typeof window === "undefined" ? self : window; + const factory = theWindow.indexedDB || theWindow.mozIndexedDB || theWindow.webkitIndexedDB || theWindow.msIndexedDB || theWindow.shimIndexedDB; + if (factory == null) { + throw new Error("The current browser does not appear to support IndexedDB."); + } + return factory; +} +function setUpDatabase2(openRequest) { + const db = openRequest.result; + db.createObjectStore(MODEL_STORE_NAME2, { keyPath: "modelPath" }); + db.createObjectStore(INFO_STORE_NAME2, { keyPath: "modelPath" }); +} +var BrowserIndexedDB2 = class { + constructor(modelPath) { + this.indexedDB = getIndexedDBFactory2(); + if (modelPath == null || !modelPath) { + throw new Error("For IndexedDB, modelPath must not be null, undefined or empty."); + } + this.modelPath = modelPath; + } + async save(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet."); + } + return this.databaseAction(this.modelPath, modelArtifacts); + } + async load() { + return this.databaseAction(this.modelPath); + } + databaseAction(modelPath, modelArtifacts) { + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME2, DATABASE_VERSION2); + openRequest.onupgradeneeded = () => setUpDatabase2(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + if (modelArtifacts == null) { + const modelTx = db.transaction(MODEL_STORE_NAME2, "readonly"); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME2); + const getRequest = modelStore.get(this.modelPath); + getRequest.onsuccess = () => { + if (getRequest.result == null) { + db.close(); + return reject(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`)); + } else { + resolve(getRequest.result.modelArtifacts); + } + }; + getRequest.onerror = (error) => { + db.close(); + return reject(getRequest.error); + }; + modelTx.oncomplete = () => db.close(); + } else { + const modelArtifactsInfo = getModelArtifactsInfoForJSON2(modelArtifacts); + const infoTx = db.transaction(INFO_STORE_NAME2, "readwrite"); + let infoStore = infoTx.objectStore(INFO_STORE_NAME2); + const putInfoRequest = infoStore.put({ modelPath: this.modelPath, modelArtifactsInfo }); + let modelTx; + putInfoRequest.onsuccess = () => { + modelTx = db.transaction(MODEL_STORE_NAME2, "readwrite"); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME2); + const putModelRequest = modelStore.put({ + modelPath: this.modelPath, + modelArtifacts, + modelArtifactsInfo + }); + putModelRequest.onsuccess = () => resolve({ modelArtifactsInfo }); + putModelRequest.onerror = (error) => { + infoStore = infoTx.objectStore(INFO_STORE_NAME2); + const deleteInfoRequest = infoStore.delete(this.modelPath); + deleteInfoRequest.onsuccess = () => { + db.close(); + return reject(putModelRequest.error); + }; + deleteInfoRequest.onerror = (error2) => { + db.close(); + return reject(putModelRequest.error); + }; + }; + }; + putInfoRequest.onerror = (error) => { + db.close(); + return reject(putInfoRequest.error); + }; + infoTx.oncomplete = () => { + if (modelTx == null) { + db.close(); + } else { + modelTx.oncomplete = () => db.close(); + } + }; + } + }; + openRequest.onerror = (error) => reject(openRequest.error); + }); + } +}; +BrowserIndexedDB2.URL_SCHEME = "indexeddb://"; +var indexedDBRouter2 = (url) => { + if (!env3().getBool("IS_BROWSER")) { + return null; + } else { + if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB2.URL_SCHEME)) { + return browserIndexedDB2(url.slice(BrowserIndexedDB2.URL_SCHEME.length)); + } else { + return null; + } + } +}; +IORouterRegistry2.registerSaveRouter(indexedDBRouter2); +IORouterRegistry2.registerLoadRouter(indexedDBRouter2); +function browserIndexedDB2(modelPath) { + return new BrowserIndexedDB2(modelPath); +} +function maybeStripScheme3(key) { + return key.startsWith(BrowserIndexedDB2.URL_SCHEME) ? key.slice(BrowserIndexedDB2.URL_SCHEME.length) : key; +} +var BrowserIndexedDBManager2 = class { + constructor() { + this.indexedDB = getIndexedDBFactory2(); + } + async listModels() { + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME2, DATABASE_VERSION2); + openRequest.onupgradeneeded = () => setUpDatabase2(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + const tx = db.transaction(INFO_STORE_NAME2, "readonly"); + const store = tx.objectStore(INFO_STORE_NAME2); + const getAllInfoRequest = store.getAll(); + getAllInfoRequest.onsuccess = () => { + const out = {}; + for (const item of getAllInfoRequest.result) { + out[item.modelPath] = item.modelArtifactsInfo; + } + resolve(out); + }; + getAllInfoRequest.onerror = (error) => { + db.close(); + return reject(getAllInfoRequest.error); + }; + tx.oncomplete = () => db.close(); + }; + openRequest.onerror = (error) => reject(openRequest.error); + }); + } + async removeModel(path) { + path = maybeStripScheme3(path); + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME2, DATABASE_VERSION2); + openRequest.onupgradeneeded = () => setUpDatabase2(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + const infoTx = db.transaction(INFO_STORE_NAME2, "readwrite"); + const infoStore = infoTx.objectStore(INFO_STORE_NAME2); + const getInfoRequest = infoStore.get(path); + let modelTx; + getInfoRequest.onsuccess = () => { + if (getInfoRequest.result == null) { + db.close(); + return reject(new Error(`Cannot find model with path '${path}' in IndexedDB.`)); + } else { + const deleteInfoRequest = infoStore.delete(path); + const deleteModelData = () => { + modelTx = db.transaction(MODEL_STORE_NAME2, "readwrite"); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME2); + const deleteModelRequest = modelStore.delete(path); + deleteModelRequest.onsuccess = () => resolve(getInfoRequest.result.modelArtifactsInfo); + deleteModelRequest.onerror = (error) => reject(getInfoRequest.error); + }; + deleteInfoRequest.onsuccess = deleteModelData; + deleteInfoRequest.onerror = (error) => { + deleteModelData(); + db.close(); + return reject(getInfoRequest.error); + }; + } + }; + getInfoRequest.onerror = (error) => { + db.close(); + return reject(getInfoRequest.error); + }; + infoTx.oncomplete = () => { + if (modelTx == null) { + db.close(); + } else { + modelTx.oncomplete = () => db.close(); + } + }; + }; + openRequest.onerror = (error) => reject(openRequest.error); + }); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js +var PATH_SEPARATOR2 = "/"; +var PATH_PREFIX2 = "tensorflowjs_models"; +var INFO_SUFFIX2 = "info"; +var MODEL_TOPOLOGY_SUFFIX2 = "model_topology"; +var WEIGHT_SPECS_SUFFIX2 = "weight_specs"; +var WEIGHT_DATA_SUFFIX2 = "weight_data"; +var MODEL_METADATA_SUFFIX2 = "model_metadata"; +function getModelKeys2(path) { + return { + info: [PATH_PREFIX2, path, INFO_SUFFIX2].join(PATH_SEPARATOR2), + topology: [PATH_PREFIX2, path, MODEL_TOPOLOGY_SUFFIX2].join(PATH_SEPARATOR2), + weightSpecs: [PATH_PREFIX2, path, WEIGHT_SPECS_SUFFIX2].join(PATH_SEPARATOR2), + weightData: [PATH_PREFIX2, path, WEIGHT_DATA_SUFFIX2].join(PATH_SEPARATOR2), + modelMetadata: [PATH_PREFIX2, path, MODEL_METADATA_SUFFIX2].join(PATH_SEPARATOR2) + }; +} +function removeItems2(keys) { + for (const key of Object.values(keys)) { + window.localStorage.removeItem(key); + } +} +function getModelPathFromKey2(key) { + const items = key.split(PATH_SEPARATOR2); + if (items.length < 3) { + throw new Error(`Invalid key format: ${key}`); + } + return items.slice(1, items.length - 1).join(PATH_SEPARATOR2); +} +function maybeStripScheme4(key) { + return key.startsWith(BrowserLocalStorage2.URL_SCHEME) ? key.slice(BrowserLocalStorage2.URL_SCHEME.length) : key; +} +var BrowserLocalStorage2 = class { + constructor(modelPath) { + if (!env3().getBool("IS_BROWSER") || typeof window === "undefined" || typeof window.localStorage === "undefined") { + throw new Error("The current environment does not support local storage."); + } + this.LS = window.localStorage; + if (modelPath == null || !modelPath) { + throw new Error("For local storage, modelPath must not be null, undefined or empty."); + } + this.modelPath = modelPath; + this.keys = getModelKeys2(this.modelPath); + } + async save(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet."); + } else { + const topology = JSON.stringify(modelArtifacts.modelTopology); + const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs); + const modelArtifactsInfo = getModelArtifactsInfoForJSON2(modelArtifacts); + try { + this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo)); + this.LS.setItem(this.keys.topology, topology); + this.LS.setItem(this.keys.weightSpecs, weightSpecs); + this.LS.setItem(this.keys.weightData, arrayBufferToBase64String2(modelArtifacts.weightData)); + const metadata = { + format: modelArtifacts.format, + generatedBy: modelArtifacts.generatedBy, + convertedBy: modelArtifacts.convertedBy, + signature: modelArtifacts.signature != null ? modelArtifacts.signature : void 0, + userDefinedMetadata: modelArtifacts.userDefinedMetadata != null ? modelArtifacts.userDefinedMetadata : void 0, + modelInitializer: modelArtifacts.modelInitializer != null ? modelArtifacts.modelInitializer : void 0, + trainingConfig: modelArtifacts.trainingConfig != null ? modelArtifacts.trainingConfig : void 0 + }; + this.LS.setItem(this.keys.modelMetadata, JSON.stringify(metadata)); + return { modelArtifactsInfo }; + } catch (err) { + removeItems2(this.keys); + throw new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`); + } + } + } + async load() { + const info = JSON.parse(this.LS.getItem(this.keys.info)); + if (info == null) { + throw new Error(`In local storage, there is no model with name '${this.modelPath}'`); + } + if (info.modelTopologyType !== "JSON") { + throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet."); + } + const out = {}; + const topology = JSON.parse(this.LS.getItem(this.keys.topology)); + if (topology == null) { + throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`); + } + out.modelTopology = topology; + const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); + if (weightSpecs == null) { + throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`); + } + out.weightSpecs = weightSpecs; + const metadataString = this.LS.getItem(this.keys.modelMetadata); + if (metadataString != null) { + const metadata = JSON.parse(metadataString); + out.format = metadata.format; + out.generatedBy = metadata.generatedBy; + out.convertedBy = metadata.convertedBy; + if (metadata.signature != null) { + out.signature = metadata.signature; + } + if (metadata.userDefinedMetadata != null) { + out.userDefinedMetadata = metadata.userDefinedMetadata; + } + if (metadata.modelInitializer != null) { + out.modelInitializer = metadata.modelInitializer; + } + if (metadata.trainingConfig != null) { + out.trainingConfig = metadata.trainingConfig; + } + } + const weightDataBase64 = this.LS.getItem(this.keys.weightData); + if (weightDataBase64 == null) { + throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`); + } + out.weightData = base64StringToArrayBuffer2(weightDataBase64); + return out; + } +}; +BrowserLocalStorage2.URL_SCHEME = "localstorage://"; +var localStorageRouter2 = (url) => { + if (!env3().getBool("IS_BROWSER")) { + return null; + } else { + if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage2.URL_SCHEME)) { + return browserLocalStorage2(url.slice(BrowserLocalStorage2.URL_SCHEME.length)); + } else { + return null; + } + } +}; +IORouterRegistry2.registerSaveRouter(localStorageRouter2); +IORouterRegistry2.registerLoadRouter(localStorageRouter2); +function browserLocalStorage2(modelPath) { + return new BrowserLocalStorage2(modelPath); +} +var BrowserLocalStorageManager2 = class { + constructor() { + assert3(env3().getBool("IS_BROWSER"), () => "Current environment is not a web browser"); + assert3(typeof window === "undefined" || typeof window.localStorage !== "undefined", () => "Current browser does not appear to support localStorage"); + this.LS = window.localStorage; + } + async listModels() { + const out = {}; + const prefix = PATH_PREFIX2 + PATH_SEPARATOR2; + const suffix = PATH_SEPARATOR2 + INFO_SUFFIX2; + for (let i = 0; i < this.LS.length; ++i) { + const key = this.LS.key(i); + if (key.startsWith(prefix) && key.endsWith(suffix)) { + const modelPath = getModelPathFromKey2(key); + out[modelPath] = JSON.parse(this.LS.getItem(key)); + } + } + return out; + } + async removeModel(path) { + path = maybeStripScheme4(path); + const keys = getModelKeys2(path); + if (this.LS.getItem(keys.info) == null) { + throw new Error(`Cannot find model at path '${path}'`); + } + const info = JSON.parse(this.LS.getItem(keys.info)); + removeItems2(keys); + return info; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js +var URL_SCHEME_SUFFIX2 = "://"; +var ModelStoreManagerRegistry2 = class { + constructor() { + this.managers = {}; + } + static getInstance() { + if (ModelStoreManagerRegistry2.instance == null) { + ModelStoreManagerRegistry2.instance = new ModelStoreManagerRegistry2(); + } + return ModelStoreManagerRegistry2.instance; + } + static registerManager(scheme, manager) { + assert3(scheme != null, () => "scheme must not be undefined or null."); + if (scheme.endsWith(URL_SCHEME_SUFFIX2)) { + scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX2)); + } + assert3(scheme.length > 0, () => "scheme must not be an empty string."); + const registry = ModelStoreManagerRegistry2.getInstance(); + assert3(registry.managers[scheme] == null, () => `A model store manager is already registered for scheme '${scheme}'.`); + registry.managers[scheme] = manager; + } + static getManager(scheme) { + const manager = this.getInstance().managers[scheme]; + if (manager == null) { + throw new Error(`Cannot find model manager for scheme '${scheme}'`); + } + return manager; + } + static getSchemes() { + return Object.keys(this.getInstance().managers); + } +}; +function parseURL2(url) { + if (url.indexOf(URL_SCHEME_SUFFIX2) === -1) { + throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${ModelStoreManagerRegistry2.getSchemes().join(",")}`); + } + return { + scheme: url.split(URL_SCHEME_SUFFIX2)[0], + path: url.split(URL_SCHEME_SUFFIX2)[1] + }; +} +async function cloneModelInternal2(sourceURL, destURL, deleteSource = false) { + assert3(sourceURL !== destURL, () => `Old path and new path are the same: '${sourceURL}'`); + const loadHandlers = IORouterRegistry2.getLoadHandlers(sourceURL); + assert3(loadHandlers.length > 0, () => `Copying failed because no load handler is found for source URL ${sourceURL}.`); + assert3(loadHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) load handlers for source URL ${sourceURL}.`); + const loadHandler = loadHandlers[0]; + const saveHandlers = IORouterRegistry2.getSaveHandlers(destURL); + assert3(saveHandlers.length > 0, () => `Copying failed because no save handler is found for destination URL ${destURL}.`); + assert3(saveHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) save handlers for destination URL ${destURL}.`); + const saveHandler = saveHandlers[0]; + const sourceScheme = parseURL2(sourceURL).scheme; + const sourcePath = parseURL2(sourceURL).path; + const sameMedium = sourceScheme === parseURL2(sourceURL).scheme; + const modelArtifacts = await loadHandler.load(); + if (deleteSource && sameMedium) { + await ModelStoreManagerRegistry2.getManager(sourceScheme).removeModel(sourcePath); + } + const saveResult = await saveHandler.save(modelArtifacts); + if (deleteSource && !sameMedium) { + await ModelStoreManagerRegistry2.getManager(sourceScheme).removeModel(sourcePath); + } + return saveResult.modelArtifactsInfo; +} +async function listModels2() { + const schemes = ModelStoreManagerRegistry2.getSchemes(); + const out = {}; + for (const scheme of schemes) { + const schemeOut = await ModelStoreManagerRegistry2.getManager(scheme).listModels(); + for (const path in schemeOut) { + const url = scheme + URL_SCHEME_SUFFIX2 + path; + out[url] = schemeOut[path]; + } + } + return out; +} +async function removeModel2(url) { + const schemeAndPath = parseURL2(url); + const manager = ModelStoreManagerRegistry2.getManager(schemeAndPath.scheme); + return manager.removeModel(schemeAndPath.path); +} +async function copyModel2(sourceURL, destURL) { + const deleteSource = false; + return cloneModelInternal2(sourceURL, destURL, deleteSource); +} +async function moveModel2(sourceURL, destURL) { + const deleteSource = true; + return cloneModelInternal2(sourceURL, destURL, deleteSource); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.js +var PlatformBrowser2 = class { + fetch(path, init2) { + return fetch(path, init2); + } + now() { + return performance.now(); + } + encode(text, encoding) { + if (encoding !== "utf-8" && encoding !== "utf8") { + throw new Error(`Browser's encoder only supports utf-8, but got ${encoding}`); + } + if (this.textEncoder == null) { + this.textEncoder = new TextEncoder(); + } + return this.textEncoder.encode(text); + } + decode(bytes, encoding) { + return new TextDecoder(encoding).decode(bytes); + } +}; +if (env3().get("IS_BROWSER")) { + env3().setPlatform("browser", new PlatformBrowser2()); + try { + ModelStoreManagerRegistry2.registerManager(BrowserLocalStorage2.URL_SCHEME, new BrowserLocalStorageManager2()); + } catch (err) { + } + try { + ModelStoreManagerRegistry2.registerManager(BrowserIndexedDB2.URL_SCHEME, new BrowserIndexedDBManager2()); + } catch (err) { + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.js +var getNodeFetch2 = { + importFetch: () => require_browser2() +}; +var systemFetch2; +var PlatformNode2 = class { + constructor() { + this.util = __require("util"); + this.textEncoder = new this.util.TextEncoder(); + } + fetch(path, requestInits) { + if (env3().global.fetch != null) { + return env3().global.fetch(path, requestInits); + } + if (systemFetch2 == null) { + systemFetch2 = getNodeFetch2.importFetch(); + } + return systemFetch2(path, requestInits); + } + now() { + const time2 = process.hrtime(); + return time2[0] * 1e3 + time2[1] / 1e6; + } + encode(text, encoding) { + if (encoding !== "utf-8" && encoding !== "utf8") { + throw new Error(`Node built-in encoder only supports utf-8, but got ${encoding}`); + } + return this.textEncoder.encode(text); + } + decode(bytes, encoding) { + if (bytes.length === 0) { + return ""; + } + return new this.util.TextDecoder(encoding).decode(bytes); + } +}; +if (env3().get("IS_NODE")) { + env3().setPlatform("node", new PlatformNode2()); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.js +function buffer2(shape, dtype = "float32", values) { + dtype = dtype || "float32"; + assertNonNegativeIntegerDimensions2(shape); + return new TensorBuffer2(shape, dtype, values); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/cast.js +function cast_2(x, dtype) { + const $x = convertToTensor2(x, "x", "cast"); + if (!isValidDtype2(dtype)) { + throw new Error(`Failed to cast to unknown dtype ${dtype}`); + } + if (dtype === "string" && $x.dtype !== "string" || dtype !== "string" && $x.dtype === "string") { + throw new Error("Only strings can be casted to strings"); + } + const inputs = { x: $x }; + const attrs = { dtype }; + return ENGINE2.runKernel(Cast2, inputs, attrs); +} +var cast6 = op2({ cast_: cast_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/clone.js +function clone_2(x) { + const $x = convertToTensor2(x, "x", "clone", "string_or_numeric"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Identity3, inputs); +} +var clone2 = op2({ clone_: clone_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/print.js +function print3(x, verbose = false) { + console.log(x.toString(verbose)); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.js +getOrMakeEngine2(); +var opHandler4 = { + buffer: buffer2, + cast: cast6, + clone: clone2, + print: print3 +}; +setOpHandler2(opHandler4); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/io.js +var io_exports2 = {}; +__export(io_exports2, { + browserFiles: () => browserFiles2, + browserHTTPRequest: () => browserHTTPRequest2, + concatenateArrayBuffers: () => concatenateArrayBuffers2, + copyModel: () => copyModel2, + decodeWeights: () => decodeWeights2, + encodeWeights: () => encodeWeights2, + fromMemory: () => fromMemory2, + getLoadHandlers: () => getLoadHandlers2, + getModelArtifactsForJSON: () => getModelArtifactsForJSON2, + getModelArtifactsInfoForJSON: () => getModelArtifactsInfoForJSON2, + getSaveHandlers: () => getSaveHandlers2, + http: () => http2, + isHTTPScheme: () => isHTTPScheme2, + listModels: () => listModels2, + loadWeights: () => loadWeights2, + moveModel: () => moveModel2, + registerLoadRouter: () => registerLoadRouter2, + registerSaveRouter: () => registerSaveRouter2, + removeModel: () => removeModel2, + weightsLoaderFactory: () => weightsLoaderFactory2, + withSaveHandler: () => withSaveHandler2 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js +var DEFAULT_FILE_NAME_PREFIX2 = "model"; +var DEFAULT_JSON_EXTENSION_NAME2 = ".json"; +var DEFAULT_WEIGHT_DATA_EXTENSION_NAME2 = ".weights.bin"; +function defer2(f) { + return new Promise((resolve) => setTimeout(resolve)).then(f); +} +var BrowserDownloads2 = class { + constructor(fileNamePrefix) { + if (!env3().getBool("IS_BROWSER")) { + throw new Error("browserDownloads() cannot proceed because the current environment is not a browser."); + } + if (fileNamePrefix.startsWith(BrowserDownloads2.URL_SCHEME)) { + fileNamePrefix = fileNamePrefix.slice(BrowserDownloads2.URL_SCHEME.length); + } + if (fileNamePrefix == null || fileNamePrefix.length === 0) { + fileNamePrefix = DEFAULT_FILE_NAME_PREFIX2; + } + this.modelJsonFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME2; + this.weightDataFileName = fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME2; + } + async save(modelArtifacts) { + if (typeof document === "undefined") { + throw new Error("Browser downloads are not supported in this environment since `document` is not present"); + } + const weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: "application/octet-stream" })); + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet."); + } else { + const weightsManifest = [{ + paths: ["./" + this.weightDataFileName], + weights: modelArtifacts.weightSpecs + }]; + const modelJSON = getModelJSONForModelArtifacts2(modelArtifacts, weightsManifest); + const modelJsonURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelJSON)], { type: "application/json" })); + const jsonAnchor = this.modelJsonAnchor == null ? document.createElement("a") : this.modelJsonAnchor; + jsonAnchor.download = this.modelJsonFileName; + jsonAnchor.href = modelJsonURL; + await defer2(() => jsonAnchor.dispatchEvent(new MouseEvent("click"))); + if (modelArtifacts.weightData != null) { + const weightDataAnchor = this.weightDataAnchor == null ? document.createElement("a") : this.weightDataAnchor; + weightDataAnchor.download = this.weightDataFileName; + weightDataAnchor.href = weightsURL; + await defer2(() => weightDataAnchor.dispatchEvent(new MouseEvent("click"))); + } + return { modelArtifactsInfo: getModelArtifactsInfoForJSON2(modelArtifacts) }; + } + } +}; +BrowserDownloads2.URL_SCHEME = "downloads://"; +var BrowserFiles2 = class { + constructor(files) { + if (files == null || files.length < 1) { + throw new Error(`When calling browserFiles, at least 1 file is required, but received ${files}`); + } + this.jsonFile = files[0]; + this.weightsFiles = files.slice(1); + } + async load() { + return new Promise((resolve, reject) => { + const jsonReader = new FileReader(); + jsonReader.onload = (event) => { + const modelJSON = JSON.parse(event.target.result); + const modelTopology = modelJSON.modelTopology; + if (modelTopology == null) { + reject(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`)); + return; + } + const weightsManifest = modelJSON.weightsManifest; + if (weightsManifest == null) { + reject(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`)); + return; + } + if (this.weightsFiles.length === 0) { + resolve({ modelTopology }); + return; + } + const modelArtifactsPromise = getModelArtifactsForJSON2(modelJSON, (weightsManifest2) => this.loadWeights(weightsManifest2)); + resolve(modelArtifactsPromise); + }; + jsonReader.onerror = (error) => reject(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`); + jsonReader.readAsText(this.jsonFile); + }); + } + loadWeights(weightsManifest) { + const weightSpecs = []; + const paths = []; + for (const entry of weightsManifest) { + weightSpecs.push(...entry.weights); + paths.push(...entry.paths); + } + const pathToFile = this.checkManifestAndWeightFiles(weightsManifest); + const promises = paths.map((path) => this.loadWeightsFile(path, pathToFile[path])); + return Promise.all(promises).then((buffers) => [weightSpecs, concatenateArrayBuffers2(buffers)]); + } + loadWeightsFile(path, file) { + return new Promise((resolve, reject) => { + const weightFileReader = new FileReader(); + weightFileReader.onload = (event) => { + const weightData = event.target.result; + resolve(weightData); + }; + weightFileReader.onerror = (error) => reject(`Failed to weights data from file of path '${path}'.`); + weightFileReader.readAsArrayBuffer(file); + }); + } + checkManifestAndWeightFiles(manifest) { + const basenames = []; + const fileNames = this.weightsFiles.map((file) => basename2(file.name)); + const pathToFile = {}; + for (const group of manifest) { + group.paths.forEach((path) => { + const pathBasename = basename2(path); + if (basenames.indexOf(pathBasename) !== -1) { + throw new Error(`Duplicate file basename found in weights manifest: '${pathBasename}'`); + } + basenames.push(pathBasename); + if (fileNames.indexOf(pathBasename) === -1) { + throw new Error(`Weight file with basename '${pathBasename}' is not provided.`); + } else { + pathToFile[path] = this.weightsFiles[fileNames.indexOf(pathBasename)]; + } + }); + } + if (basenames.length !== this.weightsFiles.length) { + throw new Error(`Mismatch in the number of files in weights manifest (${basenames.length}) and the number of weight files provided (${this.weightsFiles.length}).`); + } + return pathToFile; + } +}; +var browserDownloadsRouter2 = (url) => { + if (!env3().getBool("IS_BROWSER")) { + return null; + } else { + if (!Array.isArray(url) && url.startsWith(BrowserDownloads2.URL_SCHEME)) { + return browserDownloads2(url.slice(BrowserDownloads2.URL_SCHEME.length)); + } else { + return null; + } + } +}; +IORouterRegistry2.registerSaveRouter(browserDownloadsRouter2); +function browserDownloads2(fileNamePrefix = "model") { + return new BrowserDownloads2(fileNamePrefix); +} +function browserFiles2(files) { + return new BrowserFiles2(files); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/progress.js +function monitorPromisesProgress2(promises, onProgress, startFraction, endFraction) { + checkPromises(promises); + startFraction = startFraction == null ? 0 : startFraction; + endFraction = endFraction == null ? 1 : endFraction; + checkFraction(startFraction, endFraction); + let resolvedPromise = 0; + const registerMonitor = (promise) => { + promise.then((value) => { + const fraction = startFraction + ++resolvedPromise / promises.length * (endFraction - startFraction); + onProgress(fraction); + return value; + }); + return promise; + }; + function checkPromises(promises2) { + assert3(promises2 != null && Array.isArray(promises2) && promises2.length > 0, () => "promises must be a none empty array"); + } + function checkFraction(startFraction2, endFraction2) { + assert3(startFraction2 >= 0 && startFraction2 <= 1, () => `Progress fraction must be in range [0, 1], but got startFraction ${startFraction2}`); + assert3(endFraction2 >= 0 && endFraction2 <= 1, () => `Progress fraction must be in range [0, 1], but got endFraction ${endFraction2}`); + assert3(endFraction2 >= startFraction2, () => `startFraction must be no more than endFraction, but got startFraction ${startFraction2} and endFraction ${endFraction2}`); + } + return Promise.all(promises.map(registerMonitor)); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js +async function loadWeightsAsArrayBuffer2(fetchURLs, loadOptions) { + if (loadOptions == null) { + loadOptions = {}; + } + const fetchFunc = loadOptions.fetchFunc == null ? env3().platform.fetch : loadOptions.fetchFunc; + const requests = fetchURLs.map((fetchURL) => fetchFunc(fetchURL, loadOptions.requestInit, { isBinary: true })); + const fetchStartFraction = 0; + const fetchEndFraction = 0.5; + const responses = loadOptions.onProgress == null ? await Promise.all(requests) : await monitorPromisesProgress2(requests, loadOptions.onProgress, fetchStartFraction, fetchEndFraction); + const bufferPromises = responses.map((response) => response.arrayBuffer()); + const bufferStartFraction = 0.5; + const bufferEndFraction = 1; + const buffers = loadOptions.onProgress == null ? await Promise.all(bufferPromises) : await monitorPromisesProgress2(bufferPromises, loadOptions.onProgress, bufferStartFraction, bufferEndFraction); + return buffers; +} +async function loadWeights2(manifest, filePathPrefix = "", weightNames, requestInit) { + const fetchWeights = (fetchUrls) => loadWeightsAsArrayBuffer2(fetchUrls, { requestInit }); + const loadWeights3 = weightsLoaderFactory2(fetchWeights); + return loadWeights3(manifest, filePathPrefix, weightNames); +} +function weightsLoaderFactory2(fetchWeightsFunction) { + return async (manifest, filePathPrefix = "", weightNames) => { + const groupIndicesToFetchMap = manifest.map(() => false); + const groupWeightsToFetch = {}; + const weightsFound = weightNames != null ? weightNames.map(() => false) : []; + const allManifestWeightNames = []; + manifest.forEach((manifestGroupConfig, groupIndex) => { + let groupOffset = 0; + manifestGroupConfig.weights.forEach((weightsEntry) => { + const rawDtype = "quantization" in weightsEntry ? weightsEntry.quantization.dtype : weightsEntry.dtype; + const weightsBytes = DTYPE_VALUE_SIZE_MAP2[rawDtype] * sizeFromShape2(weightsEntry.shape); + const enqueueWeightsForFetchingFn = () => { + groupIndicesToFetchMap[groupIndex] = true; + if (groupWeightsToFetch[groupIndex] == null) { + groupWeightsToFetch[groupIndex] = []; + } + groupWeightsToFetch[groupIndex].push({ + manifestEntry: weightsEntry, + groupOffset, + sizeBytes: weightsBytes + }); + }; + if (weightNames != null) { + weightNames.forEach((weightName, weightIndex) => { + if (weightName === weightsEntry.name) { + enqueueWeightsForFetchingFn(); + weightsFound[weightIndex] = true; + } + }); + } else { + enqueueWeightsForFetchingFn(); + } + allManifestWeightNames.push(weightsEntry.name); + groupOffset += weightsBytes; + }); + }); + if (!weightsFound.every((found) => found)) { + const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]); + throw new Error(`Could not find weights in manifest with names: ${weightsNotFound.join(", ")}. +Manifest JSON has weights with names: ${allManifestWeightNames.join(", ")}.`); + } + const groupIndicesToFetch = groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => { + if (shouldFetch) { + accumulator.push(i); + } + return accumulator; + }, []); + const fetchUrls = []; + groupIndicesToFetch.forEach((i) => { + manifest[i].paths.forEach((filepath) => { + const fetchUrl = filePathPrefix + (!filePathPrefix.endsWith("/") ? "/" : "") + filepath; + fetchUrls.push(fetchUrl); + }); + }); + const buffers = await fetchWeightsFunction(fetchUrls); + const weightsTensorMap = {}; + let bufferIndexOffset = 0; + groupIndicesToFetch.forEach((i) => { + const numBuffers = manifest[i].paths.length; + let groupBytes = 0; + for (let i2 = 0; i2 < numBuffers; i2++) { + groupBytes += buffers[bufferIndexOffset + i2].byteLength; + } + const groupBuffer = new ArrayBuffer(groupBytes); + const groupByteBuffer = new Uint8Array(groupBuffer); + let groupBufferOffset = 0; + for (let i2 = 0; i2 < numBuffers; i2++) { + const buffer3 = new Uint8Array(buffers[bufferIndexOffset + i2]); + groupByteBuffer.set(buffer3, groupBufferOffset); + groupBufferOffset += buffer3.byteLength; + } + const weightsEntries = groupWeightsToFetch[i]; + weightsEntries.forEach((weightsEntry) => { + const byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes); + const nameToTensorMap = decodeWeights2(byteBuffer, [weightsEntry.manifestEntry]); + for (const name in nameToTensorMap) { + weightsTensorMap[name] = nameToTensorMap[name]; + } + }); + bufferIndexOffset += numBuffers; + }); + return weightsTensorMap; + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/http.js +var OCTET_STREAM_MIME_TYPE2 = "application/octet-stream"; +var JSON_TYPE2 = "application/json"; +var HTTPRequest2 = class { + constructor(path, loadOptions) { + this.DEFAULT_METHOD = "POST"; + if (loadOptions == null) { + loadOptions = {}; + } + this.weightPathPrefix = loadOptions.weightPathPrefix; + this.onProgress = loadOptions.onProgress; + this.weightUrlConverter = loadOptions.weightUrlConverter; + if (loadOptions.fetchFunc != null) { + assert3(typeof loadOptions.fetchFunc === "function", () => "Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"); + this.fetch = loadOptions.fetchFunc; + } else { + this.fetch = env3().platform.fetch; + } + assert3(path != null && path.length > 0, () => "URL path for http must not be null, undefined or empty."); + if (Array.isArray(path)) { + assert3(path.length === 2, () => `URL paths for http must have a length of 2, (actual length is ${path.length}).`); + } + this.path = path; + if (loadOptions.requestInit != null && loadOptions.requestInit.body != null) { + throw new Error("requestInit is expected to have no pre-existing body, but has one."); + } + this.requestInit = loadOptions.requestInit || {}; + } + async save(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet."); + } + const init2 = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); + init2.body = new FormData(); + const weightsManifest = [{ + paths: ["./model.weights.bin"], + weights: modelArtifacts.weightSpecs + }]; + const modelTopologyAndWeightManifest = getModelJSONForModelArtifacts2(modelArtifacts, weightsManifest); + init2.body.append("model.json", new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: JSON_TYPE2 }), "model.json"); + if (modelArtifacts.weightData != null) { + init2.body.append("model.weights.bin", new Blob([modelArtifacts.weightData], { type: OCTET_STREAM_MIME_TYPE2 }), "model.weights.bin"); + } + const response = await this.fetch(this.path, init2); + if (response.ok) { + return { + modelArtifactsInfo: getModelArtifactsInfoForJSON2(modelArtifacts), + responses: [response] + }; + } else { + throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${response.status}.`); + } + } + async load() { + const modelConfigRequest = await this.fetch(this.path, this.requestInit); + if (!modelConfigRequest.ok) { + throw new Error(`Request to ${this.path} failed with status code ${modelConfigRequest.status}. Please verify this URL points to the model JSON of the model to load.`); + } + let modelJSON; + try { + modelJSON = await modelConfigRequest.json(); + } catch (e) { + let message = `Failed to parse model JSON of response from ${this.path}.`; + if (this.path.endsWith(".pb")) { + message += " Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository."; + } else { + message += " Please make sure the server is serving valid JSON for this request."; + } + throw new Error(message); + } + const modelTopology = modelJSON.modelTopology; + const weightsManifest = modelJSON.weightsManifest; + if (modelTopology == null && weightsManifest == null) { + throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`); + } + return getModelArtifactsForJSON2(modelJSON, (weightsManifest2) => this.loadWeights(weightsManifest2)); + } + async loadWeights(weightsManifest) { + const weightPath = Array.isArray(this.path) ? this.path[1] : this.path; + const [prefix, suffix] = parseUrl2(weightPath); + const pathPrefix = this.weightPathPrefix || prefix; + const weightSpecs = []; + for (const entry of weightsManifest) { + weightSpecs.push(...entry.weights); + } + const fetchURLs = []; + const urlPromises = []; + for (const weightsGroup of weightsManifest) { + for (const path of weightsGroup.paths) { + if (this.weightUrlConverter != null) { + urlPromises.push(this.weightUrlConverter(path)); + } else { + fetchURLs.push(pathPrefix + path + suffix); + } + } + } + if (this.weightUrlConverter) { + fetchURLs.push(...await Promise.all(urlPromises)); + } + const buffers = await loadWeightsAsArrayBuffer2(fetchURLs, { + requestInit: this.requestInit, + fetchFunc: this.fetch, + onProgress: this.onProgress + }); + return [weightSpecs, concatenateArrayBuffers2(buffers)]; + } +}; +HTTPRequest2.URL_SCHEME_REGEX = /^https?:\/\//; +function parseUrl2(url) { + const lastSlash = url.lastIndexOf("/"); + const lastSearchParam = url.lastIndexOf("?"); + const prefix = url.substring(0, lastSlash); + const suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : ""; + return [prefix + "/", suffix]; +} +function isHTTPScheme2(url) { + return url.match(HTTPRequest2.URL_SCHEME_REGEX) != null; +} +var httpRouter2 = (url, loadOptions) => { + if (typeof fetch === "undefined" && (loadOptions == null || loadOptions.fetchFunc == null)) { + return null; + } else { + let isHTTP = true; + if (Array.isArray(url)) { + isHTTP = url.every((urlItem) => isHTTPScheme2(urlItem)); + } else { + isHTTP = isHTTPScheme2(url); + } + if (isHTTP) { + return http2(url, loadOptions); + } + } + return null; +}; +IORouterRegistry2.registerSaveRouter(httpRouter2); +IORouterRegistry2.registerLoadRouter(httpRouter2); +function http2(path, loadOptions) { + return new HTTPRequest2(path, loadOptions); +} +function browserHTTPRequest2(path, loadOptions) { + return http2(path, loadOptions); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js +var PassthroughLoader2 = class { + constructor(modelArtifacts) { + this.modelArtifacts = modelArtifacts; + } + async load() { + return this.modelArtifacts; + } +}; +var PassthroughSaver2 = class { + constructor(saveHandler) { + this.saveHandler = saveHandler; + } + async save(modelArtifacts) { + return this.saveHandler(modelArtifacts); + } +}; +function fromMemory2(modelArtifacts, weightSpecs, weightData, trainingConfig) { + if (arguments.length === 1) { + const isModelArtifacts = modelArtifacts.modelTopology != null || modelArtifacts.weightSpecs != null; + if (isModelArtifacts) { + return new PassthroughLoader2(modelArtifacts); + } else { + console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."); + return new PassthroughLoader2({ modelTopology: modelArtifacts }); + } + } else { + console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."); + return new PassthroughLoader2({ + modelTopology: modelArtifacts, + weightSpecs, + weightData, + trainingConfig + }); + } +} +function withSaveHandler2(saveHandler) { + return new PassthroughSaver2(saveHandler); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.js +function matMul_2(a, b, transposeA = false, transposeB = false) { + let $a = convertToTensor2(a, "a", "matMul"); + let $b = convertToTensor2(b, "b", "matMul"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + const attrs = { transposeA, transposeB }; + return ENGINE2.runKernel(BatchMatMul2, inputs, attrs); +} +var matMul3 = op2({ matMul_: matMul_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.js +function oneHot_2(indices, depth, onValue = 1, offValue = 0) { + if (depth < 2) { + throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); + } + const $indices = convertToTensor2(indices, "indices", "oneHot", "int32"); + const inputs = { indices: $indices }; + const attrs = { depth, onValue, offValue }; + return ENGINE2.runKernel(OneHot2, inputs, attrs); +} +var oneHot5 = op2({ oneHot_: oneHot_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js +function transpose_2(x, perm) { + const $x = convertToTensor2(x, "x", "transpose"); + if (perm == null) { + perm = $x.shape.map((s, i) => i).reverse(); + } + assert3($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} must match length of perm ${perm}.`); + perm.forEach((axis) => { + assert3(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1} but got ${perm}`); + }); + if ($x.rank <= 1) { + return $x.clone(); + } + const inputs = { x: $x }; + const attrs = { perm }; + return ENGINE2.runKernel(Transpose2, inputs, attrs); +} +var transpose5 = op2({ transpose_: transpose_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.js +function prepareAndValidate2(tensor3, indices) { + const tensorRank = tensor3.shape.length; + const indicesRank = indices.shape.length; + if (tensorRank < 1) { + throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${tensorRank}.`); + } + if (indicesRank < 1) { + throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${indicesRank}.`); + } + if (indices.dtype !== "int32") { + throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${indices.dtype}.`); + } + if (indices.shape[indicesRank - 1] > tensorRank) { + throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${indices.shape[indicesRank - 1]} vs. ${tensorRank}`); + } + if (sizeFromShape2(tensor3.shape) === 0) { + throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${tensor3.shape}.`); + } + const indicesShape = indices.shape; + const sliceRank = indicesShape[indicesShape.length - 1]; + let nResult = 1; + for (let i = 0; i < indicesShape.length - 1; ++i) { + nResult *= indicesShape[i]; + } + const inputShape = tensor3.shape; + const resultShape = indicesShape.slice(); + resultShape.pop(); + let sliceSize = 1; + for (let i = sliceRank; i < tensorRank; ++i) { + sliceSize *= inputShape[i]; + resultShape.push(inputShape[i]); + } + const strides = [ + ...computeStrides2(tensor3.shape).map((stride) => stride / sliceSize), + 1 + ].slice(0, sliceRank); + return [resultShape, nResult, sliceSize, strides]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.js +function validateUpdateShape2(shape, indices, updates) { + const sliceDim = indices.rank > 1 ? indices.shape[indices.rank - 1] : 1; + const batchDim = indices.rank > 1 ? indices.rank - 1 : 1; + const shapeError = `Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${updates.shape}, indices.shape: ${indices.shape}, shape: ${shape}, sliceDim: ${sliceDim}, and batchDim: ${batchDim}.`; + if (updates.rank < batchDim) { + throw new Error(shapeError + ` update.rank < ${batchDim}. `); + } + if (shape.length < sliceDim + (updates.rank - batchDim)) { + throw new Error(shapeError + ` Output shape length < ${sliceDim + (updates.rank - batchDim)}`); + } + if (updates.rank !== batchDim + shape.length - sliceDim) { + throw new Error(shapeError + ` update.rank != ${batchDim + shape.length - sliceDim}`); + } + for (let d = 0; d < batchDim; ++d) { + if (updates.shape[d] !== indices.shape[d]) { + throw new Error(shapeError + ` updates.shape[${d}] (${updates.shape[d]}) != indices.shape[${d}] (${indices.shape[d]}).`); + } + } + for (let d = 0; d < updates.rank - batchDim; ++d) { + if (updates.shape[d + batchDim] !== shape[d + sliceDim]) { + throw new Error(shapeError + ` updates.shape[${d + batchDim}] (${updates.shape[d + batchDim]}) != shape[${d + batchDim}] (${shape[d + batchDim]})`); + } + } +} +function validateInput3(updates, indices, shape) { + if (indices.rank < 1) { + throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${indices.rank}.`); + } + if (updates.rank < 1) { + throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${updates.rank}.`); + } + if (indices.dtype !== "int32") { + throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${indices.dtype}`); + } + if (shape.length < 1) { + throw new Error(`Output rank must be greater or equal to 1, but got shape: ${shape}`); + } + if (shape.length === 0) { + if (indices.size === 0) { + throw new Error(`Indices specified for empty output. indices shape: ${indices.shape}`); + } + if (updates.size === 0) { + throw new Error(`Updates specified for empty output. updates shape: ${updates.shape}`); + } + } + validateUpdateShape2(shape, indices, updates); +} +function calculateShapes2(updates, indices, shape) { + const indicesRank = indices.shape.length; + const sliceRank = indicesRank > 1 ? indices.shape[indicesRank - 1] : 1; + const totalNd = shape.length; + let sliceSize = 1; + for (let i = sliceRank; i < totalNd; ++i) { + sliceSize *= shape[i]; + } + const safeSliceDim = sliceRank < 1 ? 1 : sliceRank; + const numUpdates = sizeFromShape2(indices.shape) / safeSliceDim; + const strides = [...computeStrides2(shape.slice(0, sliceRank)), 1]; + const outputSize2 = sizeFromShape2(shape); + return { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js +var slice_util_exports2 = {}; +__export(slice_util_exports2, { + assertParamsValid: () => assertParamsValid2, + computeFlatOffset: () => computeFlatOffset2, + computeOutShape: () => computeOutShape5, + getNormalizedAxes: () => getNormalizedAxes2, + isSliceContinous: () => isSliceContinous2, + maskToAxes: () => maskToAxes2, + parseSliceParams: () => parseSliceParams2, + sliceInfo: () => sliceInfo2, + startForAxis: () => startForAxis2, + startIndicesWithElidedDims: () => startIndicesWithElidedDims2, + stopForAxis: () => stopForAxis2, + stopIndicesWithElidedDims: () => stopIndicesWithElidedDims2, + stridesForAxis: () => stridesForAxis2, + stridesWithElidedDims: () => stridesWithElidedDims2 +}); +function assertParamsValid2(input3, begin, size2) { + const inputRank = input3.shape.length; + assert3(inputRank === begin.length, () => `Error in slice${inputRank}D: Length of begin ${begin} must match the rank of the array (${inputRank}).`); + assert3(inputRank === size2.length, () => `Error in slice${inputRank}D: Length of size ${size2} must match the rank of the array (${inputRank}).`); + for (let i = 0; i < inputRank; ++i) { + assert3(begin[i] + size2[i] <= input3.shape[i], () => `Error in slice${inputRank}D: begin[${i}] + size[${i}] (${begin[i] + size2[i]}) would overflow input.shape[${i}] (${input3.shape[i]})`); + } +} +function maskToAxes2(mask) { + const axes = []; + let axis = 0; + while (mask > 0) { + if (mask & 1) { + axes.push(axis); + } + mask /= 2; + axis++; + } + return axes; +} +function computeOutShape5(begin, end, strides) { + const size2 = []; + for (let axis = 0; axis < begin.length; axis++) { + size2[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]); + } + return size2; +} +function stridesWithElidedDims2(strides, ellipsisInsertionIndex, numElidedAxes, inputShape) { + const newStrides = [...strides]; + for (let i = newStrides.length; i < inputShape.length; i++) { + newStrides.push(1); + } + for (let i = 0; i < numElidedAxes; i++) { + if (i === 0) { + newStrides[ellipsisInsertionIndex] = 1; + } else { + newStrides.splice(ellipsisInsertionIndex, 0, 1); + newStrides.pop(); + } + } + return newStrides; +} +function unnormalizeAxis2(ellipsisInsertionIndex, numElidedAxes, normalizedAxis) { + if (normalizedAxis <= ellipsisInsertionIndex) { + return normalizedAxis; + } + return normalizedAxis - (numElidedAxes - 1); +} +function getElidedAxes2(numElidedAxes, ellipsisInsertionIndex) { + const elidedAxes = []; + for (let i = 0; i < numElidedAxes; i++) { + elidedAxes.push(ellipsisInsertionIndex + i); + } + return elidedAxes; +} +function getNormalizedAxes2(inputShape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask) { + const inputRank = inputShape.length; + let normalizedBegin = new Array(inputRank), normalizedEnd = new Array(inputRank), normalizedStrides = new Array(inputRank); + if (ellipsisAxes.length && numInterpolatedAxes > 0) { + const fullIndex = ellipsisAxes[0]; + const numElidedAxes = numInterpolatedAxes + 1; + normalizedBegin = startIndicesWithElidedDims2(beginMask, fullIndex, numElidedAxes, begin, inputShape); + normalizedEnd = stopIndicesWithElidedDims2(endMask, fullIndex, numElidedAxes, end, inputShape); + normalizedStrides = stridesWithElidedDims2(strides, fullIndex, numElidedAxes, inputShape); + } else { + for (let axis = 0; axis < inputRank; axis++) { + normalizedBegin[axis] = startForAxis2(beginMask, begin, strides, inputShape, axis, ellipsisMask); + normalizedEnd[axis] = stopForAxis2(endMask, end, strides, inputShape, axis, ellipsisMask); + normalizedStrides[axis] = stridesForAxis2(strides, axis, ellipsisMask); + } + } + return { + begin: normalizedBegin, + end: normalizedEnd, + strides: normalizedStrides + }; +} +function startIndicesWithElidedDims2(beginMask, ellipsisInsertionIndex, numElidedAxes, originalBegin, inputShape) { + const newIndices = [...inputShape]; + const elidedAxes = getElidedAxes2(numElidedAxes, ellipsisInsertionIndex); + for (let axis = 0; axis < newIndices.length; axis++) { + if (elidedAxes.indexOf(axis) > -1) { + newIndices[axis] = 0; + } else { + const originalAxis = unnormalizeAxis2(ellipsisInsertionIndex, numElidedAxes, axis); + let originalValue = originalBegin[originalAxis]; + if (beginMask & 1 << originalAxis) { + originalValue = 0; + } + newIndices[axis] = originalValue; + } + } + return newIndices; +} +function stopIndicesWithElidedDims2(endMask, ellipsisInsertionIndex, numElidedAxes, originalEnd, inputShape) { + const newIndices = [...inputShape]; + const elidedAxes = getElidedAxes2(numElidedAxes, ellipsisInsertionIndex); + for (let axis = 0; axis < newIndices.length; axis++) { + if (elidedAxes.indexOf(axis) > -1) { + newIndices[axis] = Number.MAX_SAFE_INTEGER; + } else { + const originalAxis = unnormalizeAxis2(ellipsisInsertionIndex, numElidedAxes, axis); + let originalValue = originalEnd[originalAxis]; + if (endMask & 1 << originalAxis) { + originalValue = Number.MAX_SAFE_INTEGER; + } + newIndices[axis] = originalValue; + } + } + for (let i = 0; i < newIndices.length; i++) { + const axisSize = inputShape[i]; + if (newIndices[i] < 0) { + newIndices[i] += axisSize; + } + newIndices[i] = clamp3(0, newIndices[i], inputShape[i]); + } + return newIndices; +} +function stridesForAxis2(strides, axis, ellipsisMask) { + let stride = strides[axis]; + if (ellipsisMask & 1 << axis || stride == null) { + stride = 1; + } + return stride; +} +function startForAxis2(beginMask, startIndices, strides, inputShape, axis, ellipsisMask) { + let start = startIndices[axis]; + const stride = strides[axis] || 1; + if (beginMask & 1 << axis || ellipsisMask & 1 << axis || start == null) { + if (stride > 0) { + start = Number.MIN_SAFE_INTEGER; + } else { + start = Number.MAX_SAFE_INTEGER; + } + } + const axisSize = inputShape[axis]; + if (start < 0) { + start += axisSize; + } + start = clamp3(0, start, axisSize - 1); + return start; +} +function stopForAxis2(endMask, stopIndices, strides, inputShape, axis, ellipsisMask) { + let stop = stopIndices[axis]; + const stride = strides[axis] || 1; + if (endMask & 1 << axis || ellipsisMask & 1 << axis || stop == null) { + if (stride > 0) { + stop = Number.MAX_SAFE_INTEGER; + } else { + stop = Number.MIN_SAFE_INTEGER; + } + } + const axisSize = inputShape[axis]; + if (stop < 0) { + stop += axisSize; + } + if (stride > 0) { + stop = clamp3(0, stop, axisSize); + } else { + stop = clamp3(-1, stop, axisSize - 1); + } + return stop; +} +function isSliceContinous2(shape, begin, size2) { + let firstNonOneAxis = size2.length; + for (let i = 0; i < size2.length; i++) { + if (size2[i] > 1) { + firstNonOneAxis = i; + break; + } + } + for (let i = firstNonOneAxis + 1; i < size2.length; i++) { + if (begin[i] > 0 || size2[i] !== shape[i]) { + return false; + } + } + return true; +} +function computeFlatOffset2(begin, strides) { + let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1; + for (let i = 0; i < begin.length - 1; i++) { + flatOffset += begin[i] * strides[i]; + } + return flatOffset; +} +function parseSliceParams2(x, begin, size2) { + let begin_; + const xRank = x.shape.length; + if (typeof begin === "number") { + begin_ = [begin, ...new Array(xRank - 1).fill(0)]; + } else if (begin.length < xRank) { + begin_ = begin.concat(new Array(xRank - begin.length).fill(0)); + } else { + begin_ = begin.slice(); + } + begin_.forEach((d) => { + assert3(d !== -1, () => "slice() does not support negative begin indexing."); + }); + let size_; + if (size2 == null) { + size_ = new Array(xRank).fill(-1); + } else if (typeof size2 === "number") { + size_ = [size2, ...new Array(xRank - 1).fill(-1)]; + } else if (size2.length < xRank) { + size_ = size2.concat(new Array(xRank - size2.length).fill(-1)); + } else { + size_ = size2; + } + size_ = size_.map((d, i) => { + if (d >= 0) { + return d; + } else { + assert3(d === -1, () => `Negative size values should be exactly -1 but got ${d} for the slice() size at index ${i}.`); + return x.shape[i] - begin_[i]; + } + }); + return [begin_, size_]; +} +function sliceInfo2(xShape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { + let $begin = begin.slice(); + let $end = end.slice(); + let $strides = strides; + if (strides == null) { + $strides = new Array($begin.length); + } + const ellipsisAxes = maskToAxes2(ellipsisMask); + if (ellipsisAxes.length > 1) { + throw new Error("Multiple ellipses in slice is not allowed."); + } + if (ellipsisMask !== 0 && newAxisMask !== 0) { + throw new Error("Using both ellipsisMask and newAxisMask is not yet supported."); + } + if (ellipsisMask !== 0 && shrinkAxisMask !== 0) { + throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported."); + } + const numInterpolatedAxes = xShape.length - $begin.length; + const expandAxes = maskToAxes2(newAxisMask); + const newShape = xShape.slice(); + expandAxes.forEach((axis) => { + $begin[axis] = 0; + $end[axis] = 1; + newShape.splice(axis, 0, 1); + }); + const { begin: normalizedBegin, end: normalizedEnd, strides: normalizedStrides } = getNormalizedAxes2(newShape, ellipsisAxes, numInterpolatedAxes, $begin, $end, $strides, beginMask, endMask, ellipsisMask); + $begin = normalizedBegin; + $end = normalizedEnd; + $strides = normalizedStrides; + const shrinkAxes = maskToAxes2(shrinkAxisMask); + shrinkAxes.forEach((axis) => { + $end[axis] = $begin[axis] + 1; + $strides[axis] = 1; + }); + const size2 = computeOutShape5($begin, $end, $strides); + const outShape = size2.filter((_, axis) => shrinkAxes.indexOf(axis) === -1); + const nonStrided = $strides.every((v) => v === 1); + return { nonStrided, $begin, $end, $strides, size: size2, newShape, outShape }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/serialization.js +var serialization_exports2 = {}; +__export(serialization_exports2, { + Serializable: () => Serializable2, + SerializationMap: () => SerializationMap2, + registerClass: () => registerClass2 +}); +var Serializable2 = class { + getClassName() { + return this.constructor.className; + } + static fromConfig(cls, config3) { + return new cls(config3); + } +}; +var SerializationMap2 = class { + constructor() { + this.classNameMap = {}; + } + static getMap() { + if (SerializationMap2.instance == null) { + SerializationMap2.instance = new SerializationMap2(); + } + return SerializationMap2.instance; + } + static register(cls) { + SerializationMap2.getMap().classNameMap[cls.className] = [cls, cls.fromConfig]; + } +}; +function registerClass2(cls) { + assert3(cls.className != null, () => `Class being registered does not have the static className property defined.`); + assert3(typeof cls.className === "string", () => `className is required to be a string, but got type ` + typeof cls.className); + assert3(cls.className.length > 0, () => `Class being registered has an empty-string as its className, which is disallowed.`); + SerializationMap2.register(cls); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/globals.js +function deprecationWarn2(msg) { + if (env3().getBool("DEPRECATION_WARNINGS_ENABLED")) { + console.warn(msg + " You can disable deprecation warnings with tf.disableDeprecationWarnings()."); + } +} +setDeprecationWarningFn2(deprecationWarn2); +function engine2() { + return ENGINE2; +} +function memory2() { + return ENGINE2.memory(); +} +function tidy2(nameOrFn, fn) { + return ENGINE2.tidy(nameOrFn, fn); +} +function dispose2(container) { + const tensors = getTensorsInContainer2(container); + tensors.forEach((tensor3) => tensor3.dispose()); +} +function keep2(result) { + return ENGINE2.keep(result); +} +function registerBackend2(name, factory, priority = 1) { + return ENGINE2.registerBackend(name, factory, priority); +} +function backend2() { + return ENGINE2.backend; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/add.js +function add_2(a, b) { + let $a = convertToTensor2(a, "a", "add"); + let $b = convertToTensor2(b, "b", "add"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Add3, inputs); +} +var add6 = op2({ add_: add_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/floorDiv.js +function floorDiv_2(a, b) { + let $a = convertToTensor2(a, "a", "floorDiv"); + let $b = convertToTensor2(b, "b", "floorDiv"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(FloorDiv2, inputs); +} +var floorDiv4 = op2({ floorDiv_: floorDiv_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/div.js +function div_2(a, b) { + let $a = convertToTensor2(a, "a", "div"); + let $b = convertToTensor2(b, "b", "div"); + [$a, $b] = makeTypesMatch2($a, $b); + if ($a.dtype === "int32" && $b.dtype === "int32") { + return floorDiv4($a, $b); + } + const inputs = { a: $a, b: $b }; + const attrs = {}; + return ENGINE2.runKernel(RealDiv2, inputs, attrs); +} +var div3 = op2({ div_: div_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/mul.js +function mul_2(a, b) { + let $a = convertToTensor2(a, "a", "mul"); + let $b = convertToTensor2(b, "b", "mul"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Multiply3, inputs); +} +var mul2 = op2({ mul_: mul_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/abs.js +function abs_2(x) { + const $x = convertToTensor2(x, "x", "abs"); + if ($x.dtype === "complex64") { + const inputs = { x: $x }; + return ENGINE2.runKernel(ComplexAbs2, inputs); + } else { + const inputs = { x: $x }; + return ENGINE2.runKernel(Abs2, inputs); + } +} +var abs4 = op2({ abs_: abs_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/acos.js +function acos_2(x) { + const $x = convertToTensor2(x, "x", "acos"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Acos2, inputs); +} +var acos4 = op2({ acos_: acos_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.js +function acosh_2(x) { + const $x = convertToTensor2(x, "x", "acosh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Acosh2, inputs); +} +var acosh4 = op2({ acosh_: acosh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.js +function addN_2(tensors) { + assert3(Array.isArray(tensors), () => "The argument passed to tf.addN() must be a list of tensors"); + assert3(tensors.length >= 1, () => `Must pass at least one tensor to tf.addN(), but got ${tensors.length}`); + const $tensors = tensors.map((t, i) => convertToTensor2(t, `tensors${i}`, "addN")); + const firstTensor = $tensors[0]; + $tensors.forEach((t) => { + if (t.dtype !== firstTensor.dtype) { + throw new Error("All tensors passed to tf.addN() must have the same dtype"); + } + }); + $tensors.forEach((t) => { + if (!arraysEqual2(t.shape, firstTensor.shape)) { + throw new Error("All tensors passed to tf.addN() must have the same shape"); + } + }); + const inputs = $tensors; + return ENGINE2.runKernel(AddN2, inputs); +} +var addN4 = op2({ addN_: addN_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/all.js +function all_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "all", "bool"); + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(All2, inputs, attrs); +} +var all5 = op2({ all_: all_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/any.js +function any_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "any", "bool"); + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(Any2, inputs, attrs); +} +var any5 = op2({ any_: any_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.js +function argMax_2(x, axis = 0) { + const $x = convertToTensor2(x, "x", "argMax"); + const inputs = { x: $x }; + const attrs = { axis }; + return ENGINE2.runKernel(ArgMax2, inputs, attrs); +} +var argMax4 = op2({ argMax_: argMax_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.js +function argMin_2(x, axis = 0) { + const $x = convertToTensor2(x, "x", "argMin"); + const inputs = { x: $x }; + const attrs = { axis }; + return ENGINE2.runKernel(ArgMin2, inputs, attrs); +} +var argMin4 = op2({ argMin_: argMin_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/asin.js +function asin_2(x) { + const $x = convertToTensor2(x, "x", "asin"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Asin2, inputs); +} +var asin4 = op2({ asin_: asin_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.js +function asinh_2(x) { + const $x = convertToTensor2(x, "x", "asinh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Asinh2, inputs); +} +var asinh4 = op2({ asinh_: asinh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/atan.js +function atan_2(x) { + const $x = convertToTensor2(x, "x", "atan"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Atan3, inputs); +} +var atan5 = op2({ atan_: atan_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.js +function atan2_2(a, b) { + let $a = convertToTensor2(a, "a", "atan2"); + let $b = convertToTensor2(b, "b", "atan2"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Atan22, inputs); +} +var atan24 = op2({ atan2_: atan2_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.js +function atanh_2(x) { + const $x = convertToTensor2(x, "x", "atanh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Atanh2, inputs); +} +var atanh4 = op2({ atanh_: atanh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js +function computeDilation2DInfo2(inputShape, filterShape, strides, pad4, dataFormat = "NHWC", dilations) { + const inputChannels = inputShape[3]; + const $filterShape = [...filterShape, inputChannels]; + const $dataFormat = convertConv2DDataFormat2(dataFormat); + return computeConv2DInfo2(inputShape, $filterShape, strides, dilations, pad4, null, null, $dataFormat); +} +function computePool2DInfo2(inShape, filterSize, strides, dilations, pad4, roundingMode, dataFormat = "channelsLast") { + const [filterHeight, filterWidth] = parseTupleParam2(filterSize); + let filterShape; + if (dataFormat === "channelsLast") { + filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; + } else if (dataFormat === "channelsFirst") { + filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; + } else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + return computeConv2DInfo2(inShape, filterShape, strides, dilations, pad4, roundingMode, false, dataFormat); +} +function computePool3DInfo2(inShape, filterSize, strides, dilations, pad4, roundingMode, dataFormat = "NDHWC") { + const [filterDepth, filterHeight, filterWidth] = parse3TupleParam2(filterSize); + let filterShape; + let $dataFormat; + if (dataFormat === "NDHWC") { + $dataFormat = "channelsLast"; + filterShape = [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]]; + } else if (dataFormat === "NCDHW") { + $dataFormat = "channelsFirst"; + filterShape = [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]]; + } else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + return computeConv3DInfo2(inShape, filterShape, strides, dilations, pad4, false, $dataFormat, roundingMode); +} +function computeConv2DInfo2(inShape, filterShape, strides, dilations, pad4, roundingMode, depthwise = false, dataFormat = "channelsLast") { + let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; + if (dataFormat === "channelsLast") { + [batchSize, inHeight, inWidth, inChannels] = inShape; + } else if (dataFormat === "channelsFirst") { + [batchSize, inChannels, inHeight, inWidth] = inShape; + } else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + const [filterHeight, filterWidth, , filterChannels] = filterShape; + const [strideHeight, strideWidth] = parseTupleParam2(strides); + const [dilationHeight, dilationWidth] = parseTupleParam2(dilations); + const effectiveFilterHeight = getEffectiveFilterSize2(filterHeight, dilationHeight); + const effectiveFilterWidth = getEffectiveFilterSize2(filterWidth, dilationWidth); + const { padInfo, outHeight, outWidth } = getPadAndOutInfo2(pad4, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat); + const outChannels = depthwise ? filterChannels * inChannels : filterChannels; + let outShape; + if (dataFormat === "channelsFirst") { + outShape = [batchSize, outChannels, outHeight, outWidth]; + } else if (dataFormat === "channelsLast") { + outShape = [batchSize, outHeight, outWidth, outChannels]; + } + return { + batchSize, + dataFormat, + inHeight, + inWidth, + inChannels, + outHeight, + outWidth, + outChannels, + padInfo, + strideHeight, + strideWidth, + filterHeight, + filterWidth, + effectiveFilterHeight, + effectiveFilterWidth, + dilationHeight, + dilationWidth, + inShape, + outShape, + filterShape + }; +} +function computeConv3DInfo2(inShape, filterShape, strides, dilations, pad4, depthwise = false, dataFormat = "channelsLast", roundingMode) { + let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1]; + if (dataFormat === "channelsLast") { + [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape; + } else if (dataFormat === "channelsFirst") { + [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape; + } else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape; + const [strideDepth, strideHeight, strideWidth] = parse3TupleParam2(strides); + const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam2(dilations); + const effectiveFilterDepth = getEffectiveFilterSize2(filterDepth, dilationDepth); + const effectiveFilterHeight = getEffectiveFilterSize2(filterHeight, dilationHeight); + const effectiveFilterWidth = getEffectiveFilterSize2(filterWidth, dilationWidth); + const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo2(pad4, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode); + const outChannels = depthwise ? filterChannels * inChannels : filterChannels; + let outShape; + if (dataFormat === "channelsFirst") { + outShape = [batchSize, outChannels, outDepth, outHeight, outWidth]; + } else if (dataFormat === "channelsLast") { + outShape = [batchSize, outDepth, outHeight, outWidth, outChannels]; + } + return { + batchSize, + dataFormat, + inDepth, + inHeight, + inWidth, + inChannels, + outDepth, + outHeight, + outWidth, + outChannels, + padInfo, + strideDepth, + strideHeight, + strideWidth, + filterDepth, + filterHeight, + filterWidth, + effectiveFilterDepth, + effectiveFilterHeight, + effectiveFilterWidth, + dilationDepth, + dilationHeight, + dilationWidth, + inShape, + outShape, + filterShape + }; +} +function computeOutputShape2D2(inShape, fieldSize, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad2(inShape, fieldSize, stride); + } + const inputRows = inShape[0]; + const inputCols = inShape[1]; + const outputRows = round5((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + const outputCols = round5((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + return [outputRows, outputCols]; +} +function computeOutputShape4D2(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad2(inShape, fieldSize, stride); + } + const inputDepth = inShape[0]; + const inputRows = inShape[1]; + const inputCols = inShape[2]; + const outputDepths = round5((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + const outputRows = round5((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + const outputCols = round5((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + return [outputDepths, outputRows, outputCols, outChannels]; +} +function computeDefaultPad2(inputShape, fieldSize, stride, dilation = 1) { + const effectiveFieldSize = getEffectiveFilterSize2(fieldSize, dilation); + return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); +} +function parseTupleParam2(param) { + if (typeof param === "number") { + return [param, param, param]; + } + if (param.length === 2) { + return [param[0], param[1], 1]; + } + return param; +} +function parse3TupleParam2(param) { + return typeof param === "number" ? [param, param, param] : param; +} +function getEffectiveFilterSize2(filterSize, dilation) { + if (dilation <= 1) { + return filterSize; + } + return filterSize + (filterSize - 1) * (dilation - 1); +} +function getPadAndOutInfo2(pad4, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode, dataFormat) { + let padInfo; + let outHeight; + let outWidth; + if (typeof pad4 === "number") { + const padType = pad4 === 0 ? "VALID" : "NUMBER"; + padInfo = { top: pad4, bottom: pad4, left: pad4, right: pad4, type: padType }; + const outShape = computeOutputShape2D2([inHeight, inWidth], filterHeight, strideHeight, pad4, roundingMode); + outHeight = outShape[0]; + outWidth = outShape[1]; + } else if (pad4 === "same") { + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); + const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); + const top = Math.floor(padAlongHeight / 2); + const bottom = padAlongHeight - top; + const left = Math.floor(padAlongWidth / 2); + const right = padAlongWidth - left; + padInfo = { top, bottom, left, right, type: "SAME" }; + } else if (pad4 === "valid") { + padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }; + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } else if (typeof pad4 === "object") { + const top = dataFormat === "channelsLast" ? pad4[1][0] : pad4[2][0]; + const bottom = dataFormat === "channelsLast" ? pad4[1][1] : pad4[2][1]; + const left = dataFormat === "channelsLast" ? pad4[2][0] : pad4[3][0]; + const right = dataFormat === "channelsLast" ? pad4[2][1] : pad4[3][1]; + const padType = top === 0 && bottom === 0 && left === 0 && right === 0 ? "VALID" : "EXPLICIT"; + padInfo = { top, bottom, left, right, type: padType }; + outHeight = round5((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode); + outWidth = round5((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode); + } else { + throw Error(`Unknown padding parameter: ${pad4}`); + } + return { padInfo, outHeight, outWidth }; +} +function get3DPadAndOutInfo2(pad4, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) { + let padInfo; + let outDepth; + let outHeight; + let outWidth; + if (typeof pad4 === "number") { + const padType = pad4 === 0 ? "VALID" : "NUMBER"; + padInfo = { + top: pad4, + bottom: pad4, + left: pad4, + right: pad4, + front: pad4, + back: pad4, + type: padType + }; + const outShape = computeOutputShape4D2([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad4, roundingMode); + outDepth = outShape[0]; + outHeight = outShape[1]; + outWidth = outShape[2]; + } else if (pad4 === "same") { + outDepth = Math.ceil(inDepth / strideDepth); + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth; + const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight; + const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth; + const front = Math.floor(padAlongDepth / 2); + const back = padAlongDepth - front; + const top = Math.floor(padAlongHeight / 2); + const bottom = padAlongHeight - top; + const left = Math.floor(padAlongWidth / 2); + const right = padAlongWidth - left; + padInfo = { top, bottom, left, right, front, back, type: "SAME" }; + } else if (pad4 === "valid") { + padInfo = { + top: 0, + bottom: 0, + left: 0, + right: 0, + front: 0, + back: 0, + type: "VALID" + }; + outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth); + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } else { + throw Error(`Unknown padding parameter: ${pad4}`); + } + return { padInfo, outDepth, outHeight, outWidth }; +} +function round5(value, roundingMode) { + if (!roundingMode) { + return Math.trunc(value); + } + switch (roundingMode) { + case "round": + return Math.round(value); + case "ceil": + return Math.ceil(value); + case "floor": + return Math.floor(value); + default: + throw new Error(`Unknown roundingMode ${roundingMode}`); + } +} +function tupleValuesAreOne2(param) { + const [dimA, dimB, dimC] = parseTupleParam2(param); + return dimA === 1 && dimB === 1 && dimC === 1; +} +function eitherStridesOrDilationsAreOne2(strides, dilations) { + return tupleValuesAreOne2(strides) || tupleValuesAreOne2(dilations); +} +function convertConv2DDataFormat2(dataFormat) { + if (dataFormat === "NHWC") { + return "channelsLast"; + } else if (dataFormat === "NCHW") { + return "channelsFirst"; + } else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.js +function reshape_2(x, shape) { + const $x = convertToTensor2(x, "x", "reshape", "string_or_numeric"); + const inputs = { x: $x }; + const attrs = { shape }; + return ENGINE2.runKernel(Reshape3, inputs, attrs); +} +var reshape6 = op2({ reshape_: reshape_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.js +function avgPool_2(x, filterSize, strides, pad4, dimRoundingMode) { + const $x = convertToTensor2(x, "x", "avgPool", "float32"); + const dilations = 1; + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in avgPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x4D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode }; + let res = ENGINE2.runKernel(AvgPool2, inputs, attrs); + res = cast6(res, $x.dtype); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var avgPool5 = op2({ avgPool_: avgPool_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.js +function avgPool3d_2(x, filterSize, strides, pad4, dimRoundingMode, dataFormat = "NDHWC") { + const $x = convertToTensor2(x, "x", "avgPool3d", "float32"); + let x5D = $x; + let reshapedTo5D = false; + if ($x.rank === 4) { + reshapedTo5D = true; + x5D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]); + } + assert3(x5D.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${x5D.rank}.`); + assert3(dataFormat === "NDHWC", () => `Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${dataFormat}`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x5D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode, dataFormat }; + let res = ENGINE2.runKernel(AvgPool3D2, inputs, attrs); + res = cast6(res, x5D.dtype); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var avgPool3d3 = op2({ avgPool3d_: avgPool3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js +function concat_2(tensors, axis = 0) { + assert3(tensors.length >= 1, () => "Pass at least one tensor to concat"); + const $tensors = convertToTensorArray2(tensors, "tensors", "concat", "string_or_numeric"); + if ($tensors[0].dtype === "complex64") { + $tensors.forEach((tensor3) => { + if (tensor3.dtype !== "complex64") { + throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${tensor3.dtype}. `); + } + }); + } + if ($tensors.length === 1) { + return clone2($tensors[0]); + } + const inputs = $tensors; + const attr = { axis }; + return ENGINE2.runKernel(Concat2, inputs, attr); +} +var concat5 = op2({ concat_: concat_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js +function sigmoid_2(x) { + const $x = convertToTensor2(x, "x", "sigmoid"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Sigmoid3, inputs); +} +var sigmoid5 = op2({ sigmoid_: sigmoid_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js +function slice_2(x, begin, size2) { + const $x = convertToTensor2(x, "x", "slice", "string_or_numeric"); + if ($x.rank === 0) { + throw new Error("Slicing scalar is not possible"); + } + const inputs = { x: $x }; + const attrs = { begin, size: size2 }; + return ENGINE2.runKernel(Slice2, inputs, attrs); +} +var slice5 = op2({ slice_: slice_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.js +function tanh_2(x) { + const $x = convertToTensor2(x, "x", "tanh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Tanh3, inputs); +} +var tanh6 = op2({ tanh_: tanh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.js +function batchToSpaceND_2(x, blockShape, crops) { + const $x = convertToTensor2(x, "x", "batchToSpaceND"); + const prod8 = blockShape.reduce((a, b) => a * b); + assert3($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); + assert3(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); + assert3($x.shape[0] % prod8 === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of the elements of blockShape ${blockShape.join(" * ")} === ${prod8}`); + const inputs = { x: $x }; + const attrs = { blockShape, crops }; + return ENGINE2.runKernel(BatchToSpaceND2, inputs, attrs); +} +var batchToSpaceND5 = op2({ batchToSpaceND_: batchToSpaceND_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_util.js +function xAs4D2(x) { + let x4D; + if (x.rank === 0 || x.rank === 1) { + x4D = reshape6(x, [1, 1, 1, x.size]); + } else if (x.rank === 2) { + x4D = reshape6(x, [1, 1, x.shape[0], x.shape[1]]); + } else if (x.rank === 3) { + x4D = reshape6(x, [1, x.shape[0], x.shape[1], x.shape[2]]); + } else { + x4D = x; + } + return x4D; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js +function batchNorm_2(x, mean6, variance, offset, scale4, varianceEpsilon) { + if (varianceEpsilon == null) { + varianceEpsilon = 1e-3; + } + const $x = convertToTensor2(x, "x", "batchNorm"); + const $mean = convertToTensor2(mean6, "mean", "batchNorm"); + const $variance = convertToTensor2(variance, "variance", "batchNorm"); + let $scale; + if (scale4 != null) { + $scale = convertToTensor2(scale4, "scale", "batchNorm"); + } + let $offset; + if (offset != null) { + $offset = convertToTensor2(offset, "offset", "batchNorm"); + } + assert3($mean.rank === $variance.rank, () => "Batch normalization gradient requires mean and variance to have equal ranks."); + assert3($offset == null || $mean.rank === $offset.rank, () => "Batch normalization gradient requires mean and offset to have equal ranks."); + assert3($scale == null || $mean.rank === $scale.rank, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + const x4D = xAs4D2($x); + const inputs = { + x: x4D, + scale: $scale, + offset: $offset, + mean: $mean, + variance: $variance + }; + const attrs = { varianceEpsilon }; + const res = ENGINE2.runKernel(FusedBatchNorm2, inputs, attrs); + return reshape6(res, $x.shape); +} +var batchNorm4 = op2({ batchNorm_: batchNorm_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.js +function batchNorm2d_2(x, mean6, variance, offset, scale4, varianceEpsilon) { + const $x = convertToTensor2(x, "x", "batchNorm"); + const $mean = convertToTensor2(mean6, "mean", "batchNorm"); + const $variance = convertToTensor2(variance, "variance", "batchNorm"); + let $scale; + if (scale4 != null) { + $scale = convertToTensor2(scale4, "scale", "batchNorm"); + } + let $offset; + if (offset != null) { + $offset = convertToTensor2(offset, "offset", "batchNorm"); + } + assert3($x.rank === 2, () => `Error in batchNorm2D: x must be rank 2 but got rank ${$x.rank}.`); + assert3($mean.rank === 2 || $mean.rank === 1, () => `Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${$mean.rank}.`); + assert3($variance.rank === 2 || $variance.rank === 1, () => `Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${$variance.rank}.`); + if ($scale != null) { + assert3($scale.rank === 2 || $scale.rank === 1, () => `Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${$scale.rank}.`); + } + if ($offset != null) { + assert3($offset.rank === 2 || $offset.rank === 1, () => `Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${$offset.rank}.`); + } + return batchNorm4($x, $mean, $variance, $offset, $scale, varianceEpsilon); +} +var batchNorm2d2 = op2({ batchNorm2d_: batchNorm2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.js +function batchNorm3d_2(x, mean6, variance, offset, scale4, varianceEpsilon) { + const $x = convertToTensor2(x, "x", "batchNorm"); + const $mean = convertToTensor2(mean6, "mean", "batchNorm"); + const $variance = convertToTensor2(variance, "variance", "batchNorm"); + let $scale; + if (scale4 != null) { + $scale = convertToTensor2(scale4, "scale", "batchNorm"); + } + let $offset; + if (offset != null) { + $offset = convertToTensor2(offset, "offset", "batchNorm"); + } + assert3($x.rank === 3, () => `Error in batchNorm3D: x must be rank 3 but got rank ${$x.rank}.`); + assert3($mean.rank === 3 || $mean.rank === 1, () => `Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${$mean.rank}.`); + assert3($variance.rank === 3 || $variance.rank === 1, () => `Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${$variance.rank}.`); + if ($scale != null) { + assert3($scale.rank === 3 || $scale.rank === 1, () => `Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${$scale.rank}.`); + } + if ($offset != null) { + assert3($offset.rank === 3 || $offset.rank === 1, () => `Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${$offset.rank}.`); + } + return batchNorm4($x, $mean, $variance, $offset, $scale, varianceEpsilon); +} +var batchNorm3d2 = op2({ batchNorm3d_: batchNorm3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.js +function batchNorm4d_2(x, mean6, variance, offset, scale4, varianceEpsilon) { + const $x = convertToTensor2(x, "x", "batchNorm"); + const $mean = convertToTensor2(mean6, "mean", "batchNorm"); + const $variance = convertToTensor2(variance, "variance", "batchNorm"); + let $scale; + if (scale4 != null) { + $scale = convertToTensor2(scale4, "scale", "batchNorm"); + } + let $offset; + if (offset != null) { + $offset = convertToTensor2(offset, "offset", "batchNorm"); + } + assert3($x.rank === 4, () => `Error in batchNorm4D: x must be rank 4 but got rank ${$x.rank}.`); + assert3($mean.rank === 4 || $mean.rank === 1, () => `Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${$mean.rank}.`); + assert3($variance.rank === 4 || $variance.rank === 1, () => `Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${$variance.rank}.`); + if ($scale != null) { + assert3($scale.rank === 4 || $scale.rank === 1, () => `Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${$scale.rank}.`); + } + if ($offset != null) { + assert3($offset.rank === 4 || $offset.rank === 1, () => `Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${$offset.rank}.`); + } + return batchNorm4($x, $mean, $variance, $offset, $scale, varianceEpsilon); +} +var batchNorm4d2 = op2({ batchNorm4d_: batchNorm4d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.js +function bincount_2(x, weights, size2) { + const $x = convertToTensor2(x, "x", "bincount"); + const $weights = convertToTensor2(weights, "weights", "bincount"); + assert3($x.dtype === "int32", () => `Error in bincount: input dtype must be int32, but got ${$x.dtype}`); + assert3(size2 >= 0, () => `size must be non-negative, but got ${size2}.`); + assert3($weights.size === $x.size || $weights.size === 0, () => `Error in bincount: weights must have the same size as input or0-length, but got input shape: ${$x.shape}, weights shape: ${$weights.shape}.`); + const inputs = { x: $x, weights: $weights }; + const attrs = { size: size2 }; + return ENGINE2.runKernel(Bincount2, inputs, attrs); +} +var bincount4 = op2({ bincount_: bincount_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_args.js +function broadcastArgs_2(s0, s1) { + const shape1Input = convertToTensor2(s0, "s0", "broadcastArgs", "int32"); + const shape2Input = convertToTensor2(s1, "s1", "broadcastArgs", "int32"); + if (shape1Input.rank !== 1) { + throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${shape1Input.rank}`); + } + if (shape2Input.rank !== 1) { + throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${shape2Input.rank}`); + } + const inputs = { s0: shape1Input, s1: shape2Input }; + return ENGINE2.runKernel(BroadcastArgs2, inputs); +} +var broadcastArgs3 = op2({ broadcastArgs_: broadcastArgs_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js +function broadcastTo_2(x, shape) { + let input3 = convertToTensor2(x, "broadcastTo", "x"); + const xShape = input3.shape; + if (shape.some((d) => !(d > 0) || d % 1 !== 0)) { + throw new Error(`broadcastTo(): Invalid broadcast shape [${shape}].`); + } + if (shape.length < input3.rank) { + throw new Error(`broadcastTo(): shape.length=${shape.length} < input.rank=${input3.rank}.`); + } + if (shape.length > input3.rank) { + const newShape = input3.shape.slice(); + while (newShape.length < shape.length) { + newShape.unshift(1); + } + input3 = reshape6(input3, newShape); + } + const inputShape = input3.shape; + const reps = Array.from(shape); + for (let i = shape.length - 1; i >= 0; i--) { + if (inputShape[i] === shape[i]) { + reps[i] = 1; + } else if (input3.shape[i] !== 1) { + throw new Error(`broadcastTo(): [${xShape}] cannot be broadcast to [${shape}].`); + } + } + const axes = reps.map((n, i) => n > 1 ? i : -1).filter((i) => i >= 0); + if (axes.length === 0) { + return clone2(input3); + } + const inputs = { x: input3 }; + const attrs = { reps }; + return ENGINE2.runKernel(Tile2, inputs, attrs); +} +var broadcastTo2 = op2({ broadcastTo_: broadcastTo_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.js +function ceil_2(x) { + const $x = convertToTensor2(x, "x", "ceil"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Ceil2, inputs); +} +var ceil4 = op2({ ceil_: ceil_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.js +function clipByValue_2(x, clipValueMin, clipValueMax) { + const $x = convertToTensor2(x, "x", "clipByValue"); + assert3(clipValueMin <= clipValueMax, () => `Error in clip: min (${clipValueMin}) must be less than or equal to max (${clipValueMax}).`); + const inputs = { x: $x }; + const attrs = { clipValueMin, clipValueMax }; + return ENGINE2.runKernel(ClipByValue2, inputs, attrs); +} +var clipByValue3 = op2({ clipByValue_: clipByValue_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.js +function concat1d_2(tensors) { + return concat5(tensors, 0); +} +var concat1d2 = op2({ concat1d_: concat1d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.js +function concat2d_2(tensors, axis) { + return concat5(tensors, axis); +} +var concat2d2 = op2({ concat2d_: concat2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.js +function concat3d_2(tensors, axis) { + return concat5(tensors, axis); +} +var concat3d2 = op2({ concat3d_: concat3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.js +function concat4d_2(tensors, axis) { + return concat5(tensors, axis); +} +var concat4d2 = op2({ concat4d_: concat4d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.js +function conv2d_2(x, filter, strides, pad4, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { + const $x = convertToTensor2(x, "x", "conv2d"); + const $filter = convertToTensor2(filter, "filter", "conv2d"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert3($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${$filter.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inDepth = dataFormat === "NHWC" ? x4D.shape[3] : x4D.shape[1]; + assert3(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match input depth for filter ${$filter.shape[2]}.`); + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const inputs = { x: x4D, filter: $filter }; + const attrs = { strides, pad: pad4, dataFormat, dilations, dimRoundingMode }; + const res = ENGINE2.runKernel(Conv2D3, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var conv2d6 = op2({ conv2d_: conv2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.js +function conv1d_2(x, filter, stride, pad4, dataFormat = "NWC", dilation = 1, dimRoundingMode) { + const $x = convertToTensor2(x, "x", "conv1d"); + const $filter = convertToTensor2(filter, "filter", "conv1d"); + let x3D = $x; + let reshapedTo3D = false; + if ($x.rank === 2) { + reshapedTo3D = true; + x3D = reshape6($x, [1, $x.shape[0], $x.shape[1]]); + } + assert3(x3D.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`); + assert3($filter.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ${$filter.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in conv1d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + assert3(x3D.shape[2] === $filter.shape[1], () => `Error in conv1d: depth of input (${x3D.shape[2]}) must match input depth for filter ${$filter.shape[1]}.`); + assert3(eitherStridesOrDilationsAreOne2(stride, dilation), () => `Error in conv1D: Either stride or dilation must be 1. Got stride ${stride} and dilation '${dilation}'`); + assert3(dataFormat === "NWC", () => `Error in conv1d: got dataFormat of ${dataFormat} but only NWC is currently supported.`); + const filter4D = reshape6($filter, [1, $filter.shape[0], $filter.shape[1], $filter.shape[2]]); + const input4D = reshape6(x3D, [x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]]); + const strides = [1, stride]; + const dilations = [1, dilation]; + const conv2dDataFormat = "NHWC"; + const res = conv2d6(input4D, filter4D, strides, pad4, conv2dDataFormat, dilations, dimRoundingMode); + if (reshapedTo3D) { + return reshape6(res, [res.shape[2], res.shape[3]]); + } + return reshape6(res, [res.shape[0], res.shape[2], res.shape[3]]); +} +var conv1d3 = op2({ conv1d_: conv1d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_input.js +function conv2DBackpropInput_2(xShape, dy, filter, strides, pad4, dataFormat = "NHWC", dimRoundingMode) { + assert3(xShape.length === dy.rank, () => `Length of inShape (${xShape.length}) and rank of dy (${dy.rank}) must match`); + let xShape4D = xShape; + let dy4D = dy; + let reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + xShape4D = [1, xShape[0], xShape[1], xShape[2]]; + } + assert3(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ${xShape4D.length}.`); + assert3(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got rank ${dy4D.rank}`); + assert3(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got rank ${filter.rank}`); + const inDepth = dataFormat === "NHWC" ? xShape4D[3] : xShape4D[1]; + const outDepth = dataFormat === "NHWC" ? dy4D.shape[3] : dy4D.shape[1]; + assert3(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must match input depth for filter ${filter.shape[2]}.`); + assert3(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must match output depth for filter ${filter.shape[3]}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { dy: dy4D, filter }; + const attrs = { strides, pad: pad4, dataFormat, dimRoundingMode, inputShape: xShape4D }; + const res = ENGINE2.runKernel(Conv2DBackpropInput2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var conv2DBackpropInput5 = op2({ conv2DBackpropInput_: conv2DBackpropInput_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.js +function conv2dTranspose_2(x, filter, outputShape, strides, pad4, dimRoundingMode) { + const $x = convertToTensor2(x, "x", "conv2dTranspose"); + const $filter = convertToTensor2(filter, "filter", "conv2dTranspose"); + return conv2DBackpropInput5(outputShape, $x, $filter, strides, pad4, "NHWC", dimRoundingMode); +} +var conv2dTranspose3 = op2({ conv2dTranspose_: conv2dTranspose_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.js +function conv3d_2(x, filter, strides, pad4, dataFormat = "NDHWC", dilations = [1, 1, 1]) { + const $x = convertToTensor2(x, "x", "conv3d"); + const $filter = convertToTensor2(filter, "filter", "conv3d"); + let x5D = $x; + let reshapedTo5D = false; + if ($x.rank === 4) { + reshapedTo5D = true; + x5D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]); + } + assert3(x5D.rank === 5, () => `Error in conv3d: input must be rank 5, but got rank ${x5D.rank}.`); + assert3($filter.rank === 5, () => `Error in conv3d: filter must be rank 5, but got rank ${$filter.rank}.`); + assert3(x5D.shape[4] === $filter.shape[3], () => `Error in conv3d: depth of input (${x5D.shape[4]}) must match input depth for filter ${$filter.shape[3]}.`); + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in conv3D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + assert3(dataFormat === "NDHWC", () => `Error in conv3d: got dataFormat of ${dataFormat} but only NDHWC is currently supported.`); + const inputs = { x: x5D, filter: $filter }; + const attrs = { strides, pad: pad4, dataFormat, dilations }; + const res = ENGINE2.runKernel(Conv3D3, inputs, attrs); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var conv3d3 = op2({ conv3d_: conv3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_input.js +function conv3DBackpropInput_2(xShape, dy, filter, strides, pad4) { + assert3(xShape.length === dy.rank, () => `Length of inShape (${xShape.length}) and rank of dy (${dy.rank}) must match`); + let xShape5D = xShape; + let dy5D = dy; + let reshapedTo5D = false; + if (dy.rank === 4) { + reshapedTo5D = true; + dy5D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); + xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; + } + const inDepth = xShape5D[4]; + const outDepth = dy5D.shape[4]; + assert3(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ${xShape5D.length}.`); + assert3(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got rank ${dy5D.rank}`); + assert3(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got rank ${filter.rank}`); + assert3(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must match input depth for filter ${filter.shape[3]}.`); + assert3(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must match output depth for filter ${filter.shape[4]}.`); + const inputs = { dy: dy5D, filter }; + const attrs = { pad: pad4, strides, inputShape: xShape5D }; + const res = ENGINE2.runKernel(Conv3DBackpropInputV22, inputs, attrs); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var conv3DBackpropInput3 = op2({ conv3DBackpropInput_: conv3DBackpropInput_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.js +function conv3dTranspose_2(x, filter, outputShape, strides, pad4) { + const $x = convertToTensor2(x, "x", "conv3dTranspose"); + const $filter = convertToTensor2(filter, "filter", "conv3dTranspose"); + return conv3DBackpropInput3(outputShape, $x, $filter, strides, pad4); +} +var conv3dTranspose3 = op2({ conv3dTranspose_: conv3dTranspose_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/cos.js +function cos_2(x) { + const $x = convertToTensor2(x, "x", "cos"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Cos2, inputs); +} +var cos4 = op2({ cos_: cos_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.js +function cosh_2(x) { + const $x = convertToTensor2(x, "x", "cosh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Cosh2, inputs); +} +var cosh4 = op2({ cosh_: cosh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.js +function cumsum_2(x, axis = 0, exclusive = false, reverse8 = false) { + const $x = convertToTensor2(x, "x", "cumsum"); + const inputs = { x: $x }; + const attrs = { axis, exclusive, reverse: reverse8 }; + return ENGINE2.runKernel(Cumsum2, inputs, attrs); +} +var cumsum5 = op2({ cumsum_: cumsum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.js +function denseBincount_2(x, weights, size2, binaryOutput = false) { + const $x = convertToTensor2(x, "x", "denseBincount"); + const $weights = convertToTensor2(weights, "weights", "denseBincount"); + assert3($x.dtype === "int32", () => `Error in denseBincount: input dtype must be int32, but got ${$x.dtype}`); + assert3($x.rank <= 2, () => `Error in denseBincount: input must be at most rank 2, but got rank ${$x.rank}.`); + assert3(size2 >= 0, () => `size must be non-negative, but got ${size2}.`); + assert3($weights.size === $x.size || $weights.size === 0, () => `Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${$x.shape}, weights shape: ${$weights.shape}.`); + const inputs = { x: $x, weights: $weights }; + const attrs = { size: size2, binaryOutput }; + return ENGINE2.runKernel(DenseBincount2, inputs, attrs); +} +var denseBincount4 = op2({ denseBincount_: denseBincount_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.js +function depthToSpace_2(x, blockSize, dataFormat = "NHWC") { + const $x = convertToTensor2(x, "x", "depthToSpace"); + const inputHeight = dataFormat === "NHWC" ? $x.shape[1] : $x.shape[2]; + const inputWidth = dataFormat === "NHWC" ? $x.shape[2] : $x.shape[3]; + const inputDepth = dataFormat === "NHWC" ? $x.shape[3] : $x.shape[1]; + assert3(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying + ${inputHeight} and ${blockSize} for depthToSpace with input shape + ${$x.shape}`); + assert3(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying + ${inputWidth} and ${blockSize} for depthToSpace with input shape + ${$x.shape}`); + assert3(inputDepth % (blockSize * blockSize) === 0, () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); + const inputs = { x: $x }; + const attrs = { blockSize, dataFormat }; + return ENGINE2.runKernel(DepthToSpace2, inputs, attrs); +} +var depthToSpace5 = op2({ depthToSpace_: depthToSpace_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.js +function depthwiseConv2d_2(x, filter, strides, pad4, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode) { + const $x = convertToTensor2(x, "x", "depthwiseConv2d"); + const $filter = convertToTensor2(filter, "filter", "depthwiseConv2d"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert3($filter.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ${$filter.rank}.`); + assert3(x4D.shape[3] === $filter.shape[2], () => `Error in depthwiseConv2d: number of input channels (${x4D.shape[3]}) must match the inChannels dimension in filter ${$filter.shape[2]}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x4D, filter: $filter }; + const attrs = { strides, pad: pad4, dataFormat, dilations, dimRoundingMode }; + const res = ENGINE2.runKernel(DepthwiseConv2dNative2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var depthwiseConv2d6 = op2({ depthwiseConv2d_: depthwiseConv2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.js +function dilation2d_2(x, filter, strides, pad4, dilations = [1, 1], dataFormat = "NHWC") { + const $x = convertToTensor2(x, "x", "dilation2d"); + const $filter = convertToTensor2(filter, "filter", "dilation2d"); + assert3($x.rank === 3 || $x.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ${$x.rank}.`); + assert3($filter.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ${$filter.rank}.`); + assert3(dataFormat === "NHWC", () => `Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${dataFormat}`); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + reshapedTo4D = true; + } + const inputs = { x: x4D, filter: $filter }; + const attrs = { strides, pad: pad4, dilations }; + const res = ENGINE2.runKernel(Dilation2D2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var dilation2d2 = op2({ dilation2d_: dilation2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js +function getBroadcastDims3(inShape, outShape) { + const inRank = inShape.length; + const dims = []; + for (let i = 0; i < inRank; i++) { + const dim = inRank - 1 - i; + const a = inShape[dim] || 1; + const b = outShape[outShape.length - 1 - i] || 1; + if (b > 1 && a === 1) { + dims.unshift(dim); + } + } + return dims; +} +function getReductionAxes2(inShape, outShape) { + const result = []; + for (let i = 0; i < outShape.length; i++) { + const inDim = inShape[inShape.length - i - 1]; + const outAxis = outShape.length - i - 1; + const outDim = outShape[outAxis]; + if (inDim == null || inDim === 1 && outDim > 1) { + result.unshift(outAxis); + } + } + return result; +} +function assertAndGetBroadcastShape2(shapeA, shapeB) { + const result = []; + const l = Math.max(shapeA.length, shapeB.length); + for (let i = 0; i < l; i++) { + let a = shapeA[shapeA.length - i - 1]; + if (a == null) { + a = 1; + } + let b = shapeB[shapeB.length - i - 1]; + if (b == null) { + b = 1; + } + if (a === 1) { + result.unshift(b); + } else if (b === 1) { + result.unshift(a); + } else if (a !== b) { + const errMsg = `Operands could not be broadcast together with shapes ${shapeA} and ${shapeB}.`; + throw Error(errMsg); + } else { + result.unshift(a); + } + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/equal.js +function equal_2(a, b) { + let $a = convertToTensor2(a, "a", "equal", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "equal", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Equal2, inputs); +} +var equal4 = op2({ equal_: equal_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/where.js +function where_2(condition, a, b) { + const $a = convertToTensor2(a, "a", "where"); + const $b = convertToTensor2(b, "b", "where"); + const $condition = convertToTensor2(condition, "condition", "where", "bool"); + const broadcastShape = assertAndGetBroadcastShape2(assertAndGetBroadcastShape2($condition.shape, $a.shape), $b.shape); + const $broadcastedCondition = broadcastTo2($condition, broadcastShape); + const $broadcastedA = broadcastTo2($a, broadcastShape); + const $broadcastedB = broadcastTo2($b, broadcastShape); + const inputs = { + condition: $broadcastedCondition, + t: $broadcastedA, + e: $broadcastedB + }; + return ENGINE2.runKernel(Select2, inputs); +} +var where2 = op2({ where_: where_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.js +function zerosLike_2(x) { + const $x = convertToTensor2(x, "x", "zerosLike"); + const inputs = { x: $x }; + return ENGINE2.runKernel(ZerosLike2, inputs); +} +var zerosLike5 = op2({ zerosLike_: zerosLike_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.js +function divNoNan_2(a, b) { + let $a = convertToTensor2(a, "a", "div"); + let $b = convertToTensor2(b, "b", "div"); + [$a, $b] = makeTypesMatch2($a, $b); + const divResult = div3($a, $b); + const zeros6 = zerosLike5(divResult); + const bEqualsZero = equal4($b, zeros6); + return where2(bEqualsZero, zeros6, divResult); +} +var divNoNan2 = op2({ divNoNan_: divNoNan_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/dot.js +function dot_2(t1, t2) { + const $t1 = convertToTensor2(t1, "t1", "dot"); + const $t2 = convertToTensor2(t2, "t2", "dot"); + assert3(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ${$t1.rank} and ${$t2.rank}.`); + const t1Inner = $t1.rank === 1 ? $t1.size : $t1.shape[1]; + const t2Inner = $t2.rank === 1 ? $t2.size : $t2.shape[0]; + assert3(t1Inner === t2Inner, () => `Error in dot: inner dimensions of inputs must match, but got ${t1Inner} and ${t2Inner}.`); + if ($t1.rank === 1 && $t2.rank === 1) { + const t12D = reshape6($t1, [1, -1]); + const t22D = reshape6($t2, [-1, 1]); + const t1t2 = matMul3(t12D, t22D); + return reshape6(t1t2, []); + } else if ($t1.rank === 1 && $t2.rank === 2) { + const t12D = reshape6($t1, [1, -1]); + const t22D = reshape6($t2, [$t2.shape[0], $t2.shape[1]]); + const t1t2 = matMul3(t12D, t22D); + return reshape6(t1t2, [t1t2.size]); + } else if ($t1.rank === 2 && $t2.rank === 1) { + const t22D = reshape6($t2, [-1, 1]); + const t1t2 = matMul3($t1, t22D); + return reshape6(t1t2, [t1t2.size]); + } else { + const t22D = reshape6($t2, [$t2.shape[0], $t2.shape[1]]); + const t1t2 = matMul3($t1, t22D); + return t1t2; + } +} +var dot6 = op2({ dot_: dot_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.js +function einsum_2(equation, ...tensors) { + const $tensors = tensors.map((t, i) => convertToTensor2(t, `tensors${i}`, "einsum")); + const attrs = { equation }; + return ENGINE2.runKernel(Einsum2, $tensors, attrs); +} +var einsum4 = op2({ einsum_: einsum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/elu.js +function elu_2(x) { + const $x = convertToTensor2(x, "x", "elu"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Elu3, inputs); +} +var elu6 = op2({ elu_: elu_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/erf.js +function erf_2(x) { + let $x = convertToTensor2(x, "x", "erf"); + assert3($x.dtype === "int32" || $x.dtype === "float32", () => "Input dtype must be `int32` or `float32`."); + if ($x.dtype === "int32") { + $x = cast6($x, "float32"); + } + const inputs = { x: $x }; + return ENGINE2.runKernel(Erf2, inputs); +} +var erf4 = op2({ erf_: erf_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/exp.js +function exp_2(x) { + const $x = convertToTensor2(x, "x", "exp"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Exp2, inputs); +} +var exp4 = op2({ exp_: exp_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.js +function expandDims_2(x, axis = 0) { + const $x = convertToTensor2(x, "x", "expandDims", "string_or_numeric"); + assert3(axis <= $x.rank, () => "Axis must be <= rank of the tensor"); + const inputs = { input: $x }; + const attrs = { dim: axis }; + return ENGINE2.runKernel(ExpandDims2, inputs, attrs); +} +var expandDims6 = op2({ expandDims_: expandDims_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.js +function expm1_2(x) { + const $x = convertToTensor2(x, "x", "expm1"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Expm12, inputs); +} +var expm14 = op2({ expm1_: expm1_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tile.js +function tile_2(x, reps) { + const $x = convertToTensor2(x, "x", "tile", "string_or_numeric"); + assert3($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} must match length of reps ${reps}.`); + const inputs = { x: $x }; + const attrs = { reps }; + return ENGINE2.runKernel(Tile2, inputs, attrs); +} +var tile6 = op2({ tile_: tile_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/eye.js +function eye_2(numRows, numColumns, batchShape, dtype = "float32") { + if (numColumns == null) { + numColumns = numRows; + } + const buff = buffer2([numRows, numColumns], dtype); + const n = numRows <= numColumns ? numRows : numColumns; + for (let i = 0; i < n; ++i) { + buff.set(1, i, i); + } + const out = reshape6(buff.toTensor(), [numRows, numColumns]); + if (batchShape == null) { + return out; + } else { + if (batchShape.length === 1) { + return tile6(expandDims6(out, 0), [batchShape[0], 1, 1]); + } else if (batchShape.length === 2) { + return tile6(expandDims6(expandDims6(out, 0), 0), [batchShape[0], batchShape[1], 1, 1]); + } else if (batchShape.length === 3) { + return tile6(expandDims6(expandDims6(expandDims6(out, 0), 0), 0), [ + batchShape[0], + batchShape[1], + batchShape[2], + 1, + 1 + ]); + } else { + throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${batchShape.length}D.`); + } + } +} +var eye2 = op2({ eye_: eye_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fill.js +function fill5(shape, value, dtype) { + const attrs = { shape, value, dtype }; + return ENGINE2.runKernel(Fill2, {}, attrs); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/floor.js +function floor_2(x) { + const $x = convertToTensor2(x, "x", "floor"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Floor2, inputs); +} +var floor4 = op2({ floor_: floor_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/gather.js +function gather_2(x, indices, axis = 0, batchDims = 0) { + const $x = convertToTensor2(x, "x", "gather"); + const $indices = convertToTensor2(indices, "indices", "gather", "int32"); + const inputs = { x: $x, indices: $indices }; + const attrs = { axis, batchDims }; + return ENGINE2.runKernel(GatherV22, inputs, attrs); +} +var gather3 = op2({ gather_: gather_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/greater.js +function greater_2(a, b) { + let $a = convertToTensor2(a, "a", "greater", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "greater", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Greater2, inputs); +} +var greater5 = op2({ greater_: greater_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.js +function greaterEqual_2(a, b) { + let $a = convertToTensor2(a, "a", "greaterEqual", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "greaterEqual", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(GreaterEqual2, inputs); +} +var greaterEqual4 = op2({ greaterEqual_: greaterEqual_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/imag.js +function imag_2(input3) { + const $input = convertToTensor2(input3, "input", "imag"); + const inputs = { input: $input }; + return ENGINE2.runKernel(Imag2, inputs); +} +var imag4 = op2({ imag_: imag_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.js +function isFinite_2(x) { + const $x = convertToTensor2(x, "x", "isFinite"); + const inputs = { x: $x }; + return ENGINE2.runKernel(IsFinite2, inputs); +} +var isFinite5 = op2({ isFinite_: isFinite_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.js +function isInf_2(x) { + const $x = convertToTensor2(x, "x", "isInf"); + const inputs = { x: $x }; + return ENGINE2.runKernel(IsInf2, inputs); +} +var isInf4 = op2({ isInf_: isInf_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.js +function isNaN_2(x) { + const $x = convertToTensor2(x, "x", "isNaN"); + const inputs = { x: $x }; + return ENGINE2.runKernel(IsNan2, inputs); +} +var isNaN5 = op2({ isNaN_: isNaN_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js +function leakyRelu_2(x, alpha = 0.2) { + const $x = convertToTensor2(x, "x", "leakyRelu"); + const inputs = { x: $x }; + const attrs = { alpha }; + return ENGINE2.runKernel(LeakyRelu2, inputs, attrs); +} +var leakyRelu5 = op2({ leakyRelu_: leakyRelu_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/less.js +function less_2(a, b) { + let $a = convertToTensor2(a, "a", "less", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "less", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Less2, inputs); +} +var less5 = op2({ less_: less_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.js +function lessEqual_2(a, b) { + let $a = convertToTensor2(a, "a", "lessEqual", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "lessEqual", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(LessEqual2, inputs); +} +var lessEqual4 = op2({ lessEqual_: lessEqual_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.js +function linspace2(start, stop, num) { + if (num <= 0) { + throw new Error("The number of values should be positive."); + } + const attrs = { start, stop, num }; + return ENGINE2.runKernel(LinSpace2, {}, attrs); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.js +function localResponseNormalization_2(x, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { + const $x = convertToTensor2(x, "x", "localResponseNormalization"); + assert3($x.rank === 4 || $x.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${$x.rank}.`); + assert3(isInt2(depthRadius), () => `Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${depthRadius}.`); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + const inputs = { x: x4D }; + const attrs = { depthRadius, bias, alpha, beta }; + const res = ENGINE2.runKernel(LRN2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } else { + return res; + } +} +var localResponseNormalization2 = op2({ localResponseNormalization_: localResponseNormalization_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/log.js +function log_2(x) { + const $x = convertToTensor2(x, "x", "log"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Log2, inputs); +} +var log10 = op2({ log_: log_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.js +function log1p_2(x) { + const $x = convertToTensor2(x, "x", "log1p"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Log1p2, inputs); +} +var log1p4 = op2({ log1p_: log1p_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients.js +function variableGrads2(f, varList) { + assert3(isFunction2(f), () => "The f passed in variableGrads(f) must be a function"); + assert3(varList == null || Array.isArray(varList) && varList.every((v) => v instanceof Variable2), () => "The varList passed in variableGrads(f, varList) must be an array of variables"); + const specifiedVarList = varList != null; + if (!specifiedVarList) { + varList = []; + for (const varName in ENGINE2.registeredVariables) { + varList.push(ENGINE2.registeredVariables[varName]); + } + } + const specifiedNonTrainable = specifiedVarList ? varList.filter((variable3) => !variable3.trainable) : null; + const originalVarCount = varList.length; + varList = varList.filter((variable3) => variable3.trainable); + assert3(varList.length > 0, () => `variableGrads() expects at least one of the input variables to be trainable, but none of the ${originalVarCount} variables is trainable.`); + const allowNoGradients = true; + const { value, grads: grads2 } = ENGINE2.gradients(f, varList, null, allowNoGradients); + assert3(grads2.some((g) => g != null), () => "Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."); + assert3(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it returned a rank-${value.rank} tensor`); + const namedGrads = {}; + varList.forEach((v, i) => { + if (grads2[i] != null) { + namedGrads[v.name] = grads2[i]; + } + }); + if (specifiedNonTrainable != null) { + specifiedNonTrainable.forEach((v) => namedGrads[v.name] = null); + } + return { value, grads: namedGrads }; +} +function customGrad2(f) { + return ENGINE2.customGrad(f); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/neg.js +function neg_2(x) { + const $x = convertToTensor2(x, "x", "neg"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Neg2, inputs); +} +var neg4 = op2({ neg_: neg_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.js +function softplus_2(x) { + const $x = convertToTensor2(x, "x", "softplus"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Softplus3, inputs); +} +var softplus4 = op2({ softplus_: softplus_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.js +function logSigmoid_2(x) { + const $x = convertToTensor2(x, "x", "logSigmoid"); + const customOp = customGrad2((x2) => { + const value = neg4(softplus4(neg4(x2))); + const gradFunc = (dy) => { + const derX = mul2(dy, sigmoid5(neg4(x2))); + return derX; + }; + return { value, gradFunc }; + }); + return customOp($x); +} +var logSigmoid2 = op2({ logSigmoid_: logSigmoid_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max.js +function max_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "max"); + const inputs = { x: $x }; + const attrs = { reductionIndices: axis, keepDims }; + return ENGINE2.runKernel(Max2, inputs, attrs); +} +var max6 = op2({ max_: max_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sub.js +function sub_2(a, b) { + let $a = convertToTensor2(a, "a", "sub"); + let $b = convertToTensor2(b, "b", "sub"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Sub2, inputs); +} +var sub4 = op2({ sub_: sub_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sum.js +function sum_2(x, axis = null, keepDims = false) { + let $x = convertToTensor2(x, "x", "sum"); + if ($x.dtype === "bool") { + $x = cast6($x, "int32"); + } + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(Sum2, inputs, attrs); +} +var sum7 = op2({ sum_: sum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.js +function logSoftmax_2(logits, axis = -1) { + const $logits = convertToTensor2(logits, "logits", "logSoftmax"); + if (axis === -1) { + axis = $logits.rank - 1; + } + if (axis !== $logits.rank - 1) { + throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${$logits.rank} and axis was ${axis}`); + } + const customOp = customGrad2((logits2, save) => { + const keepDims = true; + const xMax = max6(logits2, axis, true); + const shifted = sub4(logits2, xMax); + const value = sub4(cast6(shifted, "float32"), log10(sum7(exp4(shifted), axis, keepDims))); + save([value]); + const gradFunc = (dy, saved) => { + const [value2] = saved; + const keepDims2 = true; + const softmax9 = exp4(value2); + return sub4(dy, mul2(sum7(dy, axis, keepDims2), softmax9)); + }; + return { value, gradFunc }; + }); + return customOp($logits); +} +var logSoftmax2 = op2({ logSoftmax_: logSoftmax_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js +function axesAreInnerMostDims2(axes, rank) { + for (let i = 0; i < axes.length; ++i) { + if (axes[axes.length - i - 1] !== rank - 1 - i) { + return false; + } + } + return true; +} +function combineLocations2(outputLoc, reduceLoc, axes) { + const rank = outputLoc.length + reduceLoc.length; + const loc = []; + let outIdx = 0; + let reduceIdx = 0; + for (let dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + loc.push(outputLoc[outIdx++]); + } else { + loc.push(reduceLoc[reduceIdx++]); + } + } + return loc; +} +function computeOutAndReduceShapes2(aShape, axes) { + const outShape = []; + const rank = aShape.length; + for (let dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + outShape.push(aShape[dim]); + } + } + const reduceShape = axes.map((dim) => aShape[dim]); + return [outShape, reduceShape]; +} +function expandShapeToKeepDim2(shape, axes) { + const reduceSubShape = axes.map((x) => 1); + return combineLocations2(shape, reduceSubShape, axes); +} +function assertAxesAreInnerMostDims2(msg, axes, rank) { + assert3(axesAreInnerMostDims2(axes, rank), () => `${msg} supports only inner-most axes for now. Got axes ${axes} and rank-${rank} input.`); +} +function getAxesPermutation2(axes, rank) { + if (axesAreInnerMostDims2(axes, rank)) { + return null; + } + const result = []; + for (let i = 0; i < rank; ++i) { + if (axes.indexOf(i) === -1) { + result.push(i); + } + } + axes.forEach((axis) => result.push(axis)); + return result; +} +function getUndoAxesPermutation2(axes) { + return axes.map((axis, i) => [i, axis]).sort((a, b) => a[1] - b[1]).map((x) => x[0]); +} +function getInnerMostAxes2(numAxes, rank) { + const res = []; + for (let i = rank - numAxes; i < rank; ++i) { + res.push(i); + } + return res; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.js +function logSumExp_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "logSumExp"); + const axes = parseAxisParam2(axis, $x.shape); + const xMax = max6($x, axes, true); + const a = sub4($x, xMax); + const b = exp4(a); + const c = sum7(b, axes); + const d = log10(c); + const res = add6(reshape6(xMax, d.shape), d); + if (keepDims) { + const newShape = expandShapeToKeepDim2(res.shape, axes); + return reshape6(res, newShape); + } + return res; +} +var logSumExp2 = op2({ logSumExp_: logSumExp_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.js +function logicalAnd_2(a, b) { + const $a = convertToTensor2(a, "a", "logicalAnd", "bool"); + const $b = convertToTensor2(b, "b", "logicalAnd", "bool"); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(LogicalAnd2, inputs); +} +var logicalAnd4 = op2({ logicalAnd_: logicalAnd_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.js +function logicalNot_2(x) { + const $x = convertToTensor2(x, "x", "logicalNot", "bool"); + const inputs = { x: $x }; + return ENGINE2.runKernel(LogicalNot2, inputs); +} +var logicalNot4 = op2({ logicalNot_: logicalNot_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.js +function logicalOr_2(a, b) { + const $a = convertToTensor2(a, "a", "logicalOr", "bool"); + const $b = convertToTensor2(b, "b", "logicalOr", "bool"); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(LogicalOr2, inputs); +} +var logicalOr4 = op2({ logicalOr_: logicalOr_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.js +function logicalXor_2(a, b) { + const $a = convertToTensor2(a, "a", "logicalXor", "bool"); + const $b = convertToTensor2(b, "b", "logicalXor", "bool"); + assertAndGetBroadcastShape2($a.shape, $b.shape); + return logicalAnd4(logicalOr4(a, b), logicalNot4(logicalAnd4(a, b))); +} +var logicalXor2 = op2({ logicalXor_: logicalXor_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.js +function maxPool_2(x, filterSize, strides, pad4, dimRoundingMode) { + const $x = convertToTensor2(x, "x", "maxPool"); + const dilations = 1; + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`); + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in maxPool: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x4D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode }; + const res = ENGINE2.runKernel(MaxPool2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var maxPool5 = op2({ maxPool_: maxPool_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.js +function maxPool3d_2(x, filterSize = [1, 1, 1], strides, pad4, dimRoundingMode, dataFormat = "NDHWC") { + const $x = convertToTensor2(x, "x", "maxPool3d"); + let x5D = $x; + let reshapedTo5D = false; + if ($x.rank === 4) { + reshapedTo5D = true; + x5D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]); + } + assert3(x5D.rank === 5, () => `Error in maxPool3d: x must be rank 5 but got rank ${x5D.rank}.`); + assert3(dataFormat === "NDHWC", () => `Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${dataFormat}`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x5D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode, dataFormat }; + const res = ENGINE2.runKernel(MaxPool3D2, inputs, attrs); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var maxPool3d3 = op2({ maxPool3d_: maxPool3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.js +function maxPoolWithArgmax_2(x, filterSize, strides, pad4, includeBatchInIndex = false) { + const $x = convertToTensor2(x, "x", "maxPoolWithArgmax"); + const inputs = { x: $x }; + const attrs = { filterSize, strides, pad: pad4, includeBatchInIndex }; + const result = ENGINE2.runKernel(MaxPoolWithArgmax2, inputs, attrs); + return { result: result[0], indexes: result[1] }; +} +var maxPoolWithArgmax2 = op2({ maxPoolWithArgmax_: maxPoolWithArgmax_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.js +function maximum_2(a, b) { + let $a = convertToTensor2(a, "a", "maximum"); + let $b = convertToTensor2(b, "b", "maximum"); + [$a, $b] = makeTypesMatch2($a, $b); + if ($a.dtype === "bool") { + $a = cast6($a, "int32"); + $b = cast6($b, "int32"); + } + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Maximum3, inputs); +} +var maximum5 = op2({ maximum_: maximum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/mean.js +function mean_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "mean"); + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(Mean2, inputs, attrs); +} +var mean4 = op2({ mean_: mean_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.js +function zeros4(shape, dtype = "float32") { + if (dtype === "complex64") { + const real7 = zeros4(shape, "float32"); + const imag7 = zeros4(shape, "float32"); + return complex4(real7, imag7); + } + const values = makeZerosTypedArray2(sizeFromShape2(shape), dtype); + return ENGINE2.makeTensor(values, shape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/ones.js +function ones5(shape, dtype = "float32") { + if (dtype === "complex64") { + const real7 = ones5(shape, "float32"); + const imag7 = zeros4(shape, "float32"); + return complex4(real7, imag7); + } + const values = makeOnesTypedArray2(sizeFromShape2(shape), dtype); + return ENGINE2.makeTensor(values, shape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/min.js +function min_2(x, axis = null, keepDims = false) { + const $x = convertToTensor2(x, "x", "min"); + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(Min2, inputs, attrs); +} +var min6 = op2({ min_: min_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.js +function minimum_2(a, b) { + let $a = convertToTensor2(a, "a", "minimum"); + let $b = convertToTensor2(b, "b", "minimum"); + [$a, $b] = makeTypesMatch2($a, $b); + if ($a.dtype === "bool") { + $a = cast6($a, "int32"); + $b = cast6($b, "int32"); + } + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Minimum3, inputs); +} +var minimum5 = op2({ minimum_: minimum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.js +function mirrorPad_2(x, paddings, mode) { + assert3(mode === "reflect" || mode === "symmetric", () => `Invalid mode. Mode must be either reflect or symmetric. Got ${mode}.`); + const $x = convertToTensor2(x, "x", "mirrorPad"); + if ($x.rank === 0) { + throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad"); + } + assert3(paddings.length === $x.rank, () => `Padding doesn't match input. Must be ${$x.rank}. Got ${paddings.length}.`); + const shapeOffset = mode === "reflect" ? 1 : 0; + for (let i = 0; i < $x.rank; i++) { + assert3(paddings[i].length === 2, () => `Invalid number of paddings. Must be length of 2 each.`); + assert3(paddings[i][0] >= 0 && paddings[i][0] <= $x.shape[i] - shapeOffset && paddings[i][1] >= 0 && paddings[i][1] <= $x.shape[i] - shapeOffset, () => `Padding in dimension ${i} cannot be greater than or equal to ${$x.shape[i] - shapeOffset} or less than 0 for input of shape ${$x.shape}`); + } + const attrs = { paddings, mode }; + const inputs = { x: $x }; + return ENGINE2.runKernel(MirrorPad2, inputs, attrs); +} +var mirrorPad4 = op2({ mirrorPad_: mirrorPad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/mod.js +function mod_2(a, b) { + let $a = convertToTensor2(a, "a", "mod"); + let $b = convertToTensor2(b, "b", "mod"); + [$a, $b] = makeTypesMatch2($a, $b); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(Mod2, inputs); +} +var mod4 = op2({ mod_: mod_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/square.js +function square_2(x) { + const $x = convertToTensor2(x, "x", "square"); + const attrs = {}; + return ENGINE2.runKernel("Square", { x: $x }, attrs); +} +var square4 = op2({ square_: square_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/moments.js +function moments_2(x, axis = null, keepDims = false) { + x = convertToTensor2(x, "x", "moments"); + const axes = parseAxisParam2(axis, x.shape); + const xMean = mean4(x, axes, keepDims); + let keepDimsShape = xMean.shape; + if (!keepDims) { + keepDimsShape = expandShapeToKeepDim2(xMean.shape, axes); + } + const devSquared = square4(sub4(cast6(x, "float32"), reshape6(xMean, keepDimsShape))); + const variance = mean4(devSquared, axes, keepDims); + return { mean: xMean, variance }; +} +var moments2 = op2({ moments_: moments_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.js +function multinomial_2(logits, numSamples, seed, normalized = false) { + const $logits = convertToTensor2(logits, "logits", "multinomial"); + const numOutcomes = $logits.size; + const origRank = $logits.rank; + if (numOutcomes < 2) { + throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${numOutcomes}.`); + } + if (origRank > 2) { + throw new Error(`Rank of probabilities must be 1 or 2, but is ${origRank}`); + } + seed = seed || Math.random(); + const logits2D = origRank === 1 ? reshape6($logits, [1, -1]) : $logits; + const inputs = { logits: logits2D }; + const attrs = { numSamples, seed, normalized }; + const res = ENGINE2.runKernel(Multinomial2, inputs, attrs); + return origRank === 1 ? reshape6(res, [res.size]) : res; +} +var multinomial4 = op2({ multinomial_: multinomial_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.js +function notEqual_2(a, b) { + let $a = convertToTensor2(a, "a", "notEqual", "string_or_numeric"); + let $b = convertToTensor2(b, "b", "notEqual", "string_or_numeric"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + return ENGINE2.runKernel(NotEqual2, inputs); +} +var notEqual4 = op2({ notEqual_: notEqual_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.js +function onesLike_2(x) { + const $x = convertToTensor2(x, "x", "onesLike"); + const inputs = { x: $x }; + return ENGINE2.runKernel(OnesLike2, inputs); +} +var onesLike5 = op2({ onesLike_: onesLike_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/pad.js +function pad_2(x, paddings, constantValue = 0) { + const $x = convertToTensor2(x, "x", "pad"); + if ($x.rank === 0) { + throw new Error("pad(scalar) is not defined. Pass non-scalar to pad"); + } + const attrs = { paddings, constantValue }; + const inputs = { x: $x }; + return ENGINE2.runKernel(PadV22, inputs, attrs); +} +var pad3 = op2({ pad_: pad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.js +function spaceToBatchND_2(x, blockShape, paddings) { + const $x = convertToTensor2(x, "x", "spaceToBatchND"); + assert3($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); + assert3(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); + assert3($x.shape.reduce((a, b, i) => { + if (i > 0 && i <= blockShape.length) { + return a && (b + paddings[i - 1][0] + paddings[i - 1][1]) % blockShape[i - 1] === 0; + } + return a; + }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); + const inputs = { x: $x }; + const attrs = { blockShape, paddings }; + return ENGINE2.runKernel(SpaceToBatchND2, inputs, attrs); +} +var spaceToBatchND5 = op2({ spaceToBatchND_: spaceToBatchND_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js +function pool_2(input3, windowShape, poolingType, pad4, dilations, strides) { + if (dilations == null) { + dilations = [1, 1]; + } + if (strides == null) { + strides = 1; + } + if (pad4 === 0) { + pad4 = "valid"; + } + const $x = convertToTensor2(input3, "x", "maxPool"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in pool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = computePool2DInfo2(x4D.shape, windowShape, strides, dilations, pad4); + const dilation = [convInfo.dilationHeight, convInfo.dilationWidth]; + let basePadding; + if (pad4 === "same") { + basePadding = withSpaceToBatchBasePaddings2([convInfo.filterHeight, convInfo.filterWidth], dilation); + } else { + basePadding = [[0, 0], [0, 0]]; + } + const isDilationOne = dilation[0] === 1 && dilation[1] === 1; + const [adjustedPadding, adjustedCrops] = requiredSpaceToBatchPaddings2([convInfo.inHeight, convInfo.inWidth], dilation, basePadding); + const convertedPad = isDilationOne ? pad4 : "valid"; + const convertedX = isDilationOne ? x4D : spaceToBatchND5(x4D, dilation, adjustedPadding); + const forwardOp = poolingType === "avg" ? () => avgPool5(convertedX, windowShape, strides, convertedPad) : () => maxPool5(convertedX, windowShape, strides, convertedPad); + const y = forwardOp(); + const res = isDilationOne ? y : batchToSpaceND5(y, dilation, adjustedCrops); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +function requiredSpaceToBatchPaddings2(inputShape, blockShape, basePadding) { + const padStart = basePadding.map((b) => b[0]); + const origPadEnd = basePadding.map((b) => b[1]); + const fullInputShape = inputShape.concat(padStart, origPadEnd); + const padEndExtra = blockShape.map((b, i) => (b - fullInputShape[i] % b) % b); + const padEnd = origPadEnd.map((s, i) => s + padEndExtra[i]); + const paddings = blockShape.map((_, i) => [padStart[i], padEnd[i]]); + const crops = blockShape.map((_, i) => [0, padEndExtra[i]]); + return [paddings, crops]; +} +function withSpaceToBatchBasePaddings2(filterShape, dilation) { + const dilatedFilterShape = filterShape.map((s, i) => { + return s + (s - 1) * (dilation[i] - 1); + }); + const padExtraShape = dilatedFilterShape.map((s) => s - 1); + const padExtraStart = padExtraShape.map((s) => Math.floor(s / 2)); + const padExtraEnd = padExtraShape.map((s, i) => s - padExtraStart[i]); + return padExtraShape.map((_, i) => { + return [padExtraStart[i], padExtraEnd[i]]; + }); +} +var pool3 = op2({ pool_: pool_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/pow.js +function pow_2(base2, exp7) { + let $base = convertToTensor2(base2, "base", "pow"); + let $exp = convertToTensor2(exp7, "exp", "pow"); + [$base, $exp] = makeTypesMatch2($base, $exp); + const inputs = { a: $base, b: $exp }; + return ENGINE2.runKernel(Pow2, inputs); +} +var pow4 = op2({ pow_: pow_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js +function prelu_2(x, alpha) { + const $x = convertToTensor2(x, "x", "prelu"); + const $alpha = convertToTensor2(alpha, "alpha", "prelu"); + const inputs = { x: $x, alpha: $alpha }; + return ENGINE2.runKernel(Prelu2, inputs); +} +var prelu6 = op2({ prelu_: prelu_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/prod.js +function prod_2(x, axis = null, keepDims = false) { + let $x = convertToTensor2(x, "x", "prod"); + if ($x.dtype === "bool") { + $x = cast6($x, "int32"); + } + const inputs = { x: $x }; + const attrs = { axis, keepDims }; + return ENGINE2.runKernel(Prod2, inputs, attrs); +} +var prod5 = op2({ prod_: prod_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js +var seedrandom5 = __toModule(require_seedrandom6()); +var MPRandGauss2 = class { + constructor(mean6, stdDeviation, dtype, truncated, seed) { + this.mean = mean6; + this.stdDev = stdDeviation; + this.dtype = dtype; + this.nextVal = NaN; + this.truncated = truncated; + if (this.truncated) { + this.upper = this.mean + this.stdDev * 2; + this.lower = this.mean - this.stdDev * 2; + } + const seedValue = seed ? seed : Math.random(); + this.random = seedrandom5.alea(seedValue.toString()); + } + nextValue() { + if (!isNaN(this.nextVal)) { + const value = this.nextVal; + this.nextVal = NaN; + return value; + } + let resultX, resultY; + let isValid = false; + while (!isValid) { + let v1, v2, s; + do { + v1 = 2 * this.random() - 1; + v2 = 2 * this.random() - 1; + s = v1 * v1 + v2 * v2; + } while (s >= 1 || s === 0); + const mul3 = Math.sqrt(-2 * Math.log(s) / s); + resultX = this.mean + this.stdDev * v1 * mul3; + resultY = this.mean + this.stdDev * v2 * mul3; + if (!this.truncated || this.isValidTruncated(resultX)) { + isValid = true; + } + } + if (!this.truncated || this.isValidTruncated(resultY)) { + this.nextVal = this.convertValue(resultY); + } + return this.convertValue(resultX); + } + convertValue(value) { + if (this.dtype == null || this.dtype === "float32") { + return value; + } + return Math.round(value); + } + isValidTruncated(value) { + return value <= this.upper && value >= this.lower; + } +}; +var UniformRandom2 = class { + constructor(min10 = 0, max10 = 1, dtype, seed) { + this.canReturnFloat = () => this.dtype == null || this.dtype === "float32"; + this.min = min10; + this.range = max10 - min10; + this.dtype = dtype; + if (seed == null) { + seed = Math.random(); + } + if (typeof seed === "number") { + seed = seed.toString(); + } + if (!this.canReturnFloat() && this.range <= 1) { + throw new Error(`The difference between ${min10} - ${max10} <= 1 and dtype is not float`); + } + this.random = seedrandom5.alea(seed); + } + convertValue(value) { + if (this.canReturnFloat()) { + return value; + } + return Math.round(value); + } + nextValue() { + return this.convertValue(this.min + this.range * this.random()); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.js +function randomNormal_2(shape, mean6 = 0, stdDev = 1, dtype, seed) { + if (dtype != null && dtype === "bool") { + throw new Error(`Unsupported data type ${dtype}`); + } + const randGauss = new MPRandGauss2(mean6, stdDev, dtype, false, seed); + const res = buffer2(shape, dtype); + for (let i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); +} +var randomNormal4 = op2({ randomNormal_: randomNormal_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.js +function randomUniform_2(shape, minval = 0, maxval = 1, dtype = "float32", seed) { + const res = buffer2(shape, dtype); + const random = new UniformRandom2(minval, maxval, null, seed); + for (let i = 0; i < res.values.length; i++) { + res.values[i] = random.nextValue(); + } + return res.toTensor(); +} +var randomUniform3 = op2({ randomUniform_: randomUniform_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/range.js +function range6(start, stop, step8 = 1, dtype = "float32") { + if (step8 === 0) { + throw new Error("Cannot have a step of zero"); + } + const attrs = { start, stop, step: step8, dtype }; + return ENGINE2.runKernel(Range2, {}, attrs); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/real.js +function real_2(input3) { + const $input = convertToTensor2(input3, "input", "real"); + const inputs = { input: $input }; + return ENGINE2.runKernel(Real2, inputs); +} +var real4 = op2({ real_: real_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.js +function reciprocal_2(x) { + const $x = convertToTensor2(x, "x", "reciprocal"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Reciprocal2, inputs); +} +var reciprocal4 = op2({ reciprocal_: reciprocal_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/relu.js +function relu_2(x) { + const $x = convertToTensor2(x, "x", "relu"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Relu3, inputs); +} +var relu4 = op2({ relu_: relu_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js +function relu6_2(x) { + const $x = convertToTensor2(x, "x", "relu6"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Relu63, inputs); +} +var relu64 = op2({ relu6_: relu6_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js +function reverse_2(x, axis) { + const $x = convertToTensor2(x, "x", "reverse"); + const inputs = { x: $x }; + const attrs = { dims: axis }; + return ENGINE2.runKernel(Reverse2, inputs, attrs); +} +var reverse5 = op2({ reverse_: reverse_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/round.js +function round_2(x) { + const $x = convertToTensor2(x, "x", "round"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Round2, inputs); +} +var round6 = op2({ round_: round_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.js +function rsqrt_2(x) { + const $x = convertToTensor2(x, "x", "rsqrt"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Rsqrt2, inputs); +} +var rsqrt4 = op2({ rsqrt_: rsqrt_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.js +function scalar2(value, dtype) { + if ((isTypedArray2(value) && dtype !== "string" || Array.isArray(value)) && dtype !== "complex64") { + throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)"); + } + if (dtype === "string" && isTypedArray2(value) && !(value instanceof Uint8Array)) { + throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`."); + } + const shape = []; + const inferredShape = []; + return makeTensor2(value, shape, inferredShape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/selu.js +function selu_2(x) { + const $x = convertToTensor2(x, "x", "selu"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Selu3, inputs); +} +var selu4 = op2({ selu_: selu_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.js +function separableConv2d_2(x, depthwiseFilter, pointwiseFilter, strides, pad4, dilation = [1, 1], dataFormat = "NHWC") { + const $x = convertToTensor2(x, "x", "separableConv2d"); + const $depthwiseFilter = convertToTensor2(depthwiseFilter, "depthwiseFilter", "separableConv2d"); + const $pointwiseFilter = convertToTensor2(pointwiseFilter, "pointwiseFilter", "separableConv2d"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + if (dataFormat === "NCHW") { + throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported"); + } + assert3(x4D.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert3($depthwiseFilter.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but got rank ${$depthwiseFilter.rank}.`); + assert3($pointwiseFilter.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but got rank ${$depthwiseFilter.rank}.`); + assert3($pointwiseFilter.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${$pointwiseFilter.shape[0]}.`); + assert3($pointwiseFilter.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${$pointwiseFilter.shape[1]}.`); + const inChannels = $depthwiseFilter.shape[2]; + const channelMultiplier = $depthwiseFilter.shape[3]; + assert3($pointwiseFilter.shape[2] === inChannels * channelMultiplier, () => `Error in separableConv2d: the third dimension of pointwise filter must be ${inChannels * channelMultiplier}, but got ${$pointwiseFilter.shape[2]}.`); + const depthwise = depthwiseConv2d6(x4D, $depthwiseFilter, strides, pad4, dataFormat, dilation); + const pointwiseStride = 1; + const res = conv2d6(depthwise, $pointwiseFilter, pointwiseStride, "valid", dataFormat); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var separableConv2d3 = op2({ separableConv2d_: separableConv2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.js +async function setdiff1dAsync_2(x, y) { + const $x = convertToTensor2(x, "x", "setdiff1d"); + const $y = convertToTensor2(y, "y", "setdiff1d"); + assert3($x.dtype === $y.dtype, () => `x and y should have the same dtype, but got x (${$x.dtype}) and y (${$y.dtype}).`); + assert3($x.rank === 1, () => `x should be 1D tensor, but got x (${$x.shape}).`); + assert3($y.rank === 1, () => `y should be 1D tensor, but got y (${$y.shape}).`); + const xVals = await $x.data(); + const yVals = await $y.data(); + const ySet = new Set(yVals); + let outputSize2 = 0; + for (let i = 0; i < xVals.length; i++) { + if (!ySet.has(xVals[i])) { + outputSize2++; + } + } + const buffer3 = new TensorBuffer2([outputSize2], $x.dtype); + const indices = new TensorBuffer2([outputSize2], "int32"); + for (let i = 0, p3 = 0; i < xVals.length; i++) { + if (!ySet.has(xVals[i])) { + buffer3.values[p3] = xVals[i]; + indices.values[p3] = i; + p3++; + } + } + return [buffer3.toTensor(), indices.toTensor()]; +} +var setdiff1dAsync2 = setdiff1dAsync_2; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sign.js +function sign_2(x) { + const $x = convertToTensor2(x, "x", "sign"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Sign2, inputs); +} +var sign4 = op2({ sign_: sign_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sin.js +function sin_2(x) { + const $x = convertToTensor2(x, "x", "sin"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Sin2, inputs); +} +var sin4 = op2({ sin_: sin_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.js +function sinh_2(x) { + const $x = convertToTensor2(x, "x", "sinh"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Sinh2, inputs); +} +var sinh4 = op2({ sinh_: sinh_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.js +function slice1d_2(x, begin, size2) { + const $x = convertToTensor2(x, "x", "slice1d"); + assert3($x.rank === 1, () => `slice1d expects a rank-1 tensor, but got a rank-${$x.rank} tensor`); + return slice5($x, [begin], [size2]); +} +var slice1d2 = op2({ slice1d_: slice1d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.js +function slice2d_2(x, begin, size2) { + const $x = convertToTensor2(x, "x", "slice2d"); + assert3($x.rank === 2, () => `slice2d expects a rank-2 tensor, but got a rank-${$x.rank} tensor`); + return slice5($x, begin, size2); +} +var slice2d3 = op2({ slice2d_: slice2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.js +function slice3d_2(x, begin, size2) { + const $x = convertToTensor2(x, "x", "slice3d"); + assert3($x.rank === 3, () => `slice3d expects a rank-3 tensor, but got a rank-${$x.rank} tensor`); + return slice5($x, begin, size2); +} +var slice3d3 = op2({ slice3d_: slice3d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.js +function slice4d_2(x, begin, size2) { + const $x = convertToTensor2(x, "x", "slice4d"); + assert3($x.rank === 4, () => `slice4d expects a rank-4 tensor, but got a rank-${$x.rank} tensor`); + return slice5($x, begin, size2); +} +var slice4d3 = op2({ slice4d_: slice4d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js +function softmax_2(logits, dim = -1) { + const $logits = convertToTensor2(logits, "logits", "softmax", "float32"); + if (dim === -1) { + dim = $logits.rank - 1; + } + if (dim !== $logits.rank - 1) { + throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${$logits.rank} and dim was ${dim}`); + } + const inputs = { logits: $logits }; + const attrs = { dim }; + return ENGINE2.runKernel(Softmax4, inputs, attrs); +} +var softmax6 = op2({ softmax_: softmax_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.js +function fft_2(input3) { + assert3(input3.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${input3.dtype}.`); + const inputs = { input: input3 }; + return ENGINE2.runKernel(FFT2, inputs); +} +var fft4 = op2({ fft_: fft_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.js +function ifft_2(input3) { + assert3(input3.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${input3.dtype}.`); + const inputs = { input: input3 }; + return ENGINE2.runKernel(IFFT2, inputs); +} +var ifft4 = op2({ ifft_: ifft_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.js +function irfft_2(input3) { + const innerDimensionSize = input3.shape[input3.shape.length - 1]; + const batch = input3.size / innerDimensionSize; + let ret; + if (innerDimensionSize <= 2) { + const complexInput = reshape6(input3, [batch, innerDimensionSize]); + ret = ifft4(complexInput); + } else { + const outputShape = [batch, 2 * (innerDimensionSize - 1)]; + const realInput = reshape6(real4(input3), [batch, innerDimensionSize]); + const imagInput = reshape6(imag4(input3), [batch, innerDimensionSize]); + const realConjugate = reverse5(slice5(realInput, [0, 1], [batch, innerDimensionSize - 2]), 1); + const imagConjugate = mul2(reverse5(slice5(imagInput, [0, 1], [batch, innerDimensionSize - 2]), 1), scalar2(-1)); + const r = concat5([realInput, realConjugate], 1); + const i = concat5([imagInput, imagConjugate], 1); + const complexInput = reshape6(complex4(r, i), [outputShape[0], outputShape[1]]); + ret = ifft4(complexInput); + } + ret = real4(ret); + if (input3.rank === 3 && input3.shape[0] !== 0) { + const temp = ret; + const batch2 = input3.shape[0]; + ret = reshape6(ret, [batch2, ret.shape[0] / batch2, ret.shape[1]]); + temp.dispose(); + } + return ret; +} +var irfft2 = op2({ irfft_: irfft_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/split.js +function split_2(x, numOrSizeSplits, axis = 0) { + const $x = convertToTensor2(x, "x", "split"); + const inputs = { x: $x }; + const attr = { numOrSizeSplits, axis }; + return ENGINE2.runKernel(SplitV2, inputs, attr); +} +var split4 = op2({ split_: split_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.js +function rfft_2(input3, fftLength) { + assert3(input3.dtype === "float32", () => `The dtype for rfft() must be real value but got ${input3.dtype}`); + let innerDimensionSize = input3.shape[input3.shape.length - 1]; + const batch = input3.size / innerDimensionSize; + let adjustedInput; + if (fftLength != null && fftLength < innerDimensionSize) { + const begin = input3.shape.map((v) => 0); + const size2 = input3.shape.map((v) => v); + size2[input3.shape.length - 1] = fftLength; + adjustedInput = slice5(input3, begin, size2); + innerDimensionSize = fftLength; + } else if (fftLength != null && fftLength > innerDimensionSize) { + const zerosShape = input3.shape.map((v) => v); + zerosShape[input3.shape.length - 1] = fftLength - innerDimensionSize; + adjustedInput = concat5([input3, zeros4(zerosShape)], input3.shape.length - 1); + innerDimensionSize = fftLength; + } else { + adjustedInput = input3; + } + const zerosInput = zerosLike5(adjustedInput); + const complexInput = reshape6(complex4(adjustedInput, zerosInput), [batch, innerDimensionSize]); + const ret = fft4(complexInput); + const half = Math.floor(innerDimensionSize / 2) + 1; + const realValues = real4(ret); + const imagValues = imag4(ret); + const realComplexConjugate = split4(realValues, [half, innerDimensionSize - half], realValues.shape.length - 1); + const imagComplexConjugate = split4(imagValues, [half, innerDimensionSize - half], imagValues.shape.length - 1); + const outputShape = adjustedInput.shape.slice(); + outputShape[adjustedInput.shape.length - 1] = half; + return reshape6(complex4(realComplexConjugate[0], imagComplexConjugate[0]), outputShape); +} +var rfft2 = op2({ rfft_: rfft_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.js +function sqrt_2(x) { + const $x = convertToTensor2(x, "x", "sqrt"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Sqrt2, inputs); +} +var sqrt4 = op2({ sqrt_: sqrt_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.js +function squaredDifference_2(a, b) { + let $a = convertToTensor2(a, "a", "squaredDifference"); + let $b = convertToTensor2(b, "b", "squaredDifference"); + [$a, $b] = makeTypesMatch2($a, $b); + assertAndGetBroadcastShape2($a.shape, $b.shape); + const inputs = { a: $a, b: $b }; + const attrs = {}; + return ENGINE2.runKernel(SquaredDifference2, inputs, attrs); +} +var squaredDifference4 = op2({ squaredDifference_: squaredDifference_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js +function squeeze_2(x, axis) { + const $x = convertToTensor2(x, "x", "squeeze"); + return reshape6($x, squeezeShape2($x.shape, axis).newShape); +} +var squeeze2 = op2({ squeeze_: squeeze_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/stack.js +function stack_2(tensors, axis = 0) { + const $tensors = convertToTensorArray2(tensors, "tensors", "stack", "string_or_numeric"); + assert3($tensors.length >= 1, () => "Pass at least one tensor to tf.stack"); + if ($tensors.length > 0) { + assert3(axis <= $tensors[0].rank, () => "Axis must be <= rank of the tensor"); + } + const inputs = $tensors; + const attrs = { axis }; + return ENGINE2.runKernel(Pack2, inputs, attrs); +} +var stack2 = op2({ stack_: stack_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/step.js +function step_2(x, alpha = 0) { + const $x = convertToTensor2(x, "x", "step"); + const inputs = { x: $x }; + const attrs = { alpha }; + return ENGINE2.runKernel(Step2, inputs, attrs); +} +var step5 = op2({ step_: step_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js +function stridedSlice_2(x, begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { + const $x = convertToTensor2(x, "x", "stridedSlice", "string_or_numeric"); + const inputs = { x: $x }; + const attrs = { + begin, + end, + strides, + beginMask, + endMask, + ellipsisMask, + newAxisMask, + shrinkAxisMask + }; + return ENGINE2.runKernel(StridedSlice2, inputs, attrs); +} +var stridedSlice5 = op2({ stridedSlice_: stridedSlice_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tan.js +function tan_2(x) { + const $x = convertToTensor2(x, "x", "tan"); + const inputs = { x: $x }; + return ENGINE2.runKernel(Tan2, inputs); +} +var tan4 = op2({ tan_: tan_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.js +function tensor1d2(values, dtype) { + assertNonNull2(values); + const inferredShape = inferShape2(values, dtype); + if (inferredShape.length !== 1) { + throw new Error("tensor1d() requires values to be a flat/TypedArray"); + } + const shape = null; + return makeTensor2(values, shape, inferredShape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.js +function tensor2d2(values, shape, dtype) { + assertNonNull2(values); + if (shape != null && shape.length !== 2) { + throw new Error("tensor2d() requires shape to have two numbers"); + } + const inferredShape = inferShape2(values, dtype); + if (inferredShape.length !== 2 && inferredShape.length !== 1) { + throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray"); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray"); + } + return makeTensor2(values, shape, inferredShape, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js +function topk_2(x, k = 1, sorted = true) { + const $x = convertToTensor2(x, "x", "topk"); + if ($x.rank === 0) { + throw new Error("topk() expects the input to be of rank 1 or higher"); + } + const lastDim = $x.shape[$x.shape.length - 1]; + if (k < 0) { + throw new Error(`'k' passed to topk() must be >= 0 but got ${k}`); + } + if (k > lastDim) { + throw new Error(`'k' passed to topk() must be <= the last dimension (${lastDim}) but got ${k}`); + } + const inputs = { x: $x }; + const attrs = { k, sorted }; + const [values, indices] = ENGINE2.runKernel(TopK2, inputs, attrs); + return { values, indices }; +} +var topk3 = op2({ topk_: topk_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.js +function truncatedNormal_2(shape, mean6 = 0, stdDev = 1, dtype, seed) { + if (dtype != null && dtype === "bool") { + throw new Error(`Unsupported data type $ { dtype }`); + } + const randGauss = new MPRandGauss2(mean6, stdDev, dtype, true, seed); + const res = buffer2(shape, dtype); + for (let i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); +} +var truncatedNormal3 = op2({ truncatedNormal_: truncatedNormal_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/unique.js +function unique_2(x, axis = 0) { + const $x = convertToTensor2(x, "x", "unique", "string_or_numeric"); + assert3($x.rank > 0, () => "The input tensor must be at least 1D"); + const inputs = { x: $x }; + const attrs = { axis }; + const [values, indices] = ENGINE2.runKernel(Unique2, inputs, attrs); + return { values, indices }; +} +var unique5 = op2({ unique_: unique_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.js +function unsortedSegmentSum_2(x, segmentIds, numSegments) { + const $x = convertToTensor2(x, "x", "unsortedSegmentSum"); + const $segmentIds = convertToTensor2(segmentIds, "segmentIds", "unsortedSegmentSum", "int32"); + assert3(isInt2(numSegments), () => "numSegments must be of dtype int"); + const inputs = { x: $x, segmentIds: $segmentIds }; + const attrs = { numSegments }; + return ENGINE2.runKernel(UnsortedSegmentSum2, inputs, attrs); +} +var unsortedSegmentSum4 = op2({ unsortedSegmentSum_: unsortedSegmentSum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.js +function unstack_2(x, axis = 0) { + const $x = convertToTensor2(x, "x", "unstack", "string_or_numeric"); + assert3(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); + const inputs = { value: $x }; + const attrs = { axis }; + return ENGINE2.runKernel(Unpack2, inputs, attrs); +} +var unstack2 = op2({ unstack_: unstack_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/variable.js +function variable2(initialValue, trainable = true, name, dtype) { + return ENGINE2.makeVariable(initialValue, trainable, name, dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.js +function whereImpl4(condShape, condVals) { + const indices = []; + for (let i = 0; i < condVals.length; i++) { + if (condVals[i]) { + indices.push(i); + } + } + const inBuffer = buffer2(condShape, "int32"); + const out = buffer2([indices.length, condShape.length], "int32"); + for (let i = 0; i < indices.length; i++) { + const loc = inBuffer.indexToLoc(indices[i]); + const offset = i * condShape.length; + out.values.set(loc, offset); + } + return out.toTensor(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.js +async function whereAsync_2(condition) { + const $condition = convertToTensor2(condition, "condition", "whereAsync", "bool"); + const vals = await $condition.data(); + const res = whereImpl4($condition.shape, vals); + if (condition !== $condition) { + $condition.dispose(); + } + return res; +} +var whereAsync2 = whereAsync_2; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js +function norm_2(x, ord = "euclidean", axis = null, keepDims = false) { + x = convertToTensor2(x, "x", "norm"); + const norm3 = normImpl2(x, ord, axis); + let keepDimsShape = norm3.shape; + if (keepDims) { + const axes = parseAxisParam2(axis, x.shape); + keepDimsShape = expandShapeToKeepDim2(norm3.shape, axes); + } + return reshape6(norm3, keepDimsShape); +} +function normImpl2(x, p3, axis = null) { + if (x.rank === 0) { + return abs4(x); + } + if (x.rank !== 1 && axis === null) { + return normImpl2(reshape6(x, [-1]), p3, axis); + } + if (x.rank === 1 || typeof axis === "number" || Array.isArray(axis) && axis.length === 1) { + if (p3 === 1) { + return sum7(abs4(x), axis); + } + if (p3 === Infinity) { + return max6(abs4(x), axis); + } + if (p3 === -Infinity) { + return min6(abs4(x), axis); + } + if (p3 === "euclidean" || p3 === 2) { + return sqrt4(sum7(pow4(abs4(x), scalar2(2, "int32")), axis)); + } + throw new Error(`Error in norm: invalid ord value: ${p3}`); + } + if (Array.isArray(axis) && axis.length === 2) { + if (p3 === 1) { + return max6(sum7(abs4(x), axis[0]), axis[1] - 1); + } + if (p3 === Infinity) { + return max6(sum7(abs4(x), axis[1]), axis[0]); + } + if (p3 === -Infinity) { + return min6(sum7(abs4(x), axis[1]), axis[0]); + } + if (p3 === "fro" || p3 === "euclidean") { + return sqrt4(sum7(square4(x), axis)); + } + throw new Error(`Error in norm: invalid ord value: ${p3}`); + } + throw new Error(`Error in norm: invalid axis: ${axis}`); +} +var norm2 = op2({ norm_: norm_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.js +function scatterND_2(indices, updates, shape) { + const $indices = convertToTensor2(indices, "indices", "scatterND", "int32"); + const $updates = convertToTensor2(updates, "updates", "scatterND"); + validateInput3($updates, $indices, shape); + const inputs = { indices: $indices, updates: $updates }; + const attrs = { shape }; + return ENGINE2.runKernel(ScatterNd2, inputs, attrs); +} +var scatterND2 = op2({ scatterND_: scatterND_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense_util.js +function validateInput4(sparseIndices, sparseValues, outputShape, defaultValues) { + if (sparseIndices.dtype !== "int32") { + throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${sparseIndices.dtype}.`); + } + if (sparseIndices.rank > 2) { + throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${sparseIndices.shape}.`); + } + const numElems = sparseIndices.rank > 0 ? sparseIndices.shape[0] : 1; + const numDims = sparseIndices.rank > 1 ? sparseIndices.shape[1] : 1; + if (outputShape.length !== numDims) { + throw new Error(`outputShape has incorrect number of elements:, ${outputShape.length}, should be: ${numDims}.`); + } + const numValues = sparseValues.size; + if (!(sparseValues.rank === 0 || sparseValues.rank === 1 && numValues === numElems)) { + throw new Error(`sparseValues has incorrect shape ${sparseValues.shape}, should be [] or [${numElems}]`); + } + if (sparseValues.dtype !== defaultValues.dtype) { + throw new Error("sparseValues.dtype must match defaultValues.dtype"); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.js +function sparseToDense_2(sparseIndices, sparseValues, outputShape, defaultValue = 0) { + const $sparseIndices = convertToTensor2(sparseIndices, "sparseIndices", "sparseToDense", "int32"); + const $sparseValues = convertToTensor2(sparseValues, "sparseValues", "sparseToDense"); + const $defaultValue = convertToTensor2(defaultValue, "defaultValue", "sparseToDense", $sparseValues.dtype); + validateInput4($sparseIndices, $sparseValues, outputShape, $defaultValue); + const inputs = { + sparseIndices: $sparseIndices, + sparseValues: $sparseValues, + defaultValue: $defaultValue + }; + const attrs = { outputShape }; + return ENGINE2.runKernel(SparseToDense2, inputs, attrs); +} +var sparseToDense4 = op2({ sparseToDense_: sparseToDense_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.js +function gatherND_2(x, indices) { + const $indices = convertToTensor2(indices, "indices", "gatherND", "int32"); + const $x = convertToTensor2(x, "x", "gatherND", "string_or_numeric"); + const inputs = { params: $x, indices: $indices }; + return ENGINE2.runKernel(GatherNd2, inputs); +} +var gatherND2 = op2({ gatherND_: gatherND_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/dropout_util.js +function getNoiseShape2(x, noiseShape) { + if (noiseShape == null) { + return x.shape.slice(); + } + if (arraysEqual2(x.shape, noiseShape)) { + return noiseShape; + } + if (x.shape.length === noiseShape.length) { + const newDimension = []; + for (let i = 0; i < x.shape.length; i++) { + if (noiseShape[i] == null && x.shape[i] != null) { + newDimension.push(x.shape[i]); + } else { + newDimension.push(noiseShape[i]); + } + } + return newDimension; + } + return noiseShape; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.js +function dropout_2(x, rate, noiseShape, seed) { + const $x = convertToTensor2(x, "x", "dropout"); + assert3($x.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${$x.dtype} tensor instead.`); + assert3(rate >= 0 && rate < 1, () => `rate must be a float in the range [0, 1), but got ${rate}.`); + if (rate === 0) { + return x instanceof Tensor2 ? $x.clone() : $x; + } + const $noiseShape = getNoiseShape2($x, noiseShape); + const keepProb = 1 - rate; + const multiplier = div3(floor4(add6(randomUniform3($noiseShape, 0, 1, "float32", seed), keepProb)), keepProb); + return mul2($x, multiplier); +} +var dropout4 = op2({ dropout_: dropout_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.js +var fused_ops_exports2 = {}; +__export(fused_ops_exports2, { + conv2d: () => conv2d7, + depthwiseConv2d: () => depthwiseConv2d7, + matMul: () => matMul4 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_backprop_filter.js +function conv2DBackpropFilter_2(x, dy, filterShape, strides, pad4, dataFormat = "NHWC", dimRoundingMode) { + let x4D = x; + if (x.rank === 3) { + x4D = reshape6(x, [1, x.shape[0], x.shape[1], x.shape[2]]); + } + let dy4D = dy; + if (dy4D.rank === 3) { + dy4D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ${x4D.shape}.`); + assert3(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ${dy4D.shape}.`); + assert3(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ${filterShape}.`); + const inDepth = dataFormat === "NHWC" ? x4D.shape[3] : x4D.shape[1]; + const outDepth = dataFormat === "NHWC" ? dy4D.shape[3] : dy4D.shape[1]; + assert3(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must match input depth in filter (${filterShape[2]}.`); + assert3(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must match output depth for filter (${filterShape[3]}).`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { x: x4D, dy: dy4D }; + const attrs = { strides, pad: pad4, dataFormat, dimRoundingMode, filterShape }; + return ENGINE2.runKernel(Conv2DBackpropFilter2, inputs, attrs); +} +var conv2DBackpropFilter4 = op2({ conv2DBackpropFilter_: conv2DBackpropFilter_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.js +function getFusedDyActivation2(dy, y, activation2) { + if (activation2 == null || activation2 === "linear") { + return dy; + } + if (activation2 === "relu") { + return mul2(dy, step5(y)); + } + throw new Error(`Cannot compute gradient for fused activation ${activation2}.`); +} +function getFusedBiasGradient2(bias, dyActivation) { + let res = dyActivation; + const reduceAxes = getReductionAxes2(bias.shape, dyActivation.shape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, bias.shape); +} +function applyActivation3(x, activation2, preluActivationWeights, leakyreluAlpha) { + if (activation2 === "linear") { + return x; + } else if (activation2 === "relu") { + return relu4(x); + } else if (activation2 === "elu") { + return elu6(x); + } else if (activation2 === "relu6") { + return relu64(x); + } else if (activation2 === "prelu") { + return prelu6(x, preluActivationWeights); + } else if (activation2 === "leakyrelu") { + return leakyRelu5(x, leakyreluAlpha); + } else if (activation2 === "sigmoid") { + return sigmoid5(x); + } + throw new Error(`Unknown fused activation ${activation2}.`); +} +var shouldFuse2 = (gradientDepth, activation2) => { + const gradientMode = gradientDepth > 0; + return !gradientMode || activation2 === "linear"; +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.js +function fusedConv2d_2({ x, filter, strides, pad: pad4, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { + activation2 = activation2 || "linear"; + if (shouldFuse2(ENGINE2.state.gradientDepth, activation2) === false) { + let result = conv2d6(x, filter, strides, pad4, dataFormat, dilations, dimRoundingMode); + if (bias != null) { + result = add6(result, bias); + } + return applyActivation3(result, activation2, preluActivationWeights, leakyreluAlpha); + } + const $x = convertToTensor2(x, "x", "conv2d"); + const $filter = convertToTensor2(filter, "filter", "conv2d"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in fused conv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert3($filter.rank === 4, () => `Error in fused conv2d: filter must be rank 4, but got rank ${$filter.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + assert3(x4D.shape[3] === $filter.shape[2], () => `Error in conv2d: depth of input (${x4D.shape[3]}) must match input depth for filter ${$filter.shape[2]}.`); + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + assert3(dataFormat === "NHWC", () => `Error in conv2d: got dataFormat of ${dataFormat} but only NHWC is currently supported.`); + const convInfo = computeConv2DInfo2(x4D.shape, $filter.shape, strides, dilations, pad4, dimRoundingMode); + let $bias; + if (bias != null) { + $bias = convertToTensor2(bias, "bias", "fused conv2d"); + [$bias] = makeTypesMatch2($bias, $x); + assertAndGetBroadcastShape2(convInfo.outShape, $bias.shape); + } + let $preluActivationWeights; + if (preluActivationWeights != null) { + $preluActivationWeights = convertToTensor2(preluActivationWeights, "prelu weights", "fused conv2d"); + } + const grad2 = (dy, saved) => { + const [$filter2, x4D2, y, $bias2] = saved; + const dyActivation = getFusedDyActivation2(dy, y, activation2); + assert3(tupleValuesAreOne2(dilations), () => `Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); + const xDer = conv2DBackpropInput5(x4D2.shape, dyActivation, $filter2, strides, pad4); + const filterDer = conv2DBackpropFilter4(x4D2, dyActivation, $filter2.shape, strides, pad4); + const der = [xDer, filterDer]; + if ($bias2 != null) { + const biasDer = getFusedBiasGradient2($bias2, dyActivation); + der.push(biasDer); + } + return der; + }; + const inputs = { + x: x4D, + filter: $filter, + bias: $bias, + preluActivationWeights: $preluActivationWeights + }; + const attrs = { + strides, + pad: pad4, + dataFormat, + dilations, + dimRoundingMode, + activation: activation2, + leakyreluAlpha + }; + if (bias == null) { + const customOp = customGrad2((x4D2, filter2, save) => { + let res = ENGINE2.runKernel(FusedConv2D2, inputs, attrs); + save([filter2, x4D2, res]); + if (reshapedTo4D) { + res = reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return { value: res, gradFunc: grad2 }; + }); + return customOp(x4D, $filter); + } else { + const customOpWithBias = customGrad2((x4D2, filter2, bias2, save) => { + let res = ENGINE2.runKernel(FusedConv2D2, inputs, attrs); + save([filter2, x4D2, res, bias2]); + if (reshapedTo4D) { + res = reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return { value: res, gradFunc: grad2 }; + }); + return customOpWithBias(x4D, $filter, $bias); + } +} +var conv2d7 = op2({ fusedConv2d_: fusedConv2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_filter.js +function depthwiseConv2dNativeBackpropFilter_2(x, dy, filterShape, strides, pad4, dilations = [1, 1], dimRoundingMode) { + let x4D = x; + if (x.rank === 3) { + x4D = reshape6(x, [1, x.shape[0], x.shape[1], x.shape[2]]); + } + let dy4D = dy; + if (dy4D.rank === 3) { + dy4D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + const inputs = { x: x4D, dy: dy4D }; + const attrs = { strides, pad: pad4, dimRoundingMode, dilations, filterShape }; + return ENGINE2.runKernel(DepthwiseConv2dNativeBackpropFilter2, inputs, attrs); +} +var depthwiseConv2dNativeBackpropFilter4 = op2({ depthwiseConv2dNativeBackpropFilter_: depthwiseConv2dNativeBackpropFilter_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d_native_backprop_input.js +function depthwiseConv2dNativeBackpropInput_2(xShape, dy, filter, strides, pad4, dilations = [1, 1], dimRoundingMode) { + let dy4D = dy; + let reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + const inputs = { dy: dy4D, filter }; + const attrs = { strides, pad: pad4, dimRoundingMode, dilations, inputShape: xShape }; + const res = ENGINE2.runKernel(DepthwiseConv2dNativeBackpropInput2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var depthwiseConv2dNativeBackpropInput4 = op2({ depthwiseConv2dNativeBackpropInput_: depthwiseConv2dNativeBackpropInput_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.js +function fusedDepthwiseConv2d_2({ x, filter, strides, pad: pad4, dataFormat = "NHWC", dilations = [1, 1], dimRoundingMode, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { + if (shouldFuse2(ENGINE2.state.gradientDepth, activation2) === false) { + let result = depthwiseConv2d6(x, filter, strides, pad4, dataFormat, dilations, dimRoundingMode); + if (bias != null) { + result = add6(result, bias); + } + return applyActivation3(result, activation2, preluActivationWeights, leakyreluAlpha); + } + const $x = convertToTensor2(x, "x", "depthwiseConv2d"); + const $filter = convertToTensor2(filter, "filter", "depthwiseConv2d"); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape6($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert3(x4D.rank === 4, () => `Error in fused depthwiseConv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert3($filter.rank === 4, () => `Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${$filter.rank}.`); + assert3(x4D.shape[3] === $filter.shape[2], () => `Error in fused depthwiseConv2d: number of input channels (${x4D.shape[3]}) must match the inChannels dimension in filter ${$filter.shape[2]}.`); + if (dilations == null) { + dilations = [1, 1]; + } + assert3(eitherStridesOrDilationsAreOne2(strides, dilations), () => `Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const convInfo = computeConv2DInfo2(x4D.shape, $filter.shape, strides, dilations, pad4, dimRoundingMode, true); + let $bias; + if (bias != null) { + $bias = convertToTensor2(bias, "bias", "fused conv2d"); + [$bias] = makeTypesMatch2($bias, $x); + assertAndGetBroadcastShape2(convInfo.outShape, $bias.shape); + } + let $preluActivationWeights; + if (preluActivationWeights != null) { + $preluActivationWeights = convertToTensor2(preluActivationWeights, "prelu weights", "fused depthwiseConv2d"); + } + const grad2 = (dy, saved) => { + assert3(tupleValuesAreOne2(dilations), () => `Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${dilations}'`); + const [$filter2, x4D2, y, bias2] = saved; + const dyActivation = getFusedDyActivation2(dy, y, activation2); + const xDer = depthwiseConv2dNativeBackpropInput4(x4D2.shape, dyActivation, $filter2, strides, pad4, dilations, dimRoundingMode); + const filterDer = depthwiseConv2dNativeBackpropFilter4(x4D2, dyActivation, $filter2.shape, strides, pad4, dilations, dimRoundingMode); + if (bias2 != null) { + const biasDer = getFusedBiasGradient2($bias, dyActivation); + return [xDer, filterDer, biasDer]; + } + return [xDer, filterDer]; + }; + const inputs = { + x: x4D, + filter: $filter, + bias: $bias, + preluActivationWeights: $preluActivationWeights + }; + const attrs = { + strides, + pad: pad4, + dataFormat, + dilations, + dimRoundingMode, + activation: activation2, + leakyreluAlpha + }; + if (bias == null) { + const customOp = customGrad2((x4D2, filter2, save) => { + let res = ENGINE2.runKernel(FusedDepthwiseConv2D2, inputs, attrs); + save([filter2, x4D2, res]); + if (reshapedTo4D) { + res = reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return { value: res, gradFunc: grad2 }; + }); + return customOp(x4D, $filter); + } else { + const customOpWithBias = customGrad2((x4D2, filter2, bias2, save) => { + let res = ENGINE2.runKernel(FusedDepthwiseConv2D2, inputs, attrs); + save([filter2, x4D2, res, bias2]); + if (reshapedTo4D) { + res = reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return { value: res, gradFunc: grad2 }; + }); + return customOpWithBias(x4D, $filter, $bias); + } +} +var depthwiseConv2d7 = op2({ fusedDepthwiseConv2d_: fusedDepthwiseConv2d_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.js +function fusedMatMul_2({ a, b, transposeA = false, transposeB = false, bias, activation: activation2 = "linear", preluActivationWeights, leakyreluAlpha }) { + if (shouldFuse2(ENGINE2.state.gradientDepth, activation2) === false) { + let result = matMul3(a, b, transposeA, transposeB); + if (bias != null) { + result = add6(result, bias); + } + return applyActivation3(result, activation2, preluActivationWeights, leakyreluAlpha); + } + let $a = convertToTensor2(a, "a", "fused matMul"); + let $b = convertToTensor2(b, "b", "fused matMul"); + [$a, $b] = makeTypesMatch2($a, $b); + const innerShapeA = transposeA ? $a.shape[$a.rank - 2] : $a.shape[$a.rank - 1]; + const innerShapeB = transposeB ? $b.shape[$b.rank - 1] : $b.shape[$b.rank - 2]; + const outerShapeA = transposeA ? $a.shape[$a.rank - 1] : $a.shape[$a.rank - 2]; + const outerShapeB = transposeB ? $b.shape[$b.rank - 2] : $b.shape[$b.rank - 1]; + const outerDimsA = $a.shape.slice(0, -2); + const outerDimsB = $b.shape.slice(0, -2); + const batchDimA = sizeFromShape2(outerDimsA); + const batchDimB = sizeFromShape2(outerDimsB); + assert3($a.rank >= 2 && $b.rank >= 2 && $a.rank === $b.rank, () => `Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${$a.rank} and ${$b.rank}.`); + assert3(arraysEqual2(outerDimsA, outerDimsB), () => `Error in fused matMul: outer dimensions (${outerDimsA}) and (${outerDimsB}) of Tensors with shapes ${$a.shape} and ${$b.shape} must match.`); + assert3(innerShapeA === innerShapeB, () => `Error in fused matMul: inner shapes (${innerShapeA}) and (${innerShapeB}) of Tensors with shapes ${$a.shape} and ${$b.shape} and transposeA=${transposeA} and transposeB=${transposeB} must match.`); + const outShape = $a.shape.slice(0, -2).concat([outerShapeA, outerShapeB]); + const a3D = transposeA ? reshape6($a, [batchDimA, innerShapeA, outerShapeA]) : reshape6($a, [batchDimA, outerShapeA, innerShapeA]); + const b3D = transposeB ? reshape6($b, [batchDimB, outerShapeB, innerShapeB]) : reshape6($b, [batchDimB, innerShapeB, outerShapeB]); + let $bias; + if (bias != null) { + $bias = convertToTensor2(bias, "bias", "fused matMul"); + [$bias] = makeTypesMatch2($bias, $a); + assertAndGetBroadcastShape2(outShape, $bias.shape); + } + let $preluActivationWeights; + if (preluActivationWeights != null) { + $preluActivationWeights = convertToTensor2(preluActivationWeights, "prelu weights", "fused matMul"); + } + const grad2 = (dy, saved) => { + const [a3D2, b3D2, y, $bias2] = saved; + const dyActivation = getFusedDyActivation2(reshape6(dy, y.shape), y, activation2); + let aDer; + let bDer; + if (!transposeA && !transposeB) { + aDer = matMul3(dyActivation, b3D2, false, true); + bDer = matMul3(a3D2, dyActivation, true, false); + } else if (!transposeA && transposeB) { + aDer = matMul3(dyActivation, b3D2, false, false); + bDer = matMul3(dyActivation, a3D2, true, false); + } else if (transposeA && !transposeB) { + aDer = matMul3(b3D2, dyActivation, false, true); + bDer = matMul3(a3D2, dyActivation, false, false); + } else { + aDer = matMul3(b3D2, dyActivation, true, true); + bDer = matMul3(dyActivation, a3D2, true, true); + } + if (bias != null) { + const biasDer = getFusedBiasGradient2($bias2, dyActivation); + return [aDer, bDer, biasDer]; + } else { + return [aDer, bDer]; + } + }; + const inputs = { + a: a3D, + b: b3D, + bias: $bias, + preluActivationWeights: $preluActivationWeights + }; + const attrs = { transposeA, transposeB, activation: activation2, leakyreluAlpha }; + if (bias == null) { + const customOp = customGrad2((a3D2, b3D2, save) => { + const res = ENGINE2.runKernel(_FusedMatMul2, inputs, attrs); + save([a3D2, b3D2, res]); + return { value: reshape6(res, outShape), gradFunc: grad2 }; + }); + return customOp(a3D, b3D); + } else { + const customOpWithBias = customGrad2((a3D2, b3D2, $bias2, save) => { + const res = ENGINE2.runKernel(_FusedMatMul2, inputs, attrs); + save([a3D2, b3D2, res, $bias2]); + return { value: reshape6(res, outShape), gradFunc: grad2 }; + }); + return customOpWithBias(a3D, b3D, $bias); + } +} +var matMul4 = op2({ fusedMatMul_: fusedMatMul_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/crop_and_resize.js +function cropAndResize_2(image9, boxes, boxInd, cropSize, method = "bilinear", extrapolationValue = 0) { + const $image = convertToTensor2(image9, "image", "cropAndResize"); + const $boxes = convertToTensor2(boxes, "boxes", "cropAndResize", "float32"); + const $boxInd = convertToTensor2(boxInd, "boxInd", "cropAndResize", "int32"); + const numBoxes = $boxes.shape[0]; + assert3($image.rank === 4, () => `Error in cropAndResize: image must be rank 4,but got rank ${$image.rank}.`); + assert3($boxes.rank === 2 && $boxes.shape[1] === 4, () => `Error in cropAndResize: boxes must be have size [${numBoxes},4] but had shape ${$boxes.shape}.`); + assert3($boxInd.rank === 1 && $boxInd.shape[0] === numBoxes, () => `Error in cropAndResize: boxInd must be have size [${numBoxes}] but had shape ${$boxes.shape}.`); + assert3(cropSize.length === 2, () => `Error in cropAndResize: cropSize must be of length 2, but got length ${cropSize.length}.`); + assert3(cropSize[0] >= 1 && cropSize[1] >= 1, () => `cropSize must be atleast [1,1], but was ${cropSize}`); + assert3(method === "bilinear" || method === "nearest", () => `method must be bilinear or nearest, but was ${method}`); + const inputs = { image: $image, boxes: $boxes, boxInd: $boxInd }; + const attrs = { method, extrapolationValue, cropSize }; + const res = ENGINE2.runKernel(CropAndResize2, inputs, attrs); + return res; +} +var cropAndResize5 = op2({ cropAndResize_: cropAndResize_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/flip_left_right.js +function flipLeftRight_2(image9) { + const $image = convertToTensor2(image9, "image", "flipLeftRight", "float32"); + assert3($image.rank === 4, () => `Error in flipLeftRight: image must be rank 4,but got rank ${$image.rank}.`); + const inputs = { image: $image }; + const res = ENGINE2.runKernel(FlipLeftRight2, inputs, {}); + return res; +} +var flipLeftRight3 = op2({ flipLeftRight_: flipLeftRight_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/grayscale_to_rgb.js +function grayscaleToRGB_2(image9) { + const $image = convertToTensor2(image9, "image", "grayscaleToRGB"); + const lastDimsIdx = $image.rank - 1; + const lastDims = $image.shape[lastDimsIdx]; + assert3($image.rank >= 2, () => `Error in grayscaleToRGB: images must be at least rank 2, but got rank ${$image.rank}.`); + assert3(lastDims === 1, () => `Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${lastDims}.`); + const reps = new Array($image.rank); + reps.fill(1, 0, lastDimsIdx); + reps[lastDimsIdx] = 3; + return tile6($image, reps); +} +var grayscaleToRGB2 = op2({ grayscaleToRGB_: grayscaleToRGB_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/rotate_with_offset.js +function rotateWithOffset_2(image9, radians, fillValue = 0, center = 0.5) { + const $image = convertToTensor2(image9, "image", "rotateWithOffset", "float32"); + assert3($image.rank === 4, () => `Error in rotateWithOffset: image must be rank 4,but got rank ${$image.rank}.`); + const inputs = { image: $image }; + const attrs = { radians, fillValue, center }; + const res = ENGINE2.runKernel(RotateWithOffset2, inputs, attrs); + return res; +} +var rotateWithOffset3 = op2({ rotateWithOffset_: rotateWithOffset_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/nonmax_util.js +function nonMaxSuppSanityCheck2(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma) { + if (iouThreshold == null) { + iouThreshold = 0.5; + } + if (scoreThreshold == null) { + scoreThreshold = Number.NEGATIVE_INFINITY; + } + if (softNmsSigma == null) { + softNmsSigma = 0; + } + const numBoxes = boxes.shape[0]; + maxOutputSize = Math.min(maxOutputSize, numBoxes); + assert3(0 <= iouThreshold && iouThreshold <= 1, () => `iouThreshold must be in [0, 1], but was '${iouThreshold}'`); + assert3(boxes.rank === 2, () => `boxes must be a 2D tensor, but was of rank '${boxes.rank}'`); + assert3(boxes.shape[1] === 4, () => `boxes must have 4 columns, but 2nd dimension was ${boxes.shape[1]}`); + assert3(scores.rank === 1, () => "scores must be a 1D tensor"); + assert3(scores.shape[0] === numBoxes, () => `scores has incompatible shape with boxes. Expected ${numBoxes}, but was ${scores.shape[0]}`); + assert3(0 <= softNmsSigma && softNmsSigma <= 1, () => `softNmsSigma must be in [0, 1], but was '${softNmsSigma}'`); + return { maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression.js +function nonMaxSuppression_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppression"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppression"); + const inputs = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + const attrs = { maxOutputSize, iouThreshold, scoreThreshold }; + return ENGINE2.runKernel(NonMaxSuppressionV32, { boxes: $boxes, scores: $scores }, attrs); +} +var nonMaxSuppression2 = op2({ nonMaxSuppression_: nonMaxSuppression_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_util.js +function binaryInsert2(arr, element, comparator) { + const index = binarySearch2(arr, element, comparator); + const insertionPoint = index < 0 ? -(index + 1) : index; + arr.splice(insertionPoint, 0, element); +} +function binarySearch2(arr, target, comparator) { + return binarySearch_2(arr, target, comparator || defaultComparator2); +} +function defaultComparator2(a, b) { + return a > b ? 1 : a < b ? -1 : 0; +} +function binarySearch_2(arr, target, comparator) { + let left = 0; + let right = arr.length; + let middle = 0; + let found = false; + while (left < right) { + middle = left + (right - left >>> 1); + const compareResult = comparator(target, arr[middle]); + if (compareResult > 0) { + left = middle + 1; + } else { + right = middle; + found = !compareResult; + } + } + return found ? left : -left - 1; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.js +function nonMaxSuppressionV3Impl4(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + return nonMaxSuppressionImpl_2(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, 0); +} +function nonMaxSuppressionV4Impl4(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize) { + return nonMaxSuppressionImpl_2(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, 0, false, padToMaxOutputSize, true); +} +function nonMaxSuppressionV5Impl4(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma) { + return nonMaxSuppressionImpl_2(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma, true); +} +function nonMaxSuppressionImpl_2(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma, returnScoresTensor = false, padToMaxOutputSize = false, returnValidOutputs = false) { + const candidates = []; + for (let i = 0; i < scores.length; i++) { + if (scores[i] > scoreThreshold) { + candidates.push({ score: scores[i], boxIndex: i, suppressBeginIndex: 0 }); + } + } + candidates.sort(ascendingComparator2); + const scale4 = softNmsSigma > 0 ? -0.5 / softNmsSigma : 0; + const selectedIndices = []; + const selectedScores = []; + while (selectedIndices.length < maxOutputSize && candidates.length > 0) { + const candidate = candidates.pop(); + const { score: originalScore, boxIndex, suppressBeginIndex } = candidate; + if (originalScore < scoreThreshold) { + break; + } + let ignoreCandidate = false; + for (let j = selectedIndices.length - 1; j >= suppressBeginIndex; --j) { + const iou = intersectionOverUnion2(boxes, boxIndex, selectedIndices[j]); + if (iou >= iouThreshold) { + ignoreCandidate = true; + break; + } + candidate.score = candidate.score * suppressWeight2(iouThreshold, scale4, iou); + if (candidate.score <= scoreThreshold) { + break; + } + } + candidate.suppressBeginIndex = selectedIndices.length; + if (!ignoreCandidate) { + if (candidate.score === originalScore) { + selectedIndices.push(boxIndex); + selectedScores.push(candidate.score); + } else if (candidate.score > scoreThreshold) { + binaryInsert2(candidates, candidate, ascendingComparator2); + } + } + } + const validOutputs = selectedIndices.length; + const elemsToPad = maxOutputSize - validOutputs; + if (padToMaxOutputSize && elemsToPad > 0) { + selectedIndices.push(...new Array(elemsToPad).fill(0)); + selectedScores.push(...new Array(elemsToPad).fill(0)); + } + const result = { selectedIndices }; + if (returnScoresTensor) { + result["selectedScores"] = selectedScores; + } + if (returnValidOutputs) { + result["validOutputs"] = validOutputs; + } + return result; +} +function intersectionOverUnion2(boxes, i, j) { + const iCoord = boxes.subarray(i * 4, i * 4 + 4); + const jCoord = boxes.subarray(j * 4, j * 4 + 4); + const yminI = Math.min(iCoord[0], iCoord[2]); + const xminI = Math.min(iCoord[1], iCoord[3]); + const ymaxI = Math.max(iCoord[0], iCoord[2]); + const xmaxI = Math.max(iCoord[1], iCoord[3]); + const yminJ = Math.min(jCoord[0], jCoord[2]); + const xminJ = Math.min(jCoord[1], jCoord[3]); + const ymaxJ = Math.max(jCoord[0], jCoord[2]); + const xmaxJ = Math.max(jCoord[1], jCoord[3]); + const areaI = (ymaxI - yminI) * (xmaxI - xminI); + const areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ); + if (areaI <= 0 || areaJ <= 0) { + return 0; + } + const intersectionYmin = Math.max(yminI, yminJ); + const intersectionXmin = Math.max(xminI, xminJ); + const intersectionYmax = Math.min(ymaxI, ymaxJ); + const intersectionXmax = Math.min(xmaxI, xmaxJ); + const intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0) * Math.max(intersectionXmax - intersectionXmin, 0); + return intersectionArea / (areaI + areaJ - intersectionArea); +} +function suppressWeight2(iouThreshold, scale4, iou) { + const weight = Math.exp(scale4 * iou * iou); + return iou <= iouThreshold ? weight : 0; +} +function ascendingComparator2(c1, c2) { + return c1.score - c2.score || c1.score === c2.score && c2.boxIndex - c1.boxIndex; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression_async.js +async function nonMaxSuppressionAsync_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppressionAsync"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppressionAsync"); + const inputs = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + const boxesAndScores = await Promise.all([$boxes.data(), $scores.data()]); + const boxesVals = boxesAndScores[0]; + const scoresVals = boxesAndScores[1]; + const { selectedIndices } = nonMaxSuppressionV3Impl4(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + if ($boxes !== boxes) { + $boxes.dispose(); + } + if ($scores !== scores) { + $scores.dispose(); + } + return tensor1d2(selectedIndices, "int32"); +} +var nonMaxSuppressionAsync2 = nonMaxSuppressionAsync_2; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression_with_score.js +function nonMaxSuppressionWithScore_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY, softNmsSigma = 0) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppression"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppression"); + const params = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + maxOutputSize = params.maxOutputSize; + iouThreshold = params.iouThreshold; + scoreThreshold = params.scoreThreshold; + softNmsSigma = params.softNmsSigma; + const inputs = { boxes: $boxes, scores: $scores }; + const attrs = { maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma }; + const result = ENGINE2.runKernel(NonMaxSuppressionV52, inputs, attrs); + return { selectedIndices: result[0], selectedScores: result[1] }; +} +var nonMaxSuppressionWithScore2 = op2({ nonMaxSuppressionWithScore_: nonMaxSuppressionWithScore_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression_with_score_async.js +async function nonMaxSuppressionWithScoreAsync_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY, softNmsSigma = 0) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppressionAsync"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppressionAsync"); + const params = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + maxOutputSize = params.maxOutputSize; + iouThreshold = params.iouThreshold; + scoreThreshold = params.scoreThreshold; + softNmsSigma = params.softNmsSigma; + const boxesAndScores = await Promise.all([$boxes.data(), $scores.data()]); + const boxesVals = boxesAndScores[0]; + const scoresVals = boxesAndScores[1]; + const { selectedIndices, selectedScores } = nonMaxSuppressionV5Impl4(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + if ($boxes !== boxes) { + $boxes.dispose(); + } + if ($scores !== scores) { + $scores.dispose(); + } + return { + selectedIndices: tensor1d2(selectedIndices, "int32"), + selectedScores: tensor1d2(selectedScores) + }; +} +var nonMaxSuppressionWithScoreAsync2 = nonMaxSuppressionWithScoreAsync_2; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression_padded.js +function nonMaxSuppressionPadded_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY, padToMaxOutputSize = false) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppression"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppression"); + const params = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold, null); + const $maxOutputSize = params.maxOutputSize; + const $iouThreshold = params.iouThreshold; + const $scoreThreshold = params.scoreThreshold; + const inputs = { boxes: $boxes, scores: $scores }; + const attrs = { + maxOutputSize: $maxOutputSize, + iouThreshold: $iouThreshold, + scoreThreshold: $scoreThreshold, + padToMaxOutputSize + }; + const result = ENGINE2.runKernel(NonMaxSuppressionV42, inputs, attrs); + return { selectedIndices: result[0], validOutputs: result[1] }; +} +var nonMaxSuppressionPadded2 = op2({ nonMaxSuppressionPadded_: nonMaxSuppressionPadded_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/non_max_suppression_padded_async.js +async function nonMaxSuppressionPaddedAsync_2(boxes, scores, maxOutputSize, iouThreshold = 0.5, scoreThreshold = Number.NEGATIVE_INFINITY, padToMaxOutputSize = false) { + const $boxes = convertToTensor2(boxes, "boxes", "nonMaxSuppressionAsync"); + const $scores = convertToTensor2(scores, "scores", "nonMaxSuppressionAsync"); + const params = nonMaxSuppSanityCheck2($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold, null); + const $maxOutputSize = params.maxOutputSize; + const $iouThreshold = params.iouThreshold; + const $scoreThreshold = params.scoreThreshold; + const [boxesVals, scoresVals] = await Promise.all([$boxes.data(), $scores.data()]); + const { selectedIndices, validOutputs } = nonMaxSuppressionV4Impl4(boxesVals, scoresVals, $maxOutputSize, $iouThreshold, $scoreThreshold, padToMaxOutputSize); + if ($boxes !== boxes) { + $boxes.dispose(); + } + if ($scores !== scores) { + $scores.dispose(); + } + return { + selectedIndices: tensor1d2(selectedIndices, "int32"), + validOutputs: scalar2(validOutputs, "int32") + }; +} +var nonMaxSuppressionPaddedAsync2 = nonMaxSuppressionPaddedAsync_2; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_bilinear.js +function resizeBilinear_2(images, size2, alignCorners = false, halfPixelCenters = false) { + const $images = convertToTensor2(images, "images", "resizeBilinear"); + assert3($images.rank === 3 || $images.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got rank ${$images.rank}.`); + assert3(size2.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ${size2}.`); + assert3(halfPixelCenters === false || alignCorners === false, () => `Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.`); + let batchImages = $images; + let reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = reshape6($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); + } + const [] = size2; + const inputs = { images: batchImages }; + const attrs = { alignCorners, halfPixelCenters, size: size2 }; + const res = ENGINE2.runKernel(ResizeBilinear2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var resizeBilinear5 = op2({ resizeBilinear_: resizeBilinear_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/resize_nearest_neighbor.js +function resizeNearestNeighbor_2(images, size2, alignCorners = false, halfPixelCenters = false) { + const $images = convertToTensor2(images, "images", "resizeNearestNeighbor"); + assert3($images.rank === 3 || $images.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${$images.rank}.`); + assert3(size2.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ${size2}.`); + assert3($images.dtype === "float32" || $images.dtype === "int32", () => "`images` must have `int32` or `float32` as dtype"); + assert3(halfPixelCenters === false || alignCorners === false, () => `Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.`); + let batchImages = $images; + let reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = reshape6($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]); + } + const [] = size2; + const inputs = { images: batchImages }; + const attrs = { alignCorners, halfPixelCenters, size: size2 }; + const res = ENGINE2.runKernel(ResizeNearestNeighbor2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var resizeNearestNeighbor4 = op2({ resizeNearestNeighbor_: resizeNearestNeighbor_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/threshold.js +function threshold_2(image9, method = "binary", inverted = false, threshValue = 0.5) { + const $image = convertToTensor2(image9, "image", "threshold"); + const RED_INTENCITY_COEF = 0.2989; + const GREEN_INTENCITY_COEF = 0.587; + const BLUE_INTENCITY_COEF = 0.114; + const totalPixelsInImage = $image.shape[0] * $image.shape[1]; + let $threshold = mul2(tensor1d2([threshValue]), 255); + let r, g, b, grayscale; + assert3($image.rank === 3, () => `Error in threshold: image must be rank 3,but got rank ${$image.rank}.`); + assert3($image.shape[2] === 3 || $image.shape[2] === 1, () => `Error in threshold: image color channel must be equal to 3 or 1but got ${$image.shape[2]}.`); + assert3($image.dtype === "int32" || $image.dtype === "float32", () => `Error in dtype: image dtype must be int32 or float32,but got dtype ${$image.dtype}.`); + assert3(method === "otsu" || method === "binary", () => `Method must be binary or otsu, but was ${method}`); + if ($image.shape[2] === 3) { + [r, g, b] = split4($image, [1, 1, 1], -1); + const $r = mul2(r, RED_INTENCITY_COEF); + const $g = mul2(g, GREEN_INTENCITY_COEF); + const $b = mul2(b, BLUE_INTENCITY_COEF); + grayscale = add6(add6($r, $g), $b); + } else { + grayscale = image9; + } + if (method === "otsu") { + const $histogram = bincount4(cast6(round6(grayscale), "int32"), tensor2([]), 256); + $threshold = otsu2($histogram, totalPixelsInImage); + } + const invCondition = inverted ? lessEqual4(grayscale, $threshold) : greater5(grayscale, $threshold); + const result = cast6(mul2(invCondition, 255), "int32"); + return result; +} +function otsu2(histogram, total) { + let bestThresh = tensor1d2([-1]); + let bestInBetVar = tensor1d2([0]); + let cInBetVar = tensor1d2([0]); + let classFirst, classSecond, meanFirst, meanSec, weightForeground, weightBack; + for (let index = 0; index < histogram.size - 1; index++) { + classFirst = slice5(histogram, 0, index + 1); + classSecond = slice5(histogram, index + 1); + weightForeground = div3(sum7(classFirst), total); + weightBack = div3(sum7(classSecond), total); + const meanFirstDivA = sum7(mul2(classFirst, range6(0, classFirst.size))); + meanFirst = div3(meanFirstDivA, sum7(classFirst)); + const meanSecFill = fill5(classSecond.shape, classFirst.size); + const meanSecAdd = add6(range6(0, classSecond.size), meanSecFill); + const meanSecMul = mul2(classSecond, meanSecAdd); + meanSec = div3(sum7(meanSecMul), sum7(classSecond)); + const cInBetVarSubA = sub4(meanFirst, meanSec); + const cInBetVarSubB = sub4(meanFirst, meanSec); + const cInBetVarMul = mul2(weightForeground, weightBack); + cInBetVar = mul2(mul2(cInBetVarMul, cInBetVarSubA), cInBetVarSubB); + const condition = greater5(cInBetVar, bestInBetVar); + bestInBetVar = where2(condition, cInBetVar, bestInBetVar); + bestThresh = where2(condition, tensor1d2([index]), bestThresh); + } + return bestThresh; +} +var threshold3 = op2({ threshold_: threshold_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/image/transform.js +function transform_2(image9, transforms, interpolation = "nearest", fillMode = "constant", fillValue = 0, outputShape) { + const $image = convertToTensor2(image9, "image", "transform", "float32"); + const $transforms = convertToTensor2(transforms, "transforms", "transform", "float32"); + assert3($image.rank === 4, () => `Error in transform: image must be rank 4,but got rank ${$image.rank}.`); + assert3($transforms.rank === 2 && ($transforms.shape[0] === $image.shape[0] || $transforms.shape[0] === 1) && $transforms.shape[1] === 8, () => `Error in transform: Input transform should be batch x 8 or 1 x 8`); + assert3(outputShape == null || outputShape.length === 2, () => `Error in transform: outputShape must be [height, width] or null, but got ${outputShape}.`); + const inputs = { image: $image, transforms: $transforms }; + const attrs = { interpolation, fillMode, fillValue, outputShape }; + return ENGINE2.runKernel(Transform2, inputs, attrs); +} +var transform5 = op2({ transform_: transform_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/linalg/band_part.js +function bandPart_2(a, numLower, numUpper) { + assert3(numLower % 1 === 0, () => `bandPart(): numLower must be an integer, got ${numLower}.`); + assert3(numUpper % 1 === 0, () => `bandPart(): numUpper must be an integer, got ${numUpper}.`); + const $a = convertToTensor2(a, "a", "bandPart"); + assert3($a.rank >= 2, () => `bandPart(): Rank must be at least 2, got ${$a.rank}.`); + const shape = $a.shape; + const [M, N] = $a.shape.slice(-2); + if (!(numLower <= M)) { + throw new Error(`bandPart(): numLower (${numLower}) must not be greater than the number of rows (${M}).`); + } + if (!(numUpper <= N)) { + throw new Error(`bandPart(): numUpper (${numUpper}) must not be greater than the number of columns (${N}).`); + } + if (numLower < 0) { + numLower = M; + } + if (numUpper < 0) { + numUpper = N; + } + const i = reshape6(range6(0, M, 1, "int32"), [-1, 1]); + const j = range6(0, N, 1, "int32"); + const ij = sub4(i, j); + const inBand = logicalAnd4(lessEqual4(ij, scalar2(+numLower, "int32")), greaterEqual4(ij, scalar2(-numUpper, "int32"))); + const zero = zeros4([M, N], $a.dtype); + return reshape6(stack2(unstack2(reshape6($a, [-1, M, N])).map((mat) => where2(inBand, mat, zero))), shape); +} +var bandPart2 = op2({ bandPart_: bandPart_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/linalg/gram_schmidt.js +function gramSchmidt_2(xs) { + let inputIsTensor2D; + if (Array.isArray(xs)) { + inputIsTensor2D = false; + assert3(xs != null && xs.length > 0, () => "Gram-Schmidt process: input must not be null, undefined, or empty"); + const dim = xs[0].shape[0]; + for (let i = 1; i < xs.length; ++i) { + assert3(xs[i].shape[0] === dim, () => `Gram-Schmidt: Non-unique lengths found in the input vectors: (${xs[i].shape[0]} vs. ${dim})`); + } + } else { + inputIsTensor2D = true; + xs = split4(xs, xs.shape[0], 0).map((x) => squeeze2(x, [0])); + } + assert3(xs.length <= xs[0].shape[0], () => `Gram-Schmidt: Number of vectors (${xs.length}) exceeds number of dimensions (${xs[0].shape[0]}).`); + const ys = []; + const xs1d = xs; + for (let i = 0; i < xs.length; ++i) { + ys.push(ENGINE2.tidy(() => { + let x = xs1d[i]; + if (i > 0) { + for (let j = 0; j < i; ++j) { + const proj = mul2(sum7(mul2(ys[j], x)), ys[j]); + x = sub4(x, proj); + } + } + return div3(x, norm2(x, "euclidean")); + })); + } + if (inputIsTensor2D) { + return stack2(ys, 0); + } else { + return ys; + } +} +var gramSchmidt2 = op2({ gramSchmidt_: gramSchmidt_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/linalg/qr.js +function qr_2(x, fullMatrices = false) { + assert3(x.rank >= 2, () => `qr() requires input tensor to have a rank >= 2, but got rank ${x.rank}`); + if (x.rank === 2) { + return qr2d2(x, fullMatrices); + } else { + const outerDimsProd = x.shape.slice(0, x.shape.length - 2).reduce((value, prev) => value * prev); + const x2ds = unstack2(reshape6(x, [ + outerDimsProd, + x.shape[x.shape.length - 2], + x.shape[x.shape.length - 1] + ]), 0); + const q2ds = []; + const r2ds = []; + x2ds.forEach((x2d) => { + const [q2d, r2d] = qr2d2(x2d, fullMatrices); + q2ds.push(q2d); + r2ds.push(r2d); + }); + const q = reshape6(stack2(q2ds, 0), x.shape); + const r = reshape6(stack2(r2ds, 0), x.shape); + return [q, r]; + } +} +function qr2d2(x, fullMatrices = false) { + return ENGINE2.tidy(() => { + assert3(x.shape.length === 2, () => `qr2d() requires a 2D Tensor, but got a ${x.shape.length}D Tensor.`); + const m = x.shape[0]; + const n = x.shape[1]; + let q = eye2(m); + let r = clone2(x); + const one2D = tensor2d2([[1]], [1, 1]); + let w = clone2(one2D); + const iters = m >= n ? n : m; + for (let j = 0; j < iters; ++j) { + const rTemp = r; + const wTemp = w; + const qTemp = q; + [w, r, q] = ENGINE2.tidy(() => { + const rjEnd1 = slice5(r, [j, j], [m - j, 1]); + const normX = norm2(rjEnd1); + const rjj = slice5(r, [j, j], [1, 1]); + const s = where2(greater5(rjj, 0), tensor2d2([[-1]]), tensor2d2([[1]])); + const u1 = sub4(rjj, mul2(s, normX)); + const wPre = div3(rjEnd1, u1); + if (wPre.shape[0] === 1) { + w = clone2(one2D); + } else { + w = concat5([ + one2D, + slice5(wPre, [1, 0], [wPre.shape[0] - 1, wPre.shape[1]]) + ], 0); + } + const tau = neg4(div3(matMul3(s, u1), normX)); + const rjEndAll = slice5(r, [j, 0], [m - j, n]); + const tauTimesW = mul2(tau, w); + const wT = transpose5(w); + if (j === 0) { + r = sub4(rjEndAll, matMul3(tauTimesW, matMul3(wT, rjEndAll))); + } else { + const rTimesTau = sub4(rjEndAll, matMul3(tauTimesW, matMul3(wT, rjEndAll))); + r = concat5([slice5(r, [0, 0], [j, n]), rTimesTau], 0); + } + const tawTimesWT = transpose5(tauTimesW); + const qAllJEnd = slice5(q, [0, j], [m, q.shape[1] - j]); + if (j === 0) { + q = sub4(qAllJEnd, matMul3(matMul3(qAllJEnd, w), tawTimesWT)); + } else { + const qTimesTau = sub4(qAllJEnd, matMul3(matMul3(qAllJEnd, w), tawTimesWT)); + q = concat5([slice5(q, [0, 0], [m, j]), qTimesTau], 1); + } + return [w, r, q]; + }); + dispose2([rTemp, wTemp, qTemp]); + } + if (!fullMatrices && m > n) { + q = slice5(q, [0, 0], [m, n]); + r = slice5(r, [0, 0], [n, n]); + } + return [q, r]; + }); +} +var qr2 = op2({ qr_: qr_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_fill_empty_rows.js +function sparseFillEmptyRows_2(indices, values, denseShape, defaultValue) { + const $indices = convertToTensor2(indices, "indices", "sparseFillEmptyRows"); + const $values = convertToTensor2(values, "values", "sparseFillEmptyRows"); + const $denseShape = convertToTensor2(denseShape, "denseShape", "sparseFillEmptyRows"); + const $defaultValue = convertToTensor2(defaultValue, "defaultValue", "sparseFillEmptyRows", $values.dtype); + if ($indices.rank !== 2) { + throw new Error(`Indices should be Tensor2D but received shape + ${$indices.shape}`); + } + if ($values.rank !== 1) { + throw new Error(`Values should be Tensor1D but received shape ${$values.shape}`); + } + if ($denseShape.rank !== 1) { + throw new Error(`Dense shape should be Tensor1D but received shape ${$denseShape.shape}`); + } + if ($defaultValue.rank !== 0) { + throw new Error(`Default value should be a scalar but received shape ${$defaultValue.shape}`); + } + const inputs = { + indices: $indices, + values: $values, + denseShape: $denseShape, + defaultValue: $defaultValue + }; + const result = ENGINE2.runKernel(SparseFillEmptyRows2, inputs); + return { + outputIndices: result[0], + outputValues: result[1], + emptyRowIndicator: result[2], + reverseIndexMap: result[3] + }; +} +var sparseFillEmptyRows4 = op2({ sparseFillEmptyRows_: sparseFillEmptyRows_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_reshape.js +function sparseReshape_2(inputIndices, inputShape, newShape) { + const $inputIndices = convertToTensor2(inputIndices, "inputIndices", "sparseReshape"); + const $inputShape = convertToTensor2(inputShape, "inputShape", "sparseReshape"); + const $newShape = convertToTensor2(newShape, "newShape", "sparseReshape"); + if ($inputIndices.rank !== 2) { + throw new Error(`Input indices should be Tensor2D but received shape + ${$inputIndices.shape}`); + } + if ($inputShape.rank !== 1) { + throw new Error(`Input shape should be Tensor1D but received shape ${$inputShape.shape}`); + } + if ($newShape.rank !== 1) { + throw new Error(`New shape should be Tensor1D but received shape ${$newShape.shape}`); + } + const inputs = { + inputIndices: $inputIndices, + inputShape: $inputShape, + newShape: $newShape + }; + const result = ENGINE2.runKernel(SparseReshape2, inputs); + return { outputIndices: result[0], outputShape: result[1] }; +} +var sparseReshape4 = op2({ sparseReshape_: sparseReshape_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_segment_mean.js +function sparseSegmentMean_2(data, indices, segmentIds) { + const $data = convertToTensor2(data, "data", "sparseSegmentMean"); + const $indices = convertToTensor2(indices, "indices", "sparseSegmentMean"); + const $segmentIds = convertToTensor2(segmentIds, "segmentIds", "sparseSegmentMean"); + if ($data.rank < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if ($indices.rank !== 1) { + throw new Error(`Indices should be Tensor1D but received shape + ${$indices.shape}`); + } + if ($segmentIds.rank !== 1) { + throw new Error(`Segment ids should be Tensor1D but received shape + ${$segmentIds.shape}`); + } + const inputs = { + data: $data, + indices: $indices, + segmentIds: $segmentIds + }; + return ENGINE2.runKernel(SparseSegmentMean2, inputs); +} +var sparseSegmentMean4 = op2({ sparseSegmentMean_: sparseSegmentMean_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_segment_sum.js +function sparseSegmentSum_2(data, indices, segmentIds) { + const $data = convertToTensor2(data, "data", "sparseSegmentSum"); + const $indices = convertToTensor2(indices, "indices", "sparseSegmentSum"); + const $segmentIds = convertToTensor2(segmentIds, "segmentIds", "sparseSegmentSum"); + if ($data.rank < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if ($indices.rank !== 1) { + throw new Error(`Indices should be Tensor1D but received shape + ${$indices.shape}`); + } + if ($segmentIds.rank !== 1) { + throw new Error(`Segment ids should be Tensor1D but received shape + ${$segmentIds.shape}`); + } + const inputs = { + data: $data, + indices: $indices, + segmentIds: $segmentIds + }; + return ENGINE2.runKernel(SparseSegmentSum2, inputs); +} +var sparseSegmentSum4 = op2({ sparseSegmentSum_: sparseSegmentSum_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/string/string_n_grams.js +function stringNGrams_2(data, dataSplits, separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences) { + const $data = convertToTensor2(data, "data", "stringNGrams", "string"); + if ($data.dtype !== "string") { + throw new Error("Data must be of datatype string"); + } + if ($data.shape.length !== 1) { + throw new Error(`Data must be a vector, saw: ${$data.shape}`); + } + const $dataSplits = convertToTensor2(dataSplits, "dataSplits", "stringNGrams"); + if ($dataSplits.dtype !== "int32") { + throw new Error("Data splits must be of datatype int32"); + } + const attrs = { + separator, + nGramWidths, + leftPad, + rightPad: rightPad3, + padWidth, + preserveShortSequences + }; + const inputs = { data: $data, dataSplits: $dataSplits }; + const result = ENGINE2.runKernel(StringNGrams2, inputs, attrs); + return { nGrams: result[0], nGramsSplits: result[1] }; +} +var stringNGrams4 = op2({ stringNGrams_: stringNGrams_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/string/string_split.js +function stringSplit_2(input3, delimiter, skipEmpty = true) { + const $input = convertToTensor2(input3, "input", "stringSplit", "string"); + const $delimiter = convertToTensor2(delimiter, "delimiter", "stringSplit", "string"); + if ($input.rank !== 1) { + throw new Error(`Input should be Tensor1D but received shape ${$input.shape}`); + } + if ($delimiter.rank !== 0) { + throw new Error(`Delimiter should be a scalar but received shape ${$delimiter.shape}`); + } + const attrs = { skipEmpty }; + const inputs = { input: $input, delimiter: $delimiter }; + const result = ENGINE2.runKernel(StringSplit2, inputs, attrs); + return { indices: result[0], values: result[1], shape: result[2] }; +} +var stringSplit4 = op2({ stringSplit_: stringSplit_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/string/string_to_hash_bucket_fast.js +function stringToHashBucketFast_2(input3, numBuckets) { + const $input = convertToTensor2(input3, "input", "stringToHashBucketFast", "string"); + const attrs = { numBuckets }; + if (numBuckets <= 0) { + throw new Error(`Number of buckets must be at least 1`); + } + const inputs = { input: $input }; + return ENGINE2.runKernel(StringToHashBucketFast2, inputs, attrs); +} +var stringToHashBucketFast4 = op2({ stringToHashBucketFast_: stringToHashBucketFast_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js +var image3 = { + flipLeftRight: flipLeftRight3, + grayscaleToRGB: grayscaleToRGB2, + resizeNearestNeighbor: resizeNearestNeighbor4, + resizeBilinear: resizeBilinear5, + rotateWithOffset: rotateWithOffset3, + cropAndResize: cropAndResize5, + nonMaxSuppression: nonMaxSuppression2, + nonMaxSuppressionAsync: nonMaxSuppressionAsync2, + nonMaxSuppressionWithScore: nonMaxSuppressionWithScore2, + nonMaxSuppressionWithScoreAsync: nonMaxSuppressionWithScoreAsync2, + nonMaxSuppressionPadded: nonMaxSuppressionPadded2, + nonMaxSuppressionPaddedAsync: nonMaxSuppressionPaddedAsync2, + threshold: threshold3, + transform: transform5 +}; +var linalg2 = { + bandPart: bandPart2, + gramSchmidt: gramSchmidt2, + qr: qr2 +}; +var sparse2 = { + sparseFillEmptyRows: sparseFillEmptyRows4, + sparseReshape: sparseReshape4, + sparseSegmentMean: sparseSegmentMean4, + sparseSegmentSum: sparseSegmentSum4 +}; +var string2 = { + stringNGrams: stringNGrams4, + stringSplit: stringSplit4, + stringToHashBucketFast: stringToHashBucketFast4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js +var Optimizer2 = class extends Serializable2 { + minimize(f, returnCost = false, varList) { + const { value, grads: grads2 } = this.computeGradients(f, varList); + if (varList != null) { + const gradArray = varList.map((v) => ({ name: v.name, tensor: grads2[v.name] })); + this.applyGradients(gradArray); + } else { + this.applyGradients(grads2); + } + dispose2(grads2); + if (returnCost) { + return value; + } else { + value.dispose(); + return null; + } + } + get iterations() { + if (this.iterations_ == null) { + this.iterations_ = 0; + } + return this.iterations_; + } + incrementIterations() { + this.iterations_ = this.iterations + 1; + } + computeGradients(f, varList) { + return variableGrads2(f, varList); + } + dispose() { + if (this.iterations_ != null) { + dispose2(this.iterations_); + } + } + async saveIterations() { + if (this.iterations_ == null) { + this.iterations_ = 0; + } + return { + name: "iter", + tensor: scalar2(this.iterations_, "int32") + }; + } + async getWeights() { + throw new Error("getWeights() is not implemented for this optimizer yet."); + } + async setWeights(weightValues) { + throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`); + } + async extractIterations(weightValues) { + this.iterations_ = (await weightValues[0].tensor.data())[0]; + return weightValues.slice(1); + } +}; +Object.defineProperty(Optimizer2, Symbol.hasInstance, { + value: (instance) => { + return instance.minimize != null && instance.computeGradients != null && instance.applyGradients != null; + } +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js +var AdadeltaOptimizer2 = class extends Optimizer2 { + constructor(learningRate, rho, epsilon5 = null) { + super(); + this.learningRate = learningRate; + this.rho = rho; + this.epsilon = epsilon5; + this.accumulatedGrads = []; + this.accumulatedUpdates = []; + if (epsilon5 == null) { + this.epsilon = ENGINE2.backend.epsilon(); + } + } + applyGradients(variableGradients) { + const variableNames = Array.isArray(variableGradients) ? variableGradients.map((item) => item.name) : Object.keys(variableGradients); + variableNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + const trainable = false; + if (this.accumulatedGrads[i] == null) { + this.accumulatedGrads[i] = { + originalName: `${name}/accum_grad`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + if (this.accumulatedUpdates[i] == null) { + this.accumulatedUpdates[i] = { + originalName: `${name}/accum_var`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const accumulatedGrad = this.accumulatedGrads[i].variable; + const accumulatedUpdate = this.accumulatedUpdates[i].variable; + tidy2(() => { + const newAccumulatedGrad = add6(mul2(accumulatedGrad, this.rho), mul2(square4(gradient), 1 - this.rho)); + const updates = mul2(div3(sqrt4(add6(accumulatedUpdate, this.epsilon)), sqrt4(add6(accumulatedGrad, this.epsilon))), gradient); + const newAccumulatedUpdate = add6(mul2(accumulatedUpdate, this.rho), mul2(square4(updates), 1 - this.rho)); + accumulatedGrad.assign(newAccumulatedGrad); + accumulatedUpdate.assign(newAccumulatedUpdate); + const newValue = add6(mul2(updates, -this.learningRate), value); + value.assign(newValue); + }); + }); + this.incrementIterations(); + } + dispose() { + if (this.accumulatedUpdates != null) { + dispose2(this.accumulatedGrads.map((v) => v.variable)); + dispose2(this.accumulatedUpdates.map((v) => v.variable)); + } + } + async getWeights() { + const variables = [...this.accumulatedGrads, ...this.accumulatedUpdates]; + return [await this.saveIterations()].concat(variables.map((v) => ({ name: v.originalName, tensor: v.variable }))); + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + const variableCount = weightValues.length / 2; + const trainable = false; + this.accumulatedGrads = weightValues.slice(0, variableCount).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + this.accumulatedUpdates = weightValues.slice(variableCount, variableCount * 2).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + } + getConfig() { + return { + "learningRate": this.learningRate, + "rho": this.rho, + "epsilon": this.epsilon + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["rho"], config3["epsilon"]); + } +}; +AdadeltaOptimizer2.className = "Adadelta"; +registerClass2(AdadeltaOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js +var AdagradOptimizer2 = class extends Optimizer2 { + constructor(learningRate, initialAccumulatorValue = 0.1) { + super(); + this.learningRate = learningRate; + this.initialAccumulatorValue = initialAccumulatorValue; + this.accumulatedGrads = []; + } + applyGradients(variableGradients) { + const variableNames = Array.isArray(variableGradients) ? variableGradients.map((item) => item.name) : Object.keys(variableGradients); + variableNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + if (this.accumulatedGrads[i] == null) { + const trainable = false; + this.accumulatedGrads[i] = { + originalName: `${name}/accumulator`, + variable: tidy2(() => fill5(value.shape, this.initialAccumulatorValue).variable(trainable)) + }; + } + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const accumulatedGrad = this.accumulatedGrads[i].variable; + tidy2(() => { + const newAccumulatedGrad = add6(accumulatedGrad, square4(gradient)); + accumulatedGrad.assign(newAccumulatedGrad); + const newValue = add6(mul2(div3(gradient, sqrt4(add6(newAccumulatedGrad, ENGINE2.backend.epsilon()))), -this.learningRate), value); + value.assign(newValue); + }); + }); + this.incrementIterations(); + } + dispose() { + if (this.accumulatedGrads != null) { + dispose2(this.accumulatedGrads.map((v) => v.variable)); + } + } + async getWeights() { + return [await this.saveIterations()].concat(this.accumulatedGrads.map((v) => ({ name: v.originalName, tensor: v.variable }))); + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + const trainable = false; + this.accumulatedGrads = weightValues.map((v) => ({ originalName: v.name, variable: v.tensor.variable(trainable) })); + } + getConfig() { + return { + "learningRate": this.learningRate, + "initialAccumulatorValue": this.initialAccumulatorValue + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["initialAccumulatorValue"]); + } +}; +AdagradOptimizer2.className = "Adagrad"; +registerClass2(AdagradOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js +var AdamOptimizer2 = class extends Optimizer2 { + constructor(learningRate, beta1, beta2, epsilon5 = null) { + super(); + this.learningRate = learningRate; + this.beta1 = beta1; + this.beta2 = beta2; + this.epsilon = epsilon5; + this.accumulatedFirstMoment = []; + this.accumulatedSecondMoment = []; + tidy2(() => { + this.accBeta1 = scalar2(beta1).variable(); + this.accBeta2 = scalar2(beta2).variable(); + }); + if (epsilon5 == null) { + this.epsilon = ENGINE2.backend.epsilon(); + } + } + applyGradients(variableGradients) { + const varNames = Array.isArray(variableGradients) ? variableGradients.map((v) => v.name) : Object.keys(variableGradients); + tidy2(() => { + const oneMinusAccBeta1 = sub4(1, this.accBeta1); + const oneMinusAccBeta2 = sub4(1, this.accBeta2); + varNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + const trainable = false; + if (this.accumulatedFirstMoment[i] == null) { + this.accumulatedFirstMoment[i] = { + originalName: `${name}/m`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + if (this.accumulatedSecondMoment[i] == null) { + this.accumulatedSecondMoment[i] = { + originalName: `${name}/v`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const firstMoment = this.accumulatedFirstMoment[i].variable; + const secondMoment = this.accumulatedSecondMoment[i].variable; + const newFirstMoment = add6(mul2(firstMoment, this.beta1), mul2(gradient, 1 - this.beta1)); + const newSecondMoment = add6(mul2(secondMoment, this.beta2), mul2(square4(gradient), 1 - this.beta2)); + const biasCorrectedFirstMoment = div3(newFirstMoment, oneMinusAccBeta1); + const biasCorrectedSecondMoment = div3(newSecondMoment, oneMinusAccBeta2); + firstMoment.assign(newFirstMoment); + secondMoment.assign(newSecondMoment); + const newValue = add6(mul2(div3(biasCorrectedFirstMoment, add6(sqrt4(biasCorrectedSecondMoment), this.epsilon)), -this.learningRate), value); + value.assign(newValue); + }); + this.accBeta1.assign(mul2(this.accBeta1, this.beta1)); + this.accBeta2.assign(mul2(this.accBeta2, this.beta2)); + }); + this.incrementIterations(); + } + dispose() { + this.accBeta1.dispose(); + this.accBeta2.dispose(); + if (this.accumulatedFirstMoment != null) { + dispose2(this.accumulatedFirstMoment.map((v) => v.variable)); + } + if (this.accumulatedSecondMoment != null) { + dispose2(this.accumulatedSecondMoment.map((v) => v.variable)); + } + } + async getWeights() { + const variables = [...this.accumulatedFirstMoment, ...this.accumulatedSecondMoment]; + return [await this.saveIterations()].concat(variables.map((v) => ({ name: v.originalName, tensor: v.variable }))); + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + tidy2(() => { + this.accBeta1.assign(pow4(this.beta1, this.iterations_ + 1)); + this.accBeta2.assign(pow4(this.beta2, this.iterations_ + 1)); + }); + const variableCount = weightValues.length / 2; + const trainable = false; + this.accumulatedFirstMoment = weightValues.slice(0, variableCount).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + this.accumulatedSecondMoment = weightValues.slice(variableCount, variableCount * 2).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + } + getConfig() { + return { + "learningRate": this.learningRate, + "beta1": this.beta1, + "beta2": this.beta2, + "epsilon": this.epsilon + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["beta1"], config3["beta2"], config3["epsilon"]); + } +}; +AdamOptimizer2.className = "Adam"; +registerClass2(AdamOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js +var AdamaxOptimizer2 = class extends Optimizer2 { + constructor(learningRate, beta1, beta2, epsilon5 = null, decay = 0) { + super(); + this.learningRate = learningRate; + this.beta1 = beta1; + this.beta2 = beta2; + this.epsilon = epsilon5; + this.decay = decay; + this.accumulatedFirstMoment = []; + this.accumulatedWeightedInfNorm = []; + tidy2(() => { + this.iteration = scalar2(0).variable(); + this.accBeta1 = scalar2(beta1).variable(); + }); + if (epsilon5 == null) { + this.epsilon = ENGINE2.backend.epsilon(); + } + } + applyGradients(variableGradients) { + const variableNames = Array.isArray(variableGradients) ? variableGradients.map((item) => item.name) : Object.keys(variableGradients); + tidy2(() => { + const oneMinusAccBeta1 = sub4(1, this.accBeta1); + const lr = div3(-this.learningRate, add6(mul2(this.iteration, this.decay), 1)); + variableNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + const trainable = false; + if (this.accumulatedFirstMoment[i] == null) { + this.accumulatedFirstMoment[i] = { + originalName: `${name}/m`, + variable: zerosLike5(value).variable(trainable) + }; + } + if (this.accumulatedWeightedInfNorm[i] == null) { + this.accumulatedWeightedInfNorm[i] = { + originalName: `${name}/v`, + variable: zerosLike5(value).variable(trainable) + }; + } + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const firstMoment = this.accumulatedFirstMoment[i].variable; + const weightedInfNorm = this.accumulatedWeightedInfNorm[i].variable; + const newFirstMoment = add6(mul2(firstMoment, this.beta1), mul2(gradient, 1 - this.beta1)); + const ut0 = mul2(weightedInfNorm, this.beta2); + const ut1 = abs4(gradient); + const newWeightedInfNorm = maximum5(ut0, ut1); + firstMoment.assign(newFirstMoment); + weightedInfNorm.assign(newWeightedInfNorm); + const newValue = add6(mul2(div3(lr, oneMinusAccBeta1), div3(newFirstMoment, add6(newWeightedInfNorm, this.epsilon))), value); + value.assign(newValue); + }); + this.iteration.assign(add6(this.iteration, 1)); + this.accBeta1.assign(mul2(this.accBeta1, this.beta1)); + }); + this.incrementIterations(); + } + dispose() { + this.accBeta1.dispose(); + this.iteration.dispose(); + if (this.accumulatedFirstMoment != null) { + dispose2(this.accumulatedFirstMoment.map((v) => v.variable)); + } + if (this.accumulatedWeightedInfNorm != null) { + dispose2(this.accumulatedWeightedInfNorm.map((v) => v.variable)); + } + } + async getWeights() { + throw new Error("getWeights() is not implemented for Adamax yet."); + } + async setWeights(weightValues) { + throw new Error("setWeights() is not implemented for Adamax yet."); + } + getConfig() { + return { + "learningRate": this.learningRate, + "beta1": this.beta1, + "beta2": this.beta2, + "epsilon": this.epsilon, + "decay": this.decay + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["beta1"], config3["beta2"], config3["epsilon"], config3["decay"]); + } +}; +AdamaxOptimizer2.className = "Adamax"; +registerClass2(AdamaxOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js +var SGDOptimizer2 = class extends Optimizer2 { + constructor(learningRate) { + super(); + this.learningRate = learningRate; + this.setLearningRate(learningRate); + } + applyGradients(variableGradients) { + const varNames = Array.isArray(variableGradients) ? variableGradients.map((v) => v.name) : Object.keys(variableGradients); + varNames.forEach((name, i) => { + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const value = ENGINE2.registeredVariables[name]; + tidy2(() => { + const newValue = add6(mul2(this.c, gradient), value); + value.assign(newValue); + }); + }); + this.incrementIterations(); + } + setLearningRate(learningRate) { + this.learningRate = learningRate; + if (this.c != null) { + this.c.dispose(); + } + this.c = keep2(scalar2(-learningRate)); + } + dispose() { + this.c.dispose(); + } + async getWeights() { + return [await this.saveIterations()]; + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + if (weightValues.length !== 0) { + throw new Error("SGD optimizer does not have settable weights."); + } + } + getConfig() { + return { "learningRate": this.learningRate }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"]); + } +}; +SGDOptimizer2.className = "SGD"; +registerClass2(SGDOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js +var MomentumOptimizer2 = class extends SGDOptimizer2 { + constructor(learningRate, momentum, useNesterov = false) { + super(learningRate); + this.learningRate = learningRate; + this.momentum = momentum; + this.useNesterov = useNesterov; + this.accumulations = []; + this.m = scalar2(this.momentum); + } + applyGradients(variableGradients) { + const variableNames = Array.isArray(variableGradients) ? variableGradients.map((item) => item.name) : Object.keys(variableGradients); + variableNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + if (this.accumulations[i] == null) { + const trainable = false; + this.accumulations[i] = { + originalName: `${name}/momentum`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + const accumulation = this.accumulations[i].variable; + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + tidy2(() => { + let newValue; + const newAccumulation = add6(mul2(this.m, accumulation), gradient); + if (this.useNesterov) { + newValue = add6(mul2(this.c, add6(gradient, mul2(newAccumulation, this.m))), value); + } else { + newValue = add6(mul2(this.c, newAccumulation), value); + } + accumulation.assign(newAccumulation); + value.assign(newValue); + }); + }); + this.incrementIterations(); + } + dispose() { + this.m.dispose(); + if (this.accumulations != null) { + dispose2(this.accumulations.map((v) => v.variable)); + } + } + setMomentum(momentum) { + this.momentum = momentum; + } + async getWeights() { + return [await this.saveIterations()].concat(this.accumulations.map((v) => ({ name: v.originalName, tensor: v.variable }))); + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + const trainable = false; + this.accumulations = weightValues.map((v) => ({ originalName: v.name, variable: v.tensor.variable(trainable) })); + } + getConfig() { + return { + "learningRate": this.learningRate, + "momentum": this.momentum, + "useNesterov": this.useNesterov + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["momentum"], config3["useNesterov"]); + } +}; +MomentumOptimizer2.className = "Momentum"; +registerClass2(MomentumOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js +var RMSPropOptimizer2 = class extends Optimizer2 { + constructor(learningRate, decay = 0.9, momentum = 0, epsilon5 = null, centered = false) { + super(); + this.learningRate = learningRate; + this.decay = decay; + this.momentum = momentum; + this.epsilon = epsilon5; + this.accumulatedMeanSquares = []; + this.accumulatedMoments = []; + this.accumulatedMeanGrads = []; + this.centered = centered; + if (epsilon5 == null) { + this.epsilon = ENGINE2.backend.epsilon(); + } + if (learningRate == null) { + throw new Error(`learningRate for RMSPropOptimizer must be defined.`); + } + } + applyGradients(variableGradients) { + const variableNames = Array.isArray(variableGradients) ? variableGradients.map((item) => item.name) : Object.keys(variableGradients); + variableNames.forEach((name, i) => { + const value = ENGINE2.registeredVariables[name]; + const trainable = false; + if (this.accumulatedMeanSquares[i] == null) { + this.accumulatedMeanSquares[i] = { + originalName: `${name}/rms`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + if (this.accumulatedMoments[i] == null) { + this.accumulatedMoments[i] = { + originalName: `${name}/momentum`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + if (this.accumulatedMeanGrads[i] == null && this.centered) { + this.accumulatedMeanGrads[i] = { + originalName: `${name}/mg`, + variable: tidy2(() => zerosLike5(value).variable(trainable)) + }; + } + const gradient = Array.isArray(variableGradients) ? variableGradients[i].tensor : variableGradients[name]; + if (gradient == null) { + return; + } + const accumulatedMeanSquare = this.accumulatedMeanSquares[i].variable; + const accumulatedMoments = this.accumulatedMoments[i].variable; + tidy2(() => { + const newAccumulatedMeanSquare = add6(mul2(accumulatedMeanSquare, this.decay), mul2(square4(gradient), 1 - this.decay)); + if (this.centered) { + const accumulatedMeanGrad = this.accumulatedMeanGrads[i].variable; + const newAccumulatedMeanGrad = add6(mul2(accumulatedMeanGrad, this.decay), mul2(gradient, 1 - this.decay)); + const gradContribution = div3(mul2(gradient, this.learningRate), sqrt4(sub4(newAccumulatedMeanSquare, add6(square4(newAccumulatedMeanGrad), this.epsilon)))); + const newAccumulatedMoments = add6(mul2(accumulatedMoments, this.momentum), gradContribution); + accumulatedMeanSquare.assign(newAccumulatedMeanSquare); + accumulatedMeanGrad.assign(newAccumulatedMeanGrad); + accumulatedMoments.assign(newAccumulatedMoments); + const newValue = sub4(value, newAccumulatedMoments); + value.assign(newValue); + } else { + const newAccumulatedMeanSquare2 = add6(mul2(accumulatedMeanSquare, this.decay), mul2(square4(gradient), 1 - this.decay)); + const newAccumulatedMoments = add6(mul2(accumulatedMoments, this.momentum), div3(mul2(gradient, this.learningRate), sqrt4(add6(newAccumulatedMeanSquare2, this.epsilon)))); + accumulatedMeanSquare.assign(newAccumulatedMeanSquare2); + accumulatedMoments.assign(newAccumulatedMoments); + const newValue = sub4(value, newAccumulatedMoments); + value.assign(newValue); + } + }); + }); + this.incrementIterations(); + } + dispose() { + if (this.accumulatedMeanSquares != null) { + dispose2(this.accumulatedMeanSquares.map((v) => v.variable)); + } + if (this.accumulatedMeanGrads != null && this.centered) { + dispose2(this.accumulatedMeanGrads.map((v) => v.variable)); + } + if (this.accumulatedMoments != null) { + dispose2(this.accumulatedMoments.map((v) => v.variable)); + } + } + async getWeights() { + const variables = [...this.accumulatedMeanSquares, ...this.accumulatedMoments]; + if (this.centered) { + variables.push(...this.accumulatedMeanGrads); + } + return [await this.saveIterations()].concat(variables.map((v) => ({ name: v.originalName, tensor: v.variable }))); + } + async setWeights(weightValues) { + weightValues = await this.extractIterations(weightValues); + const variableCount = this.centered ? weightValues.length / 3 : weightValues.length / 2; + const trainable = false; + this.accumulatedMeanSquares = weightValues.slice(0, variableCount).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + this.accumulatedMoments = weightValues.slice(variableCount, variableCount * 2).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + if (this.centered) { + this.accumulatedMeanGrads = weightValues.slice(variableCount * 2, variableCount * 3).map((v) => ({ + originalName: v.name, + variable: v.tensor.variable(trainable) + })); + } + } + getConfig() { + return { + "learningRate": this.learningRate, + "decay": this.decay, + "momentum": this.momentum, + "epsilon": this.epsilon, + "centered": this.centered + }; + } + static fromConfig(cls, config3) { + return new cls(config3["learningRate"], config3["decay"], config3["momentum"], config3["epsilon"], config3["centered"]); + } +}; +RMSPropOptimizer2.className = "RMSProp"; +registerClass2(RMSPropOptimizer2); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js +var OptimizerConstructors2 = class { + static sgd(learningRate) { + return new SGDOptimizer2(learningRate); + } + static momentum(learningRate, momentum, useNesterov = false) { + return new MomentumOptimizer2(learningRate, momentum, useNesterov); + } + static rmsprop(learningRate, decay = 0.9, momentum = 0, epsilon5 = null, centered = false) { + return new RMSPropOptimizer2(learningRate, decay, momentum, epsilon5, centered); + } + static adam(learningRate = 1e-3, beta1 = 0.9, beta2 = 0.999, epsilon5 = null) { + return new AdamOptimizer2(learningRate, beta1, beta2, epsilon5); + } + static adadelta(learningRate = 1e-3, rho = 0.95, epsilon5 = null) { + return new AdadeltaOptimizer2(learningRate, rho, epsilon5); + } + static adamax(learningRate = 2e-3, beta1 = 0.9, beta2 = 0.999, epsilon5 = null, decay = 0) { + return new AdamaxOptimizer2(learningRate, beta1, beta2, epsilon5, decay); + } + static adagrad(learningRate, initialAccumulatorValue = 0.1) { + return new AdagradOptimizer2(learningRate, initialAccumulatorValue); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/train.js +var train2 = { + sgd: OptimizerConstructors2.sgd, + momentum: OptimizerConstructors2.momentum, + adadelta: OptimizerConstructors2.adadelta, + adagrad: OptimizerConstructors2.adagrad, + rmsprop: OptimizerConstructors2.rmsprop, + adamax: OptimizerConstructors2.adamax, + adam: OptimizerConstructors2.adam +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/browser_util.js +var delayCallback2 = (() => { + if (typeof requestAnimationFrame !== "undefined") { + return requestAnimationFrame; + } else if (typeof setImmediate !== "undefined") { + return setImmediate; + } + return (f) => f(); +})(); +function nextFrame2() { + return new Promise((resolve) => delayCallback2(() => resolve())); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js +var backend_util_exports2 = {}; +__export(backend_util_exports2, { + ERF_A1: () => ERF_A12, + ERF_A2: () => ERF_A22, + ERF_A3: () => ERF_A32, + ERF_A4: () => ERF_A42, + ERF_A5: () => ERF_A52, + ERF_P: () => ERF_P2, + PARALLELIZE_THRESHOLD: () => PARALLELIZE_THRESHOLD2, + SELU_SCALE: () => SELU_SCALE2, + SELU_SCALEALPHA: () => SELU_SCALEALPHA2, + applyActivation: () => applyActivation3, + assertAndGetBroadcastShape: () => assertAndGetBroadcastShape2, + assertAxesAreInnerMostDims: () => assertAxesAreInnerMostDims2, + assertParamsConsistent: () => assertParamsConsistent2, + assignToTypedArray: () => assignToTypedArray2, + axesAreInnerMostDims: () => axesAreInnerMostDims2, + calculateShapes: () => calculateShapes2, + checkEinsumDimSizes: () => checkEinsumDimSizes2, + combineLocations: () => combineLocations2, + complexWithEvenIndex: () => complexWithEvenIndex2, + complexWithOddIndex: () => complexWithOddIndex2, + computeConv2DInfo: () => computeConv2DInfo2, + computeConv3DInfo: () => computeConv3DInfo2, + computeDefaultPad: () => computeDefaultPad2, + computeDilation2DInfo: () => computeDilation2DInfo2, + computeOptimalWindowSize: () => computeOptimalWindowSize2, + computeOutAndReduceShapes: () => computeOutAndReduceShapes2, + computeOutShape: () => computeOutShape6, + computePool2DInfo: () => computePool2DInfo2, + computePool3DInfo: () => computePool3DInfo2, + convertConv2DDataFormat: () => convertConv2DDataFormat2, + decodeEinsumEquation: () => decodeEinsumEquation2, + eitherStridesOrDilationsAreOne: () => eitherStridesOrDilationsAreOne2, + expandShapeToKeepDim: () => expandShapeToKeepDim2, + exponent: () => exponent2, + exponents: () => exponents2, + fromStringArrayToUint8: () => fromStringArrayToUint82, + fromUint8ToStringArray: () => fromUint8ToStringArray2, + getAxesPermutation: () => getAxesPermutation2, + getBroadcastDims: () => getBroadcastDims3, + getComplexWithIndex: () => getComplexWithIndex2, + getEinsumComputePath: () => getEinsumComputePath2, + getEinsumPermutation: () => getEinsumPermutation2, + getFusedBiasGradient: () => getFusedBiasGradient2, + getFusedDyActivation: () => getFusedDyActivation2, + getImageCenter: () => getImageCenter2, + getInnerMostAxes: () => getInnerMostAxes2, + getPermuted: () => getPermuted2, + getReductionAxes: () => getReductionAxes2, + getReshaped: () => getReshaped2, + getReshapedPermuted: () => getReshapedPermuted2, + getSliceBeginCoords: () => getSliceBeginCoords2, + getSliceSize: () => getSliceSize2, + getUndoAxesPermutation: () => getUndoAxesPermutation2, + isIdentityPermutation: () => isIdentityPermutation2, + log: () => log3, + mergeRealAndImagArrays: () => mergeRealAndImagArrays2, + prepareAndValidate: () => prepareAndValidate2, + prepareSplitSize: () => prepareSplitSize2, + segment_util: () => segment_util_exports2, + shouldFuse: () => shouldFuse2, + slice_util: () => slice_util_exports2, + splitRealAndImagArrays: () => splitRealAndImagArrays2, + tupleValuesAreOne: () => tupleValuesAreOne2, + upcastType: () => upcastType2, + validateInput: () => validateInput3, + validateUpdateShape: () => validateUpdateShape2, + warn: () => warn2 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js +function assertParamsConsistent2(shapes, axis) { + const rank = shapes[0].length; + shapes.forEach((shape, i) => { + assert3(shape.length === rank, () => `Error in concat${rank}D: rank of tensors[${i}] must be the same as the rank of the rest (${rank})`); + }); + assert3(axis >= 0 && axis < rank, () => `Error in concat${rank}D: axis must be between 0 and ${rank - 1}.`); + const firstShape = shapes[0]; + shapes.forEach((shape, i) => { + for (let r = 0; r < rank; r++) { + assert3(r === axis || shape[r] === firstShape[r], () => `Error in concat${rank}D: Shape of tensors[${i}] (${shape}) does not match the shape of the rest (${firstShape}) along the non-concatenated axis ${i}.`); + } + }); +} +function computeOutShape6(shapes, axis) { + const outputShape = shapes[0].slice(); + for (let i = 1; i < shapes.length; i++) { + outputShape[axis] += shapes[i][axis]; + } + return outputShape; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js +var PARALLELIZE_THRESHOLD2 = 30; +function computeOptimalWindowSize2(inSize) { + if (inSize <= PARALLELIZE_THRESHOLD2) { + return inSize; + } + return nearestDivisor2(inSize, Math.floor(Math.sqrt(inSize))); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.js +function getImageCenter2(center, imageHeight, imageWidth) { + const centerX = imageWidth * (typeof center === "number" ? center : center[0]); + const centerY = imageHeight * (typeof center === "number" ? center : center[1]); + return [centerX, centerY]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js +function getReshaped2(inputShape, blockShape, prod8, batchToSpace = true) { + let reshaped = []; + if (batchToSpace) { + reshaped = reshaped.concat(blockShape.slice(0)); + reshaped.push(inputShape[0] / prod8); + reshaped = reshaped.concat(inputShape.slice(1)); + } else { + reshaped = reshaped.concat(inputShape[0]); + const spatialLength = blockShape.length; + for (let i = 0; i < spatialLength; ++i) { + reshaped = reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]); + } + reshaped = reshaped.concat(inputShape.slice(spatialLength + 1)); + } + return reshaped; +} +function getPermuted2(reshapedRank, blockShapeRank, batchToSpace = true) { + const permuted = []; + if (batchToSpace) { + permuted.push(blockShapeRank); + for (let i = blockShapeRank + 1; i < reshapedRank; ++i) { + if (i <= 2 * blockShapeRank) { + permuted.push(i); + permuted.push(i - (blockShapeRank + 1)); + } else { + permuted.push(i); + } + } + } else { + const permutedBeforeBatch = []; + const permutedAfterBatch = []; + for (let i = 1; i < reshapedRank; ++i) { + if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) { + permutedAfterBatch.push(i); + } else { + permutedBeforeBatch.push(i); + } + } + permuted.push(...permutedBeforeBatch); + permuted.push(0); + permuted.push(...permutedAfterBatch); + } + return permuted; +} +function getReshapedPermuted2(inputShape, blockShape, prod8, batchToSpace = true) { + const reshapedPermuted = []; + if (batchToSpace) { + reshapedPermuted.push(inputShape[0] / prod8); + } else { + reshapedPermuted.push(inputShape[0] * prod8); + } + for (let i = 1; i < inputShape.length; ++i) { + if (i <= blockShape.length) { + if (batchToSpace) { + reshapedPermuted.push(blockShape[i - 1] * inputShape[i]); + } else { + reshapedPermuted.push(inputShape[i] / blockShape[i - 1]); + } + } else { + reshapedPermuted.push(inputShape[i]); + } + } + return reshapedPermuted; +} +function getSliceBeginCoords2(crops, blockShape) { + const sliceBeginCoords = [0]; + for (let i = 0; i < blockShape; ++i) { + sliceBeginCoords.push(crops[i][0]); + } + return sliceBeginCoords; +} +function getSliceSize2(uncroppedShape, crops, blockShape) { + const sliceSize = uncroppedShape.slice(0, 1); + for (let i = 0; i < blockShape; ++i) { + sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]); + } + return sliceSize; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js +var SELU_SCALEALPHA2 = 1.7580993408473768; +var SELU_SCALE2 = 1.0507009873554805; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js +var ERF_P2 = 0.3275911; +var ERF_A12 = 0.254829592; +var ERF_A22 = -0.284496736; +var ERF_A32 = 1.421413741; +var ERF_A42 = -1.453152027; +var ERF_A52 = 1.061405429; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.js +function mergeRealAndImagArrays2(real7, imag7) { + if (real7.length !== imag7.length) { + throw new Error(`Cannot merge real and imag arrays of different lengths. real:${real7.length}, imag: ${imag7.length}.`); + } + const result = new Float32Array(real7.length * 2); + for (let i = 0; i < result.length; i += 2) { + result[i] = real7[i / 2]; + result[i + 1] = imag7[i / 2]; + } + return result; +} +function splitRealAndImagArrays2(complex7) { + const real7 = new Float32Array(complex7.length / 2); + const imag7 = new Float32Array(complex7.length / 2); + for (let i = 0; i < complex7.length; i += 2) { + real7[i / 2] = complex7[i]; + imag7[i / 2] = complex7[i + 1]; + } + return { real: real7, imag: imag7 }; +} +function complexWithEvenIndex2(complex7) { + const len = Math.ceil(complex7.length / 4); + const real7 = new Float32Array(len); + const imag7 = new Float32Array(len); + for (let i = 0; i < complex7.length; i += 4) { + real7[Math.floor(i / 4)] = complex7[i]; + imag7[Math.floor(i / 4)] = complex7[i + 1]; + } + return { real: real7, imag: imag7 }; +} +function complexWithOddIndex2(complex7) { + const len = Math.floor(complex7.length / 4); + const real7 = new Float32Array(len); + const imag7 = new Float32Array(len); + for (let i = 2; i < complex7.length; i += 4) { + real7[Math.floor(i / 4)] = complex7[i]; + imag7[Math.floor(i / 4)] = complex7[i + 1]; + } + return { real: real7, imag: imag7 }; +} +function getComplexWithIndex2(complex7, index) { + const real7 = complex7[index * 2]; + const imag7 = complex7[index * 2 + 1]; + return { real: real7, imag: imag7 }; +} +function assignToTypedArray2(data, real7, imag7, index) { + data[index * 2] = real7; + data[index * 2 + 1] = imag7; +} +function exponents2(n, inverse) { + const real7 = new Float32Array(n / 2); + const imag7 = new Float32Array(n / 2); + for (let i = 0; i < Math.ceil(n / 2); i++) { + const x = (inverse ? 2 : -2) * Math.PI * (i / n); + real7[i] = Math.cos(x); + imag7[i] = Math.sin(x); + } + return { real: real7, imag: imag7 }; +} +function exponent2(k, n, inverse) { + const x = (inverse ? 2 : -2) * Math.PI * (k / n); + const real7 = Math.cos(x); + const imag7 = Math.sin(x); + return { real: real7, imag: imag7 }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.js +var ARROW2 = "->"; +var ARROW_REGEX2 = /->/g; +var COMMA2 = ","; +var ELLIPSIS2 = "..."; +function decodeEinsumEquation2(equation, numTensors) { + equation = equation.replace(/\s/g, ""); + const numArrows = (equation.length - equation.replace(ARROW_REGEX2, "").length) / ARROW2.length; + if (numArrows < 1) { + throw new Error("Equations without an arrow are not supported."); + } else if (numArrows > 1) { + throw new Error(`Equation must contain exactly one arrow ("${ARROW2}").`); + } + const [inputString, outputString] = equation.split(ARROW2); + assert3(inputString.indexOf(ELLIPSIS2) === -1, () => `The ellipsis notation ("${ELLIPSIS2}") is not supported yet.`); + const inputTerms = inputString.split(COMMA2); + const numInputs = inputTerms.length; + if (numTensors !== numInputs) { + throw new Error(`Expected ${numInputs} input tensors, received ${numTensors}`); + } + if (numInputs > 2) { + throw new Error("Support for more than 2 input tensors is not implemented yet."); + } + const allDims = []; + for (let i = 0; i < outputString.length; ++i) { + const dimName = outputString[i]; + if (!inputTerms.some((inputTerm) => inputTerm.indexOf(dimName) !== -1)) { + throw new Error(`Output subscripts contain the label ${dimName} not present in the input subscripts.`); + } + if (allDims.indexOf(dimName) === -1) { + allDims.push(dimName); + } + } + for (let i = 0; i < inputString.length; ++i) { + const dimName = inputString[i]; + if (allDims.indexOf(dimName) === -1 && dimName !== COMMA2) { + allDims.push(dimName); + } + } + const idDims = new Array(inputTerms.length); + for (let i = 0; i < numInputs; ++i) { + if (new Set(inputTerms[i].split("")).size !== inputTerms[i].length) { + throw new Error(`Found duplicate axes in input component ${inputTerms[i]}. Support for duplicate axes in input is not implemented yet.`); + } + idDims[i] = []; + for (let j = 0; j < inputTerms[i].length; ++j) { + idDims[i].push(allDims.indexOf(inputTerms[i][j])); + } + } + const numDims = allDims.length; + const numOutDims = outputString.length; + const summedDims = []; + for (let i = numOutDims; i < numDims; ++i) { + summedDims.push(i); + } + return { allDims, summedDims, idDims }; +} +function getEinsumPermutation2(nDims, idDims) { + let permutationIndices = new Array(nDims); + permutationIndices.fill(-1); + for (let i = 0; i < idDims.length; ++i) { + permutationIndices[idDims[i]] = i; + } + const expandDims10 = []; + for (let i = 0; i < nDims; ++i) { + if (permutationIndices[i] === -1) { + expandDims10.push(i); + } + } + permutationIndices = permutationIndices.filter((d) => d !== -1); + return { permutationIndices, expandDims: expandDims10 }; +} +function checkEinsumDimSizes2(nDims, idDims, tensors) { + const dimSizes = new Array(nDims); + for (let i = 0; i < tensors.length; ++i) { + const shape = tensors[i].shape; + for (let j = 0; j < idDims[i].length; ++j) { + if (dimSizes[idDims[i][j]] === void 0) { + dimSizes[idDims[i][j]] = shape[j]; + } else { + assert3(dimSizes[idDims[i][j]] === shape[j], () => `Expected dimension ${dimSizes[idDims[i][j]]} at axis ${j} of input shaped ${JSON.stringify(shape)}, but got dimension ${shape[j]}`); + } + } + } +} +function getEinsumComputePath2(summedDims, idDims) { + const path = summedDims; + const steps = []; + let nSteps = 0; + if (summedDims.length === 0) { + path.push(-1); + } + nSteps = summedDims.length + 1; + for (let i = 0; i < nSteps; ++i) { + steps.push([]); + } + const computedTermIndices = []; + for (let i = 0; i < path.length; ++i) { + const summedDim = path[i]; + const termIndices = findTermsWithDim2(idDims, summedDim); + for (const termIndex of termIndices) { + if (computedTermIndices.indexOf(termIndex) === -1) { + steps[i].push(termIndex); + computedTermIndices.push(termIndex); + } + } + } + return { path, steps }; +} +function isIdentityPermutation2(perm) { + return perm.every((dim, index) => dim === index); +} +function findTermsWithDim2(idDims, dim) { + const termIndices = []; + for (let i = 0; i < idDims.length; ++i) { + if (idDims[i].length === 0 || idDims[i].indexOf(dim) !== -1 || dim === -1) { + termIndices.push(i); + } + } + return termIndices; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.js +function prepareSplitSize2(x, numOrSizeSplits, axis = 0) { + let splitSizes = []; + if (typeof numOrSizeSplits === "number") { + assert3(x.shape[axis] % numOrSizeSplits === 0, () => "Number of splits must evenly divide the axis."); + splitSizes = new Array(numOrSizeSplits).fill(x.shape[axis] / numOrSizeSplits); + } else { + const numOfNegs = numOrSizeSplits.reduce((count4, value) => { + if (value === -1) { + count4 += 1; + } + return count4; + }, 0); + assert3(numOfNegs <= 1, () => "There should be only one negative value in split array."); + const negIndex = numOrSizeSplits.indexOf(-1); + if (negIndex !== -1) { + const total = numOrSizeSplits.reduce((a, b) => b > 0 ? a + b : a); + numOrSizeSplits[negIndex] = x.shape[axis] - total; + } + assert3(x.shape[axis] === numOrSizeSplits.reduce((a, b) => a + b), () => "The sum of sizes must match the size of the axis dimension."); + splitSizes = numOrSizeSplits; + } + return splitSizes; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js +var segment_util_exports2 = {}; +__export(segment_util_exports2, { + collectGatherOpShapeInfo: () => collectGatherOpShapeInfo2, + computeOutShape: () => computeOutShape7, + segOpComputeOptimalWindowSize: () => segOpComputeOptimalWindowSize2 +}); +function segOpComputeOptimalWindowSize2(inSize, numSegments) { + let done = false; + let res; + if (inSize <= PARALLELIZE_THRESHOLD2) { + res = inSize; + done = true; + } else { + res = nearestDivisor2(inSize, Math.floor(Math.sqrt(inSize))); + } + while (!done) { + if (res > numSegments || res === inSize) { + done = true; + } else { + res = nearestDivisor2(inSize, res + 1); + } + } + return res; +} +function computeOutShape7(aShape, axis, numSegments) { + const outShape = []; + const rank = aShape.length; + for (let dim = 0; dim < rank; dim++) { + if (dim !== axis) { + outShape.push(aShape[dim]); + } else { + outShape.push(numSegments); + } + } + return outShape; +} +function collectGatherOpShapeInfo2(x, indices, axis, batchDims) { + const indicesRank = indices.shape.length; + const xRank = x.shape.length; + if (batchDims !== 0) { + if (batchDims < -indicesRank || batchDims > indicesRank) { + throw new Error(`Expect batchDims in the range of [-${indicesRank}, ${indicesRank}], but got ${batchDims}`); + } + } + if (batchDims < 0) { + batchDims += indicesRank; + } + if (batchDims > xRank) { + throw new Error(`batchDims (${batchDims}) must be less than rank(x) ( + ${xRank}).`); + } + if (axis < batchDims) { + throw new Error(`batchDims (${batchDims}) must be less than or equal to axis (${axis}).`); + } + for (let i = 0; i < batchDims; ++i) { + if (x.shape[i] !== indices.shape[i]) { + throw new Error(`x.shape[${i}]: ${x.shape[i]} should be equal to indices.shape[${i}]: ${indices.shape[i]}.`); + } + } + const dimSize = x.shape[axis]; + const outputShape = []; + let batchSize = 1; + let outerSize = 1; + let sliceSize = 1; + for (let i = 0; i < batchDims; ++i) { + outputShape.push(x.shape[i]); + batchSize *= x.shape[i]; + } + for (let i = batchDims; i < axis; i++) { + outputShape.push(x.shape[i]); + outerSize *= x.shape[i]; + } + for (let i = batchDims; i < indicesRank; i++) { + outputShape.push(indices.shape[i]); + } + for (let i = axis + 1; i < xRank; i++) { + outputShape.push(x.shape[i]); + sliceSize *= x.shape[i]; + } + return { batchSize, sliceSize, outerSize, dimSize, outputShape }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js +function fromUint8ToStringArray2(vals) { + try { + return vals.map((val) => decodeString2(val)); + } catch (err) { + throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${err}`); + } +} +function fromStringArrayToUint82(strings) { + return strings.map((s) => encodeString2(s)); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.js +var kernel_impls_exports2 = {}; +__export(kernel_impls_exports2, { + nonMaxSuppressionV3Impl: () => nonMaxSuppressionV3Impl4, + nonMaxSuppressionV4Impl: () => nonMaxSuppressionV4Impl4, + nonMaxSuppressionV5Impl: () => nonMaxSuppressionV5Impl4, + whereImpl: () => whereImpl4 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Abs_grad.js +var absGradConfig2 = { + kernelName: Abs2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(dy, step5(cast6(x, "float32"), -1)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Acos_grad.js +var acosGradConfig2 = { + kernelName: Acos2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { + x: () => { + const a = square4(cast6(x, "float32")); + const b = sqrt4(sub4(scalar2(1), a)); + return neg4(div3(dy, b)); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Acosh_grad.js +var acoshGradConfig2 = { + kernelName: Acosh2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { + x: () => { + const a = sqrt4(sub4(square4(cast6(x, "float32")), 1)); + return div3(dy, a); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Add_grad.js +var addGradConfig2 = { + kernelName: Add3, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + let res = dy; + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, a.shape); + }; + const derB = () => { + let res = dy; + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, b.shape); + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/AddN_grad.js +var addNGradConfig2 = { + kernelName: AddN2, + saveAllInputs: true, + gradFunc: (dy, saved) => { + const ders = {}; + saved.forEach((_, i) => { + ders[i] = () => dy.clone(); + }); + return ders; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMax_grad.js +var argMaxGradConfig2 = { + kernelName: ArgMax2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => zerosLike5(x) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ArgMin_grad.js +var argMinGradConfig2 = { + kernelName: ArgMin2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => zerosLike5(x) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Asin_grad.js +var asinGradConfig2 = { + kernelName: Asin2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, sqrt4(sub4(scalar2(1), square4(cast6(x, "float32"))))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Asinh_grad.js +var asinhGradConfig2 = { + kernelName: Asinh2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { + x: () => { + const a = sqrt4(add6(scalar2(1), square4(cast6(x, "float32")))); + return div3(dy, a); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Atan2_grad.js +var atan2GradConfig2 = { + kernelName: Atan22, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + const d = add6(square4(a), square4(b)); + let res = mul2(dy, div3(b, d)); + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, a.shape); + }; + const derB = () => { + const d = add6(square4(a), square4(b)); + let res = neg4(mul2(dy, div3(a, d))); + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, b.shape); + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Atan_grad.js +var atanGradConfig2 = { + kernelName: Atan3, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, add6(square4(cast6(x, "float32")), 1)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Atanh_grad.js +var atanhGradConfig2 = { + kernelName: Atanh2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, sub4(scalar2(1), square4(cast6(x, "float32")))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d_grad.js +function avgPool3dGrad_2(dy, input3, filterSize, strides, pad4, dimRoundingMode) { + const $dy = convertToTensor2(dy, "dy", "avgPool3dGrad"); + const $input = convertToTensor2(input3, "input", "avgPool3dGrad"); + let dy5D = $dy; + let input5D = $input; + let reshapedTo5D = false; + if ($input.rank === 4) { + reshapedTo5D = true; + dy5D = reshape6($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); + input5D = reshape6($input, [ + 1, + $input.shape[0], + $input.shape[1], + $input.shape[2], + $input.shape[3] + ]); + } + assert3(dy5D.rank === 5, () => `Error in avgPool3dGrad: dy must be rank 5 but got rank ${dy5D.rank}.`); + assert3(input5D.rank === 5, () => `Error in avgPool3dGrad: input must be rank 5 but got rank ${input5D.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in avgPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { dy: dy5D, input: input5D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode }; + const res = ENGINE2.runKernel(AvgPool3DGrad2, inputs, attrs); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var avgPool3dGrad2 = op2({ avgPool3dGrad_: avgPool3dGrad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool3D_grad.js +var avgPool3DGradConfig3 = { + kernelName: AvgPool3D2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + return { + x: () => avgPool3dGrad2(dy, x, filterSize, strides, pad4, dimRoundingMode) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_grad.js +function avgPoolGrad_2(dy, input3, filterSize, strides, pad4) { + const $dy = convertToTensor2(dy, "dy", "avgPoolGrad"); + const $input = convertToTensor2(input3, "input", "avgPoolGrad"); + assert3($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); + let input4D = $input; + let dy4D = $dy; + let reshapedTo4D = false; + if ($input.rank === 3) { + reshapedTo4D = true; + input4D = reshape6($input, [1, $input.shape[0], $input.shape[1], $input.shape[2]]); + dy4D = reshape6($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2]]); + } + assert3(dy4D.rank === 4, () => `Error in avgPoolGrad: dy must be rank 4 but got rank ${dy4D.rank}.`); + assert3(input4D.rank === 4, () => `Error in avgPoolGrad: input must be rank 4 but got rank ${input4D.rank}.`); + const inputs = { dy: dy4D, input: input4D }; + const attrs = { filterSize, strides, pad: pad4 }; + const res = ENGINE2.runKernel(AvgPoolGrad2, inputs, attrs); + if (reshapedTo4D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; +} +var avgPoolGrad4 = op2({ avgPoolGrad_: avgPoolGrad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/AvgPool_grad.js +var avgPoolGradConfig4 = { + kernelName: AvgPool2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { filterSize, strides, pad: pad4 } = attrs; + return { x: () => avgPoolGrad4(dy, x, filterSize, strides, pad4) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/BatchMatMul_grad.js +var batchMatMulGradConfig2 = { + kernelName: BatchMatMul2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved, attrs) => { + const [a, b] = saved; + const { transposeA, transposeB } = attrs; + if (!transposeA && !transposeB) { + return { + a: () => matMul3(dy, b, false, true), + b: () => matMul3(a, dy, true, false) + }; + } else if (!transposeA && transposeB) { + return { + a: () => matMul3(dy, b, false, false), + b: () => matMul3(dy, a, true, false) + }; + } else if (transposeA && !transposeB) { + return { + a: () => matMul3(b, dy, false, true), + b: () => matMul3(a, dy, false, false) + }; + } else { + return { + a: () => matMul3(b, dy, true, true), + b: () => matMul3(dy, a, true, true) + }; + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/BatchToSpaceND_grad.js +var batchToSpaceNDGradConfig2 = { + kernelName: BatchToSpaceND2, + gradFunc: (dy, saved, attrs) => { + const { blockShape, crops } = attrs; + return { x: () => spaceToBatchND5(dy, blockShape, crops) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/BroadcastTo_grad.js +var broadcastToGradConfig2 = { + kernelName: BroadcastTo2, + gradFunc: (dy, saved, attrs) => { + const broadCastToAttrs = attrs; + const inputShape = broadCastToAttrs.inputShape; + const outputShape = broadCastToAttrs.shape; + const reps = Array.from(outputShape); + for (let i = inputShape.length - 1; i >= 0; i--) { + if (inputShape[i] === outputShape[i]) { + reps[i] = 1; + } else if (inputShape[i] !== 1) { + throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); + } + } + const axes = []; + for (let i = 0; i < reps.length; i++) { + if (reps[i] > 1) { + axes.push(i); + } + } + return { x: () => sum7(dy, axes, true) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Cast_grad.js +var castGradConfig2 = { + kernelName: Cast2, + gradFunc: (dy) => { + return { x: () => dy.clone() }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Ceil_grad.js +var ceilGradConfig2 = { + kernelName: Ceil2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ClipByValue_grad.js +var clipByValueGradConfig2 = { + kernelName: ClipByValue2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { clipValueMin, clipValueMax } = attrs; + return { + x: () => where2(logicalAnd4(greaterEqual4(x, clipValueMin), lessEqual4(x, clipValueMax)), dy, zerosLike5(dy)) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ComplexAbs_grad.js +var complexAbsGradConfig2 = { + kernelName: ComplexAbs2, + inputsToSave: ["x"], + gradFunc: absGradConfig2.gradFunc +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Concat_grad.js +var concatGradConfig2 = { + kernelName: Concat2, + saveAllInputs: true, + gradFunc: (dy, saved, attrs) => { + const shapes = saved.map((t) => t.shape); + const { axis } = attrs; + const $axis = parseAxisParam2(axis, saved[0].shape)[0]; + const sizeSplits = shapes.map((s) => s[$axis]); + const derTensors = split4(dy, sizeSplits, $axis); + return derTensors.map((t) => () => t); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2D_grad.js +var conv2DGradConfig2 = { + kernelName: Conv2D3, + inputsToSave: ["x", "filter"], + gradFunc: (dy, saved, attrs) => { + const [x4D, $filter] = saved; + const { dilations, strides, pad: pad4, dataFormat } = attrs; + assert3(tupleValuesAreOne2(dilations), () => `Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); + return { + x: () => conv2DBackpropInput5(x4D.shape, dy, $filter, strides, pad4, dataFormat), + filter: () => conv2DBackpropFilter4(x4D, dy, $filter.shape, strides, pad4, dataFormat) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Conv2DBackpropInput_grad.js +var conv2DBackpropInputGradConfig2 = { + kernelName: Conv2DBackpropInput2, + inputsToSave: ["dy", "filter"], + gradFunc: (ddx, saved, attrs) => { + const [dy, filter] = saved; + const { strides, pad: pad4, dataFormat, dimRoundingMode } = attrs; + return { + dy: () => conv2d6(ddx, filter, strides, pad4, dataFormat, 1, dimRoundingMode), + filter: () => conv2DBackpropFilter4(ddx, dy, filter.shape, strides, pad4, dataFormat, dimRoundingMode) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_backprop_filter.js +function conv3DBackpropFilter_2(x, dy, filterShape, strides, pad4) { + let x5D = x; + if (x.rank === 4) { + x5D = reshape6(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); + } + let dy5D = dy; + if (dy5D.rank === 4) { + dy5D = reshape6(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); + } + assert3(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ${x5D.shape}.`); + assert3(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ${dy5D.shape}.`); + assert3(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ${filterShape}.`); + assert3(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must match input depth in filter (${filterShape[3]}.`); + assert3(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must match output depth for filter (${filterShape[4]}).`); + const inputs = { x: x5D, dy: dy5D }; + const attrs = { strides, pad: pad4, filterShape }; + return ENGINE2.runKernel(Conv3DBackpropFilterV22, inputs, attrs); +} +var conv3DBackpropFilter2 = op2({ conv3DBackpropFilter_: conv3DBackpropFilter_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Conv3D_grad.js +var conv3DGradConfig2 = { + kernelName: Conv3D3, + inputsToSave: ["x", "filter"], + gradFunc: (dy, saved, attrs) => { + const { dilations, strides, pad: pad4 } = attrs; + assert3(tupleValuesAreOne2(dilations), () => `Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${dilations}'`); + const [x5D, $filter] = saved; + return { + x: () => conv3DBackpropInput3(x5D.shape, dy, $filter, strides, pad4), + filter: () => conv3DBackpropFilter2(x5D, dy, $filter.shape, strides, pad4) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Cos_grad.js +var cosGradConfig2 = { + kernelName: Cos2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(neg4(sin4(cast6(x, "float32"))), dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Cosh_grad.js +var coshGradConfig2 = { + kernelName: Cosh2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(sinh4(cast6(x, "float32")), dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Cumsum_grad.js +var cumsumGradConfig2 = { + kernelName: Cumsum2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { axis, exclusive, reverse: reverse8 } = attrs; + return { + x: () => { + const permutation = getAxesPermutation2([axis], x.rank); + let out = cumsum5(dy, axis, exclusive, !reverse8); + if (permutation != null) { + out = transpose5(out, permutation); + } + return out; + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/DepthwiseConv2dNative_grad.js +var depthwiseConv2dNativeGradConfig2 = { + kernelName: DepthwiseConv2dNative2, + inputsToSave: ["x", "filter"], + gradFunc: (dy, saved, attrs) => { + const { dilations, strides, pad: pad4, dimRoundingMode } = attrs; + const $dilations = dilations == null ? [1, 1] : dilations; + assert3(tupleValuesAreOne2($dilations), () => `Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${$dilations}'`); + const [x, filter] = saved; + assert3(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${x.rank}.`); + assert3(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${filter.rank}.`); + assert3(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input channels (${x.shape[3]}) must match the inChannels dimension in filter ${filter.shape[2]}.`); + assert3(eitherStridesOrDilationsAreOne2(strides, $dilations), () => `Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + return { + x: () => depthwiseConv2dNativeBackpropInput4(x.shape, dy, filter, strides, pad4, $dilations, dimRoundingMode), + filter: () => depthwiseConv2dNativeBackpropFilter4(x, dy, filter.shape, strides, pad4, $dilations, dimRoundingMode) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Dilation2D_grad.js +var dilation2dGradConfig2 = { + kernelName: Dilation2D2, + inputsToSave: ["x", "filter"], + gradFunc: (dy, saved, attrs) => { + const [x, filter] = saved; + const inputInputs = { x, filter, dy }; + const filterInputs = { x, filter, dy }; + return { + x: () => ENGINE2.runKernel(Dilation2DBackpropInput2, inputInputs, attrs), + filter: () => ENGINE2.runKernel(Dilation2DBackpropFilter2, filterInputs, attrs) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Elu_grad.js +var eluGradConfig4 = { + kernelName: Elu3, + outputsToSave: [true], + gradFunc: (dy, saved) => { + const [y] = saved; + const inputs = { dy, y }; + return { x: () => ENGINE2.runKernel(EluGrad2, inputs) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Erf_grad.js +var erfGradConfig2 = { + kernelName: Erf2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + const a = mul2(exp4(neg4(square4(x))), 2 / Math.sqrt(Math.PI)); + return { x: () => mul2(dy, a) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Exp_grad.js +var expGradConfig2 = { + kernelName: Exp2, + outputsToSave: [true], + gradFunc: (dy, saved) => { + const [y] = saved; + return { x: () => mul2(dy, y) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ExpandDims_grad.js +var expandDimsGradConfig2 = { + kernelName: ExpandDims2, + inputsToSave: ["input"], + gradFunc: (dy, saved) => { + const [input3] = saved; + return { input: () => reshape6(dy, input3.shape) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Expm1_grad.js +var expm1GradConfig2 = { + kernelName: Expm12, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(dy, exp4(x)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Floor_grad.js +var floorGradConfig2 = { + kernelName: Floor2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/FloorDiv_grad.js +var floorDivGradConfig2 = { + kernelName: FloorDiv2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + const res = div3(dy, cast6(b, "float32")); + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(res, reduceAxes), a.shape); + } + return res; + }; + const derB = () => { + let res = mul2(dy, cast6(a, "float32")); + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + res = reshape6(sum7(res, reduceAxes), b.shape); + } + const tmp = square4(b); + return neg4(div3(res, cast6(tmp, "float32"))); + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/FusedBatchNorm_grad.js +var fusedBatchNormGradConfig2 = { + kernelName: FusedBatchNorm2, + inputsToSave: ["x", "mean", "variance", "scale"], + gradFunc: (dy, saved, attrs) => { + const { varianceEpsilon } = attrs; + const [x, mean6, variance, scale4] = saved; + const scaleValue = scale4 == null ? scalar2(1) : scale4; + const reductionAxes = getReductionAxes2(mean6.shape, x.shape); + const tileShape = []; + if (mean6.rank === 1) { + for (let i = 0; i < x.shape.length - 1; ++i) { + tileShape.push(x.shape[i]); + } + tileShape.push(1); + } + const xMinusMean = sub4(x, mean6); + const dyTimesScaleValue = mul2(dy, scaleValue); + const oneOverSqrtVariance = rsqrt4(add6(variance, scalar2(varianceEpsilon))); + const minusHalfRCube = mul2(mul2(mul2(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar2(-0.5)); + const derX = () => { + if (mean6.rank === 1) { + return reshape6(mul2(mul2(dy, tile6(reshape6(oneOverSqrtVariance, [1, 1, 1, mean6.shape[0]]), tileShape)), scaleValue), x.shape); + } else { + return reshape6(mul2(mul2(dy, oneOverSqrtVariance), scaleValue), x.shape); + } + }; + const derMean = () => { + let meanDer = mul2(mul2(oneOverSqrtVariance, scalar2(-1)), dyTimesScaleValue); + if (mean6.rank === 1) { + meanDer = sum7(meanDer, reductionAxes); + } + return reshape6(meanDer, mean6.shape); + }; + const derVariance = () => { + let varianceDer = mul2(mul2(minusHalfRCube, xMinusMean), dyTimesScaleValue); + if (mean6.rank === 1) { + varianceDer = sum7(varianceDer, reductionAxes); + } + return reshape6(varianceDer, mean6.shape); + }; + const derScale = () => { + const xMinusMean2TimesRsqrt = mul2(xMinusMean, oneOverSqrtVariance); + let scaleDer = mul2(dy, xMinusMean2TimesRsqrt); + if (mean6.rank === 1) { + scaleDer = sum7(scaleDer, reductionAxes); + } + return reshape6(scaleDer, mean6.shape); + }; + const derOffset = () => { + let offsetDer = dy; + if (mean6.rank === 1) { + offsetDer = sum7(offsetDer, reductionAxes); + } + return reshape6(offsetDer, mean6.shape); + }; + return { + x: derX, + mean: derMean, + variance: derVariance, + scale: derScale, + offset: derOffset + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/GatherV2_grad.js +var gatherGradConfig2 = { + kernelName: GatherV22, + inputsToSave: ["x", "indices"], + gradFunc: (dy, saved, attrs) => { + const [x, indices] = saved; + const { axis } = attrs; + const parsedAxis = parseAxisParam2(axis, x.shape)[0]; + const derX = () => { + const paramsShape = x.shape; + const indicesSize = indices.size; + const outerShape = paramsShape.slice(0, parsedAxis); + const outerDims = outerShape.length; + const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); + const innerDims = innerShape.length; + const outerAxesIndices = arrayRange2(0, outerDims); + const innerAxesIndices = arrayRange2(outerDims + 1, outerDims + 1 + innerDims); + const valuesShape = arrayConcat2([outerShape, [indicesSize], innerShape]); + const values = reshape6(dy, valuesShape); + const reshapedIndices = reshape6(indices, [indicesSize]); + const transposeDims = arrayConcat2([[outerDims], outerAxesIndices, innerAxesIndices]); + const valuesTranspose = transpose5(values, transposeDims); + let paramsGrad = unsortedSegmentSum4(valuesTranspose, reshapedIndices, x.shape[parsedAxis]); + const invertTransposeDims = getUndoAxesPermutation2(transposeDims); + paramsGrad = transpose5(paramsGrad, invertTransposeDims); + return paramsGrad; + }; + return { x: derX, indices: () => indices }; + } +}; +function arrayRange2(start, stop) { + const result = []; + for (let i = start; i < stop; ++i) { + result.push(i); + } + return result; +} +function arrayConcat2(arrays) { + const result = []; + for (let i = 0; i < arrays.length; ++i) { + for (let j = 0; j < arrays[i].length; ++j) { + result.push(arrays[i][j]); + } + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/GreaterEqual_grad.js +var greaterEqualGradConfig2 = { + kernelName: GreaterEqual2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + return { a: () => zerosLike5(a), b: () => zerosLike5(b) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Identity_grad.js +var identityGradConfig2 = { + kernelName: Identity3, + gradFunc: (dy) => { + return { x: () => cast6(dy, "float32") }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/IsFinite_grad.js +var isFiniteGradConfig2 = { + kernelName: IsFinite2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/IsInf_grad.js +var isInfGradConfig2 = { + kernelName: IsInf2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/IsNan_grad.js +var isNanGradConfig2 = { + kernelName: IsNan2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/LeakyRelu_grad.js +var leakyReluGradConfig2 = { + kernelName: LeakyRelu2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { alpha } = attrs; + const mask = greater5(x, 0); + return { x: () => where2(mask, dy, mul2(dy, alpha)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Log1p_grad.js +var log1pGradConfig2 = { + kernelName: Log1p2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, add6(x, 1)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Log_grad.js +var logGradConfig2 = { + kernelName: Log2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, cast6(x, "float32")) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/LogSoftmax_grad.js +var logSoftmaxGradConfig2 = { + kernelName: LogSoftmax3, + inputsToSave: [], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [value] = saved; + const { axis } = attrs; + return { + logits: () => { + const keepDims = true; + const softmax9 = exp4(value); + return sub4(dy, mul2(sum7(dy, axis, keepDims), softmax9)); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization_backprop.js +function localResponseNormalizationBackprop_2(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { + const inputs = { x, y, dy }; + const attrs = { depthRadius, bias, alpha, beta }; + return ENGINE2.runKernel(LRNGrad2, inputs, attrs); +} +var localResponseNormalizationBackprop2 = op2({ localResponseNormalizationBackprop_: localResponseNormalizationBackprop_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/LRN_grad.js +var lrnGradConfig2 = { + kernelName: LRN2, + inputsToSave: ["x"], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [x, y] = saved; + const { depthRadius, bias, alpha, beta } = attrs; + return { + x: () => localResponseNormalizationBackprop2(x, y, dy, depthRadius, bias, alpha, beta) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/min_max_grad_util.js +function gradForMinAndMax2(dy, y, xOrig, origAxes) { + if (y.rank < xOrig.rank) { + y = reshape6(y, expandShapeToKeepDim2(y.shape, origAxes)); + } + if (dy.rank < xOrig.rank) { + dy = reshape6(dy, expandShapeToKeepDim2(dy.shape, origAxes)); + } + return { + x: () => { + const dx = mul2(dy, cast6(equal4(xOrig, y), dy.dtype)); + return dx; + } + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Max_grad.js +var maxGradConfig2 = { + kernelName: Max2, + inputsToSave: ["x"], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const maxAttrs = attrs; + const { reductionIndices } = maxAttrs; + const x = saved[0]; + const y = saved[1]; + const origAxes = parseAxisParam2(reductionIndices, x.shape); + const maxGrad = gradForMinAndMax2(dy, y, x, origAxes); + return { + x: () => { + return maxGrad["x"](); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Maximum_grad.js +var maximumGradConfig2 = { + kernelName: Maximum3, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const derA = () => mul2(dy, cast6(greaterEqual4(a, b), "float32")); + const derB = () => mul2(dy, cast6(less5(a, b), "float32")); + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d_grad.js +function maxPool3dGrad_2(dy, input3, output, filterSize, strides, pad4, dimRoundingMode) { + const $dy = convertToTensor2(dy, "dy", "maxPool3dGrad"); + const $input = convertToTensor2(input3, "input", "maxPool3dGrad"); + const $output = convertToTensor2(output, "output", "maxPool3dGrad"); + let dy5D = $dy; + let input5D = $input; + let output5D = $output; + let reshapedTo5D = false; + if ($input.rank === 4) { + reshapedTo5D = true; + dy5D = reshape6($dy, [1, $dy.shape[0], $dy.shape[1], $dy.shape[2], $dy.shape[3]]); + input5D = reshape6($input, [ + 1, + $input.shape[0], + $input.shape[1], + $input.shape[2], + $input.shape[3] + ]); + output5D = reshape6($output, [ + 1, + $output.shape[0], + $output.shape[1], + $output.shape[2], + $output.shape[3] + ]); + } + assert3(dy5D.rank === 5, () => `Error in maxPool3dGrad: dy must be rank 5 but got rank ${dy5D.rank}.`); + assert3(input5D.rank === 5, () => `Error in maxPool3dGrad: input must be rank 5 but got rank ${input5D.rank}.`); + assert3(output5D.rank === 5, () => `Error in maxPool3dGrad: output must be rank 5 but got rank ${output5D.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in maxPool3dGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { dy: dy5D, input: input5D, output: output5D }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode }; + const res = ENGINE2.runKernel(MaxPool3DGrad2, inputs, attrs); + if (reshapedTo5D) { + return reshape6(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; +} +var maxPool3dGrad2 = op2({ maxPool3dGrad_: maxPool3dGrad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool3D_grad.js +var maxPool3DGradConfig3 = { + kernelName: MaxPool3D2, + inputsToSave: ["x"], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [x, y] = saved; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + return { + x: () => maxPool3dGrad2(dy, x, y, filterSize, strides, pad4, dimRoundingMode) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_grad.js +function maxPoolGrad_2(dy, input3, output, filterSize, strides, pad4, dimRoundingMode) { + const $dy = convertToTensor2(dy, "dy", "maxPoolGrad"); + const $input = convertToTensor2(input3, "input", "maxPoolGrad"); + const $output = convertToTensor2(output, "output", "maxPoolGrad"); + assert3($input.rank === $dy.rank, () => `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`); + assert3($dy.rank === 4, () => `Error in maxPoolGrad: dy must be rank 4 but got rank ${$dy.rank}.`); + assert3($input.rank === 4, () => `Error in maxPoolGrad: input must be rank 4 but got rank ${$input.rank}.`); + if (dimRoundingMode != null) { + assert3(isInt2(pad4), () => `Error in maxPoolGrad: pad must be an integer when using, dimRoundingMode ${dimRoundingMode} but got pad ${pad4}.`); + } + const inputs = { dy: $dy, input: $input, output: $output }; + const attrs = { filterSize, strides, pad: pad4, dimRoundingMode }; + return ENGINE2.runKernel(MaxPoolGrad2, inputs, attrs); +} +var maxPoolGrad4 = op2({ maxPoolGrad_: maxPoolGrad_2 }); + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/MaxPool_grad.js +var maxPoolGradConfig4 = { + kernelName: MaxPool2, + inputsToSave: ["x"], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [x, y] = saved; + const { filterSize, strides, pad: pad4 } = attrs; + return { + x: () => maxPoolGrad4(dy, x, y, filterSize, strides, pad4) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Mean_grad.js +var meanGradConfig2 = { + kernelName: Mean2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { axis } = attrs; + const axes = parseAxisParam2(axis, x.shape); + const shapes = computeOutAndReduceShapes2(x.shape, axes); + const reduceShape = shapes[1]; + const reduceSize = sizeFromShape2(reduceShape); + const derX = () => { + const expandedDyShape = x.shape.slice(); + axes.forEach((axis2) => { + expandedDyShape[axis2] = 1; + }); + const expandedDy = reshape6(dy, expandedDyShape); + const res = div3(mul2(expandedDy, ones5(x.shape, "float32")), reduceSize); + return res; + }; + return { x: derX }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Min_grad.js +var minGradConfig2 = { + kernelName: Min2, + inputsToSave: ["x"], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const minAttrs = attrs; + const { axis } = minAttrs; + const [x, y] = saved; + const origAxes = parseAxisParam2(axis, x.shape); + const minGrad = gradForMinAndMax2(dy, y, x, origAxes); + return { + x: () => { + return minGrad["x"](); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Minimum_grad.js +var minimumGradConfig2 = { + kernelName: Minimum3, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const derA = () => mul2(dy, cast6(lessEqual4(a, b), "float32")); + const derB = () => mul2(dy, cast6(greater5(a, b), "float32")); + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/MirrorPad_grad.js +var mirrorPadGradConfig2 = { + kernelName: MirrorPad2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const x = saved[0]; + const { paddings } = attrs; + const begin = paddings.map((p3) => p3[0]); + return { x: () => slice5(dy, begin, x.shape) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Mod_grad.js +var modGradConfig2 = { + kernelName: Mod2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(dy, reduceAxes), a.shape); + } + return dy; + }; + const derB = () => { + const res = mul2(dy, neg4(floor4(div3(a, b)))); + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(res, reduceAxes), b.shape); + } + return res; + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Multiply_grad.js +var multiplyGradConfig2 = { + kernelName: Multiply3, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + const res = mul2(dy, cast6(b, "float32")); + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(res, reduceAxes), a.shape); + } + return res; + }; + const derB = () => { + const res = mul2(dy, cast6(a, "float32")); + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(res, reduceAxes), b.shape); + } + return res; + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Neg_grad.js +var negGradConfig2 = { + kernelName: Neg2, + gradFunc: (dy) => { + return { x: () => neg4(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/OneHot_grad.js +var oneHotGradConfig2 = { + kernelName: OneHot2, + inputsToSave: ["indices"], + gradFunc: (dy, saved) => { + const indices = saved[0]; + return { indices: () => zeros4(indices.shape, "float32") }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/OnesLike_grad.js +var onesLikeGradConfig2 = { + kernelName: OnesLike2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Pack_grad.js +var packGradConfig2 = { + kernelName: Pack2, + saveAllInputs: true, + gradFunc: (dy, saved, attrs) => { + const { axis } = attrs; + const derTensors = unstack2(dy, axis); + return derTensors.map((t) => () => t); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/PadV2_grad.js +var padV2GradConfig2 = { + kernelName: PadV22, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const x = saved[0]; + const { paddings } = attrs; + const begin = paddings.map((p3) => p3[0]); + return { x: () => slice5(dy, begin, x.shape) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Pow_grad.js +var powGradConfig2 = { + kernelName: Pow2, + inputsToSave: ["a", "b"], + outputsToSave: [true], + gradFunc: (dy, saved) => { + const [a, b, y] = saved; + const base2 = a; + const exp7 = b; + const outShape = assertAndGetBroadcastShape2(base2.shape, exp7.shape); + const derBase = () => { + const expFloat = cast6(exp7, "float32"); + let res = mul2(dy, mul2(expFloat, pow4(base2, sub4(expFloat, scalar2(1))))); + const reduceAxes = getReductionAxes2(base2.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, base2.shape); + }; + const derExp = () => { + const condition = greater5(base2, 0); + const logBase = where2(condition, log10(base2), zerosLike5(base2)); + let res = mul2(dy, mul2(y, logBase)); + const reduceAxes = getReductionAxes2(exp7.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, exp7.shape); + }; + return { a: derBase, b: derExp }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Prelu_grad.js +var preluGradConfig2 = { + kernelName: Prelu2, + inputsToSave: ["x", "alpha"], + gradFunc: (dy, saved) => { + const [x, alpha] = saved; + const mask = greater5(x, 0); + return { + x: () => where2(mask, dy, mul2(dy, alpha)), + alpha: () => { + let res = where2(mask, zerosLike5(dy), mul2(dy, x)); + const reduceAxes = getReductionAxes2(alpha.shape, dy.shape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, alpha.shape); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/RealDiv_grad.js +var divGradConfig2 = { + kernelName: RealDiv2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + const res = div3(dy, cast6(b, "float32")); + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + return reshape6(sum7(res, reduceAxes), a.shape); + } + return res; + }; + const derB = () => { + let res = mul2(dy, cast6(a, "float32")); + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + res = reshape6(sum7(res, reduceAxes), b.shape); + } + const tmp = square4(b); + return neg4(div3(res, cast6(tmp, "float32"))); + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Reciprocal_grad.js +var reciprocalGradConfig2 = { + kernelName: Reciprocal2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, neg4(square4(x))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Relu6_grad.js +var relu6GradConfig2 = { + kernelName: Relu63, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + const mask = mul2(lessEqual4(x, 6), step5(x)); + return { x: () => mul2(dy, cast6(mask, "float32")) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Relu_grad.js +var reluGradConfig2 = { + kernelName: Relu3, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(dy, cast6(step5(x), "float32")) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Reshape_grad.js +var reshapeGradConfig2 = { + kernelName: Reshape3, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => reshape6(dy, x.shape) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeBilinear_grad.js +var resizeBilinearGradConfig4 = { + kernelName: ResizeBilinear2, + inputsToSave: ["images"], + gradFunc: (dy, saved, attrs) => { + const [images] = saved; + const inputs = { dy, images }; + const imagesDer = () => ENGINE2.runKernel(ResizeBilinearGrad2, inputs, attrs); + return { images: imagesDer }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ResizeNearestNeighbor_grad.js +var resizeNearestNeighborGradConfig4 = { + kernelName: ResizeNearestNeighbor2, + inputsToSave: ["images"], + gradFunc: (dy, saved, attrs) => { + const [images] = saved; + const inputs = { dy, images }; + const imagesDer = () => ENGINE2.runKernel(ResizeNearestNeighborGrad2, inputs, attrs); + return { images: imagesDer }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Reverse_grad.js +var reverseGradConfig2 = { + kernelName: Reverse2, + gradFunc: (dy, saved, attrs) => { + const { dims } = attrs; + const axes = parseAxisParam2(dims, dy.shape); + return { x: () => reverse5(dy, axes) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Round_grad.js +var roundGradConfig2 = { + kernelName: Round2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Rsqrt_grad.js +var rsqrtGradConfig2 = { + kernelName: Rsqrt2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => neg4(div3(dy, mul2(pow4(x, 1.5), 2))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Select_grad.js +var selectGradConfig2 = { + kernelName: Select2, + inputsToSave: ["condition"], + gradFunc: (dy, saved) => { + const [condition] = saved; + return { + condition: () => cast6(zerosLike5(condition), "float32"), + t: () => mul2(dy, cast6(condition, dy.dtype)), + e: () => mul2(dy, cast6(logicalNot4(condition), dy.dtype)) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Selu_grad.js +var seluGradConfig2 = { + kernelName: Selu3, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { + x: () => { + const mask = greater5(x, scalar2(0)); + const scaleAlpha3 = scalar2(SELU_SCALEALPHA2); + const scale4 = scalar2(SELU_SCALE2); + const greaterThanZeroDer = mul2(dy, scale4); + const lessEqualZeroDer = mul2(mul2(dy, scaleAlpha3), exp4(cast6(x, "float32"))); + return where2(mask, greaterThanZeroDer, lessEqualZeroDer); + } + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sigmoid_grad.js +var sigmoidGradConfig2 = { + kernelName: Sigmoid3, + outputsToSave: [true], + gradFunc: (dy, saved) => { + const [y] = saved; + return { x: () => mul2(dy, mul2(y, sub4(scalar2(1), y))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sign_grad.js +var signGradConfig2 = { + kernelName: Sign2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sin_grad.js +var sinGradConfig2 = { + kernelName: Sin2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(cos4(cast6(x, "float32")), dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sinh_grad.js +var sinhGradConfig2 = { + kernelName: Sinh2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(cosh4(cast6(x, "float32")), dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Slice_grad.js +var sliceGradConfig2 = { + kernelName: Slice2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { begin, size: size2 } = attrs; + const inputShape = x.shape; + const [begin_, size_] = parseSliceParams2(x, begin, size2); + const paddings = []; + for (let i = 0; i < dy.rank; i++) { + paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); + } + return { x: () => pad3(dy, paddings) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Softmax_grad.js +var softmaxGradConfig2 = { + kernelName: Softmax4, + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [y] = saved; + const { dim } = attrs; + const keepDims = true; + const dyTimesY = mul2(dy, y); + return { + logits: () => sub4(dyTimesY, mul2(sum7(dyTimesY, [dim], keepDims), y)) + }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Softplus_grad.js +var softplusGradConfig2 = { + kernelName: Softplus3, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(dy, sigmoid5(x)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/SpaceToBatchND_grad.js +var spaceToBatchNDGradConfig2 = { + kernelName: SpaceToBatchND2, + gradFunc: (dy, saved, attrs) => { + const { blockShape, paddings } = attrs; + return { x: () => batchToSpaceND5(dy, blockShape, paddings) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/SplitV_grad.js +var splitVGradConfig2 = { + kernelName: SplitV2, + gradFunc: (dy, saved, attrs) => { + const { axis } = attrs; + return { x: () => concat5(dy, axis) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sqrt_grad.js +var sqrtGradConfig2 = { + kernelName: Sqrt2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, mul2(sqrt4(cast6(x, "float32")), 2)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Square_grad.js +var squareGradConfig2 = { + kernelName: Square2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul2(dy, mul2(cast6(x, "float32"), 2)) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/SquaredDifference_grad.js +var squaredDifferenceGradConfig2 = { + kernelName: SquaredDifference2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const two = scalar2(2); + const derA = () => mul2(dy, mul2(two, sub4(a, b))); + const derB = () => mul2(dy, mul2(two, sub4(b, a))); + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Step_grad.js +var stepGradConfig2 = { + kernelName: Step2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sub_grad.js +var subGradConfig2 = { + kernelName: Sub2, + inputsToSave: ["a", "b"], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape2(a.shape, b.shape); + const derA = () => { + let res = dy; + const reduceAxes = getReductionAxes2(a.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(res, a.shape); + }; + const derB = () => { + let res = dy; + const reduceAxes = getReductionAxes2(b.shape, outShape); + if (reduceAxes.length > 0) { + res = sum7(res, reduceAxes); + } + return reshape6(neg4(res), b.shape); + }; + return { a: derA, b: derB }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Sum_grad.js +var sumGradConfig2 = { + kernelName: Sum2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const expandedDyShape = x.shape.slice(); + const { axis } = attrs; + const axes = parseAxisParam2(axis, x.shape); + axes.forEach((axis2) => { + expandedDyShape[axis2] = 1; + }); + const expandedDy = reshape6(dy, expandedDyShape); + const derX = mul2(expandedDy, ones5(x.shape, "float32")); + return { x: () => derX }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Tan_grad.js +var tanGradConfig2 = { + kernelName: Tan2, + inputsToSave: ["x"], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => div3(dy, square4(cos4(x))) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Tanh_grad.js +var tanhGradConfig2 = { + kernelName: Tanh3, + outputsToSave: [true], + gradFunc: (dy, saved) => { + const [y] = saved; + return { x: () => mul2(sub4(scalar2(1), square4(y)), dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Tile_grad.js +var tileGradConfig2 = { + kernelName: Tile2, + inputsToSave: ["x"], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { reps } = attrs; + const derX = () => { + let xGrad = zerosLike5(x); + if (x.rank === 1) { + for (let i = 0; i < reps[0]; ++i) { + xGrad = add6(xGrad, slice5(dy, [i * x.shape[0]], [x.shape[0]])); + } + } else if (x.rank === 2) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + xGrad = add6(xGrad, slice5(dy, [i * x.shape[0], j * x.shape[1]], [ + x.shape[0], + x.shape[1] + ])); + } + } + } else if (x.rank === 3) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + for (let k = 0; k < reps[2]; ++k) { + xGrad = add6(xGrad, slice5(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); + } + } + } + } else if (x.rank === 4) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + for (let k = 0; k < reps[2]; ++k) { + for (let l = 0; l < reps[3]; ++l) { + xGrad = add6(xGrad, slice5(dy, [ + i * x.shape[0], + j * x.shape[1], + k * x.shape[2], + l * x.shape[3] + ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); + } + } + } + } + } else { + throw new Error(`Gradient for tile operation is not implemented for rank-${x.rank} tensors yet.`); + } + return xGrad; + }; + return { x: derX }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Transpose_grad.js +var transposeGradConfig2 = { + kernelName: Transpose2, + gradFunc: (dy, saved, attrs) => { + const transposeAttrs = attrs; + const { perm } = transposeAttrs; + const undoPerm = getUndoAxesPermutation2(perm); + return { x: () => transpose5(dy, undoPerm) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/Unpack_grad.js +var unpackGradConfig2 = { + kernelName: Unpack2, + gradFunc: (dy, saved, attrs) => { + const unpackAttrs = attrs; + const { axis } = unpackAttrs; + return { value: () => stack2(dy, axis) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/UnsortedSegmentSum_grad.js +var unsortedSegmentSumGradConfig2 = { + kernelName: UnsortedSegmentSum2, + inputsToSave: ["segmentIds"], + gradFunc: (dy, saved) => { + const [segmentIds] = saved; + const derX = () => { + return gatherDropNegatives2(dy, segmentIds); + }; + return { x: derX }; + } +}; +function gatherDropNegatives2(x, indices) { + const zeroClippedIndices = maximum5(indices, zerosLike5(indices)); + const gathered = gather3(x, zeroClippedIndices); + let isPositive = greaterEqual4(indices, scalar2(0, "int32")); + const numIters = gathered.rank - isPositive.rank; + for (let i = 0; i < numIters; ++i) { + isPositive = expandDims6(isPositive, i + 1); + } + isPositive = logicalAnd4(isPositive, ones5(gathered.shape, "bool")); + const zeroSlice = zerosLike5(gathered); + return where2(isPositive, gathered, zeroSlice); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/gradients/ZerosLike_grad.js +var zerosLikeGradConfig2 = { + kernelName: ZerosLike2, + gradFunc: (dy) => { + return { x: () => zerosLike5(dy) }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/register_all_gradients.js +var gradConfigs2 = [ + absGradConfig2, + acosGradConfig2, + acoshGradConfig2, + addGradConfig2, + addNGradConfig2, + argMaxGradConfig2, + argMinGradConfig2, + asinGradConfig2, + asinhGradConfig2, + atan2GradConfig2, + atanGradConfig2, + atanhGradConfig2, + avgPool3DGradConfig3, + avgPoolGradConfig4, + batchMatMulGradConfig2, + batchToSpaceNDGradConfig2, + broadcastToGradConfig2, + castGradConfig2, + ceilGradConfig2, + clipByValueGradConfig2, + complexAbsGradConfig2, + concatGradConfig2, + conv2DBackpropInputGradConfig2, + conv2DGradConfig2, + conv3DGradConfig2, + cosGradConfig2, + coshGradConfig2, + cumsumGradConfig2, + depthwiseConv2dNativeGradConfig2, + dilation2dGradConfig2, + divGradConfig2, + eluGradConfig4, + erfGradConfig2, + expGradConfig2, + expandDimsGradConfig2, + expm1GradConfig2, + floorDivGradConfig2, + floorGradConfig2, + fusedBatchNormGradConfig2, + gatherGradConfig2, + greaterEqualGradConfig2, + identityGradConfig2, + isFiniteGradConfig2, + isInfGradConfig2, + isNanGradConfig2, + leakyReluGradConfig2, + log1pGradConfig2, + logGradConfig2, + logSoftmaxGradConfig2, + lrnGradConfig2, + maxGradConfig2, + maxGradConfig2, + maximumGradConfig2, + maxPool3DGradConfig3, + maxPoolGradConfig4, + meanGradConfig2, + minGradConfig2, + minimumGradConfig2, + mirrorPadGradConfig2, + modGradConfig2, + multiplyGradConfig2, + negGradConfig2, + oneHotGradConfig2, + onesLikeGradConfig2, + packGradConfig2, + padV2GradConfig2, + padV2GradConfig2, + powGradConfig2, + preluGradConfig2, + reciprocalGradConfig2, + relu6GradConfig2, + reluGradConfig2, + reshapeGradConfig2, + resizeBilinearGradConfig4, + resizeNearestNeighborGradConfig4, + reverseGradConfig2, + roundGradConfig2, + rsqrtGradConfig2, + selectGradConfig2, + seluGradConfig2, + sigmoidGradConfig2, + signGradConfig2, + sinGradConfig2, + sinhGradConfig2, + sliceGradConfig2, + softmaxGradConfig2, + softplusGradConfig2, + spaceToBatchNDGradConfig2, + spaceToBatchNDGradConfig2, + splitVGradConfig2, + splitVGradConfig2, + sqrtGradConfig2, + squaredDifferenceGradConfig2, + squareGradConfig2, + stepGradConfig2, + subGradConfig2, + sumGradConfig2, + tanGradConfig2, + tanhGradConfig2, + tileGradConfig2, + transposeGradConfig2, + unpackGradConfig2, + unsortedSegmentSumGradConfig2, + zerosLikeGradConfig2 +]; +for (const gradientConfig of gradConfigs2) { + registerGradient2(gradientConfig); +} + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/abs.js +getGlobalTensorClass2().prototype.abs = function() { + this.throwIfDisposed(); + return abs4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acos.js +getGlobalTensorClass2().prototype.acos = function() { + this.throwIfDisposed(); + return acos4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/acosh.js +getGlobalTensorClass2().prototype.acosh = function() { + this.throwIfDisposed(); + return acosh4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/add.js +getGlobalTensorClass2().prototype.add = function(b) { + this.throwIfDisposed(); + return add6(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/all.js +getGlobalTensorClass2().prototype.all = function(axis, keepDims) { + this.throwIfDisposed(); + return all5(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/any.js +getGlobalTensorClass2().prototype.any = function(axis, keepDims) { + this.throwIfDisposed(); + return any5(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_max.js +getGlobalTensorClass2().prototype.argMax = function(axis) { + this.throwIfDisposed(); + return argMax4(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/arg_min.js +getGlobalTensorClass2().prototype.argMin = function(axis) { + this.throwIfDisposed(); + return argMin4(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_scalar.js +getGlobalTensorClass2().prototype.asScalar = function() { + this.throwIfDisposed(); + assert3(this.size === 1, () => "The array must have only 1 element."); + return reshape6(this, []); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as_type.js +getGlobalTensorClass2().prototype.asType = function(dtype) { + this.throwIfDisposed(); + return cast6(this, dtype); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as1d.js +getGlobalTensorClass2().prototype.as1D = function() { + this.throwIfDisposed(); + return reshape6(this, [this.size]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as2d.js +getGlobalTensorClass2().prototype.as2D = function(rows, columns) { + this.throwIfDisposed(); + return reshape6(this, [rows, columns]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as3d.js +getGlobalTensorClass2().prototype.as3D = function(rows, columns, depth) { + this.throwIfDisposed(); + return reshape6(this, [rows, columns, depth]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as4d.js +getGlobalTensorClass2().prototype.as4D = function(rows, columns, depth, depth2) { + this.throwIfDisposed(); + return reshape6(this, [rows, columns, depth, depth2]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/as5d.js +getGlobalTensorClass2().prototype.as5D = function(rows, columns, depth, depth2, depth3) { + this.throwIfDisposed(); + return reshape6(this, [rows, columns, depth, depth2, depth3]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asin.js +getGlobalTensorClass2().prototype.asin = function() { + this.throwIfDisposed(); + return asin4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/asinh.js +getGlobalTensorClass2().prototype.asinh = function() { + this.throwIfDisposed(); + return asinh4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan.js +getGlobalTensorClass2().prototype.atan = function() { + this.throwIfDisposed(); + return atan5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atan2.js +getGlobalTensorClass2().prototype.atan2 = function(b) { + this.throwIfDisposed(); + return atan24(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/atanh.js +getGlobalTensorClass2().prototype.atanh = function() { + this.throwIfDisposed(); + return atanh4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/avg_pool.js +getGlobalTensorClass2().prototype.avgPool = function(filterSize, strides, pad4, dimRoundingMode) { + this.throwIfDisposed(); + return avgPool5(this, filterSize, strides, pad4, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batch_to_space_nd.js +getGlobalTensorClass2().prototype.batchToSpaceND = function(blockShape, crops) { + this.throwIfDisposed(); + return batchToSpaceND5(this, blockShape, crops); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/batchnorm.js +getGlobalTensorClass2().prototype.batchNorm = function(mean6, variance, offset, scale4, varianceEpsilon) { + this.throwIfDisposed(); + return batchNorm4(this, mean6, variance, offset, scale4, varianceEpsilon); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/broadcast_to.js +getGlobalTensorClass2().prototype.broadcastTo = function(shape) { + this.throwIfDisposed(); + return broadcastTo2(this, shape); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cast.js +getGlobalTensorClass2().prototype.cast = function(dtype) { + this.throwIfDisposed(); + return cast6(this, dtype); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ceil.js +getGlobalTensorClass2().prototype.ceil = function() { + this.throwIfDisposed(); + return ceil4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/clip_by_value.js +getGlobalTensorClass2().prototype.clipByValue = function(min10, max10) { + this.throwIfDisposed(); + return clipByValue3(this, min10, max10); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/concat.js +getGlobalTensorClass2().prototype.concat = function(x, axis) { + this.throwIfDisposed(); + if (x instanceof Tensor2) { + x = [x]; + } + return concat5([this, ...x], axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv1d.js +getGlobalTensorClass2().prototype.conv1d = function(filter, stride, pad4, dataFormat, dilation, dimRoundingMode) { + this.throwIfDisposed(); + return conv1d3(this, filter, stride, pad4, dataFormat, dilation, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d_transpose.js +getGlobalTensorClass2().prototype.conv2dTranspose = function(filter, outputShape, strides, pad4, dimRoundingMode) { + this.throwIfDisposed(); + return conv2dTranspose3(this, filter, outputShape, strides, pad4, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/conv2d.js +getGlobalTensorClass2().prototype.conv2d = function(filter, strides, pad4, dataFormat, dilations, dimRoundingMode) { + this.throwIfDisposed(); + return conv2d6(this, filter, strides, pad4, dataFormat, dilations, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cos.js +getGlobalTensorClass2().prototype.cos = function() { + this.throwIfDisposed(); + return cos4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cosh.js +getGlobalTensorClass2().prototype.cosh = function() { + this.throwIfDisposed(); + return cosh4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/cumsum.js +getGlobalTensorClass2().prototype.cumsum = function(axis, exclusive, reverse8) { + this.throwIfDisposed(); + return cumsum5(this, axis, exclusive, reverse8); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depth_to_space.js +getGlobalTensorClass2().prototype.depthToSpace = function(blockSize, dataFormat) { + this.throwIfDisposed(); + return depthToSpace5(this, blockSize, dataFormat); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/depthwise_conv2d.js +getGlobalTensorClass2().prototype.depthwiseConv2d = function(filter, strides, pad4, dataFormat, dilations, dimRoundingMode) { + this.throwIfDisposed(); + return depthwiseConv2d6(this, filter, strides, pad4, dataFormat, dilations, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dilation2d.js +getGlobalTensorClass2().prototype.dilation2d = function(filter, strides, pad4, dilations, dataFormat) { + this.throwIfDisposed(); + return dilation2d2(this, filter, strides, pad4, dilations, dataFormat); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div_no_nan.js +getGlobalTensorClass2().prototype.divNoNan = function(b) { + this.throwIfDisposed(); + return divNoNan2(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/div.js +getGlobalTensorClass2().prototype.div = function(b) { + this.throwIfDisposed(); + return div3(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/dot.js +getGlobalTensorClass2().prototype.dot = function(b) { + this.throwIfDisposed(); + return dot6(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/elu.js +getGlobalTensorClass2().prototype.elu = function() { + this.throwIfDisposed(); + return elu6(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/equal.js +getGlobalTensorClass2().prototype.equal = function(b) { + this.throwIfDisposed(); + return equal4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/erf.js +getGlobalTensorClass2().prototype.erf = function() { + this.throwIfDisposed(); + return erf4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/exp.js +getGlobalTensorClass2().prototype.exp = function() { + this.throwIfDisposed(); + return exp4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expand_dims.js +getGlobalTensorClass2().prototype.expandDims = function(axis) { + this.throwIfDisposed(); + return expandDims6(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/expm1.js +getGlobalTensorClass2().prototype.expm1 = function() { + this.throwIfDisposed(); + return expm14(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/fft.js +getGlobalTensorClass2().prototype.fft = function() { + this.throwIfDisposed(); + return fft4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/flatten.js +getGlobalTensorClass2().prototype.flatten = function() { + this.throwIfDisposed(); + return reshape6(this, [this.size]); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floor.js +getGlobalTensorClass2().prototype.floor = function() { + this.throwIfDisposed(); + return floor4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/floorDiv.js +getGlobalTensorClass2().prototype.floorDiv = function(b) { + this.throwIfDisposed(); + return floorDiv4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/gather.js +getGlobalTensorClass2().prototype.gather = function(indices, axis) { + this.throwIfDisposed(); + return gather3(this, indices, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater_equal.js +getGlobalTensorClass2().prototype.greaterEqual = function(b) { + this.throwIfDisposed(); + return greaterEqual4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/greater.js +getGlobalTensorClass2().prototype.greater = function(b) { + this.throwIfDisposed(); + return greater5(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ifft.js +getGlobalTensorClass2().prototype.ifft = function() { + this.throwIfDisposed(); + return ifft4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/irfft.js +getGlobalTensorClass2().prototype.irfft = function() { + this.throwIfDisposed(); + return irfft2(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_finite.js +getGlobalTensorClass2().prototype.isFinite = function() { + this.throwIfDisposed(); + return isFinite5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_inf.js +getGlobalTensorClass2().prototype.isInf = function() { + this.throwIfDisposed(); + return isInf4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/is_nan.js +getGlobalTensorClass2().prototype.isNaN = function() { + this.throwIfDisposed(); + return isNaN5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/leaky_relu.js +getGlobalTensorClass2().prototype.leakyRelu = function(alpha) { + this.throwIfDisposed(); + return leakyRelu5(this, alpha); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less_equal.js +getGlobalTensorClass2().prototype.lessEqual = function(b) { + this.throwIfDisposed(); + return lessEqual4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/less.js +getGlobalTensorClass2().prototype.less = function(b) { + this.throwIfDisposed(); + return less5(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/local_response_normalization.js +getGlobalTensorClass2().prototype.localResponseNormalization = function(depthRadius, bias, alpha, beta) { + this.throwIfDisposed(); + return localResponseNormalization2(this, depthRadius, bias, alpha, beta); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sigmoid.js +getGlobalTensorClass2().prototype.logSigmoid = function() { + this.throwIfDisposed(); + return logSigmoid2(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_softmax.js +getGlobalTensorClass2().prototype.logSoftmax = function(axis) { + this.throwIfDisposed(); + return logSoftmax2(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log_sum_exp.js +getGlobalTensorClass2().prototype.logSumExp = function(axis, keepDims) { + this.throwIfDisposed(); + return logSumExp2(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log.js +getGlobalTensorClass2().prototype.log = function() { + this.throwIfDisposed(); + return log10(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/log1p.js +getGlobalTensorClass2().prototype.log1p = function() { + this.throwIfDisposed(); + return log1p4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_and.js +getGlobalTensorClass2().prototype.logicalAnd = function(b) { + this.throwIfDisposed(); + return logicalAnd4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_not.js +getGlobalTensorClass2().prototype.logicalNot = function() { + this.throwIfDisposed(); + return logicalNot4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_or.js +getGlobalTensorClass2().prototype.logicalOr = function(b) { + this.throwIfDisposed(); + return logicalOr4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/logical_xor.js +getGlobalTensorClass2().prototype.logicalXor = function(b) { + this.throwIfDisposed(); + return logicalXor2(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mat_mul.js +getGlobalTensorClass2().prototype.matMul = function(b, transposeA, transposeB) { + this.throwIfDisposed(); + return matMul3(this, b, transposeA, transposeB); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max_pool.js +getGlobalTensorClass2().prototype.maxPool = function(filterSize, strides, pad4, dimRoundingMode) { + this.throwIfDisposed(); + return maxPool5(this, filterSize, strides, pad4, dimRoundingMode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/max.js +getGlobalTensorClass2().prototype.max = function(axis, keepDims) { + this.throwIfDisposed(); + return max6(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/maximum.js +getGlobalTensorClass2().prototype.maximum = function(b) { + this.throwIfDisposed(); + return maximum5(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mean.js +getGlobalTensorClass2().prototype.mean = function(axis, keepDims) { + this.throwIfDisposed(); + return mean4(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/min.js +getGlobalTensorClass2().prototype.min = function(axis, keepDims) { + this.throwIfDisposed(); + return min6(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/minimum.js +getGlobalTensorClass2().prototype.minimum = function(b) { + this.throwIfDisposed(); + return minimum5(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mirror_pad.js +getGlobalTensorClass2().prototype.mirrorPad = function(paddings, mode) { + this.throwIfDisposed(); + return mirrorPad4(this, paddings, mode); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mod.js +getGlobalTensorClass2().prototype.mod = function(b) { + this.throwIfDisposed(); + return mod4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/mul.js +getGlobalTensorClass2().prototype.mul = function(b) { + this.throwIfDisposed(); + return mul2(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/neg.js +getGlobalTensorClass2().prototype.neg = function() { + this.throwIfDisposed(); + return neg4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/norm.js +getGlobalTensorClass2().prototype.norm = function(ord, axis, keepDims) { + this.throwIfDisposed(); + return norm2(this, ord, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/not_equal.js +getGlobalTensorClass2().prototype.notEqual = function(b) { + this.throwIfDisposed(); + return notEqual4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/one_hot.js +getGlobalTensorClass2().prototype.oneHot = function(depth, onValue = 1, offValue = 0) { + this.throwIfDisposed(); + return oneHot5(this, depth, onValue, offValue); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/ones_like.js +getGlobalTensorClass2().prototype.onesLike = function() { + this.throwIfDisposed(); + return onesLike5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pad.js +getGlobalTensorClass2().prototype.pad = function(paddings, constantValue) { + this.throwIfDisposed(); + return pad3(this, paddings, constantValue); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pool.js +getGlobalTensorClass2().prototype.pool = function(windowShape, poolingType, padding2, dilationRate, strides) { + this.throwIfDisposed(); + return pool3(this, windowShape, poolingType, padding2, dilationRate, strides); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/pow.js +getGlobalTensorClass2().prototype.pow = function(exp7) { + this.throwIfDisposed(); + return pow4(this, exp7); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prelu.js +getGlobalTensorClass2().prototype.prelu = function(alpha) { + this.throwIfDisposed(); + return prelu6(this, alpha); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/prod.js +getGlobalTensorClass2().prototype.prod = function(axis, keepDims) { + this.throwIfDisposed(); + return prod5(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reciprocal.js +getGlobalTensorClass2().prototype.reciprocal = function() { + this.throwIfDisposed(); + return reciprocal4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu.js +getGlobalTensorClass2().prototype.relu = function() { + this.throwIfDisposed(); + return relu4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/relu6.js +getGlobalTensorClass2().prototype.relu6 = function() { + this.throwIfDisposed(); + return relu64(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape_as.js +getGlobalTensorClass2().prototype.reshapeAs = function(x) { + this.throwIfDisposed(); + return reshape6(this, x.shape); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reshape.js +getGlobalTensorClass2().prototype.reshape = function(shape) { + this.throwIfDisposed(); + return reshape6(this, shape); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_bilinear.js +getGlobalTensorClass2().prototype.resizeBilinear = function(newShape2D, alignCorners, halfPixelCenters) { + this.throwIfDisposed(); + return resizeBilinear5(this, newShape2D, alignCorners, halfPixelCenters); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/resize_nearest_neighbor.js +getGlobalTensorClass2().prototype.resizeNearestNeighbor = function(newShape2D, alignCorners, halfFloatCenters) { + this.throwIfDisposed(); + return resizeNearestNeighbor4(this, newShape2D, alignCorners, halfFloatCenters); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/reverse.js +getGlobalTensorClass2().prototype.reverse = function(axis) { + this.throwIfDisposed(); + return reverse5(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rfft.js +getGlobalTensorClass2().prototype.rfft = function() { + this.throwIfDisposed(); + return rfft2(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/round.js +getGlobalTensorClass2().prototype.round = function() { + this.throwIfDisposed(); + return round6(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/rsqrt.js +getGlobalTensorClass2().prototype.rsqrt = function() { + this.throwIfDisposed(); + return rsqrt4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/selu.js +getGlobalTensorClass2().prototype.selu = function() { + this.throwIfDisposed(); + return selu4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/separable_conv2d.js +getGlobalTensorClass2().prototype.separableConv2d = function(depthwiseFilter, pointwiseFilter, strides, pad4, dilation, dataFormat) { + this.throwIfDisposed(); + return separableConv2d3(this, depthwiseFilter, pointwiseFilter, strides, pad4, dilation, dataFormat); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sigmoid.js +getGlobalTensorClass2().prototype.sigmoid = function() { + this.throwIfDisposed(); + return sigmoid5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sign.js +getGlobalTensorClass2().prototype.sign = function() { + this.throwIfDisposed(); + return sign4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sin.js +getGlobalTensorClass2().prototype.sin = function() { + this.throwIfDisposed(); + return sin4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sinh.js +getGlobalTensorClass2().prototype.sinh = function() { + this.throwIfDisposed(); + return sinh4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/slice.js +getGlobalTensorClass2().prototype.slice = function(begin, size2) { + this.throwIfDisposed(); + return slice5(this, begin, size2); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softmax.js +getGlobalTensorClass2().prototype.softmax = function(dim) { + this.throwIfDisposed(); + return softmax6(this, dim); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/softplus.js +getGlobalTensorClass2().prototype.softplus = function() { + this.throwIfDisposed(); + return softplus4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/space_to_batch_nd.js +getGlobalTensorClass2().prototype.spaceToBatchND = function(blockShape, paddings) { + this.throwIfDisposed(); + return spaceToBatchND5(this, blockShape, paddings); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/split.js +getGlobalTensorClass2().prototype.split = function(numOrSizeSplits, axis) { + this.throwIfDisposed(); + return split4(this, numOrSizeSplits, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sqrt.js +getGlobalTensorClass2().prototype.sqrt = function() { + this.throwIfDisposed(); + return sqrt4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/square.js +getGlobalTensorClass2().prototype.square = function() { + this.throwIfDisposed(); + return square4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squared_difference.js +getGlobalTensorClass2().prototype.squaredDifference = function(b) { + this.throwIfDisposed(); + return squaredDifference4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/squeeze.js +getGlobalTensorClass2().prototype.squeeze = function(axis) { + this.throwIfDisposed(); + return squeeze2(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/stack.js +getGlobalTensorClass2().prototype.stack = function(x, axis) { + this.throwIfDisposed(); + const tensorsToBeStacked = x instanceof Tensor2 ? [this, x] : [this, ...x]; + return stack2(tensorsToBeStacked, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/step.js +getGlobalTensorClass2().prototype.step = function(alpha) { + this.throwIfDisposed(); + return step5(this, alpha); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/strided_slice.js +getGlobalTensorClass2().prototype.stridedSlice = function(begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask) { + this.throwIfDisposed(); + return stridedSlice5(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sub.js +getGlobalTensorClass2().prototype.sub = function(b) { + this.throwIfDisposed(); + return sub4(this, b); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/sum.js +getGlobalTensorClass2().prototype.sum = function(axis, keepDims) { + this.throwIfDisposed(); + return sum7(this, axis, keepDims); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tan.js +getGlobalTensorClass2().prototype.tan = function() { + this.throwIfDisposed(); + return tan4(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tanh.js +getGlobalTensorClass2().prototype.tanh = function() { + this.throwIfDisposed(); + return tanh6(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/tile.js +getGlobalTensorClass2().prototype.tile = function(reps) { + this.throwIfDisposed(); + return tile6(this, reps); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_bool.js +getGlobalTensorClass2().prototype.toBool = function() { + this.throwIfDisposed(); + return cast6(this, "bool"); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_float.js +getGlobalTensorClass2().prototype.toFloat = function() { + this.throwIfDisposed(); + return cast6(this, "float32"); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/to_int.js +getGlobalTensorClass2().prototype.toInt = function() { + this.throwIfDisposed(); + return cast6(this, "int32"); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/topk.js +getGlobalTensorClass2().prototype.topk = function(k, sorted) { + this.throwIfDisposed(); + return topk3(this, k, sorted); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/transpose.js +getGlobalTensorClass2().prototype.transpose = function(perm) { + this.throwIfDisposed(); + return transpose5(this, perm); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unique.js +getGlobalTensorClass2().prototype.unique = function(axis) { + this.throwIfDisposed(); + return unique5(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unsorted_segment_sum.js +getGlobalTensorClass2().prototype.unsortedSegmentSum = function(segmentIds, numSegments) { + this.throwIfDisposed(); + return unsortedSegmentSum4(this, segmentIds, numSegments); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/unstack.js +getGlobalTensorClass2().prototype.unstack = function(axis) { + this.throwIfDisposed(); + return unstack2(this, axis); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/where.js +getGlobalTensorClass2().prototype.where = function(condition, x) { + this.throwIfDisposed(); + return where2(condition, this, x); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-core/dist/public/chained_ops/zeros_like.js +getGlobalTensorClass2().prototype.zerosLike = function() { + this.throwIfDisposed(); + return zerosLike5(this); +}; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js +var _epsilon2; +function epsilon3() { + if (_epsilon2 == null) { + _epsilon2 = backend2().epsilon(); + } + return _epsilon2; +} +function imageDataFormat2() { + return "channelsLast"; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/errors.js +var AttributeError2 = class extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, AttributeError2.prototype); + } +}; +var RuntimeError2 = class extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, RuntimeError2.prototype); + } +}; +var ValueError2 = class extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, ValueError2.prototype); + } +}; +var NotImplementedError2 = class extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, NotImplementedError2.prototype); + } +}; +var AssertionError2 = class extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, AssertionError2.prototype); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js +function pyListRepeat2(value, numValues) { + if (Array.isArray(value)) { + let newArray = []; + for (let i = 0; i < numValues; i++) { + newArray = newArray.concat(value); + } + return newArray; + } else { + const newArray = new Array(numValues); + newArray.fill(value); + return newArray; + } +} +function assert4(val, message) { + if (!val) { + throw new AssertionError2(message); + } +} +function count3(array3, refernce) { + let counter = 0; + for (const item of array3) { + if (item === refernce) { + counter++; + } + } + return counter; +} +function singletonOrArray2(xs) { + if (xs.length === 1) { + return xs[0]; + } + return xs; +} +function toList2(x) { + if (Array.isArray(x)) { + return x; + } + return [x]; +} +function toSnakeCase2(name) { + const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, "$1_$2"); + const insecure = intermediate.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase(); + if (insecure[0] !== "_") { + return insecure; + } + return "private" + insecure; +} +function toCamelCase2(identifier) { + if (identifier.length <= 1) { + return identifier; + } + if (identifier.indexOf("_") === -1) { + return identifier; + } + return identifier.replace(/[_]+(\w|$)/g, (m, p1) => p1.toUpperCase()); +} +var _GLOBAL_CUSTOM_OBJECTS2 = {}; +function serializeKerasObject2(instance) { + if (instance === null || instance === void 0) { + return null; + } + const dict = {}; + dict["className"] = instance.getClassName(); + dict["config"] = instance.getConfig(); + return dict; +} +function convertNDArrayScalarsInConfig2(config3) { + if (config3 == null || typeof config3 !== "object") { + return; + } else if (Array.isArray(config3)) { + config3.forEach((configItem) => convertNDArrayScalarsInConfig2(configItem)); + } else { + const fields = Object.keys(config3); + for (const field of fields) { + const value = config3[field]; + if (value != null && typeof value === "object") { + if (!Array.isArray(value) && value["type"] === "ndarray" && typeof value["value"] === "number") { + config3[field] = value["value"]; + } else { + convertNDArrayScalarsInConfig2(value); + } + } + } + } +} +function deserializeKerasObject2(identifier, moduleObjects = {}, customObjects = {}, printableModuleName = "object", fastWeightInit = false) { + if (typeof identifier === "string") { + const functionName = identifier; + let fn; + if (functionName in customObjects) { + fn = customObjects[functionName]; + } else if (functionName in _GLOBAL_CUSTOM_OBJECTS2) { + fn = _GLOBAL_CUSTOM_OBJECTS2[functionName]; + } else { + fn = moduleObjects[functionName]; + if (fn == null) { + throw new ValueError2(`Unknown ${printableModuleName}: ${identifier}. This may be due to one of the following reasons: +1. The ${printableModuleName} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${printableModuleName} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`); + } + } + return fn; + } else { + const config3 = identifier; + if (config3["className"] == null || config3["config"] == null) { + throw new ValueError2(`${printableModuleName}: Improper config format: ${JSON.stringify(config3)}. +'className' and 'config' must set.`); + } + const className = config3["className"]; + let cls, fromConfig; + if (className in customObjects) { + [cls, fromConfig] = customObjects[className]; + } else if (className in _GLOBAL_CUSTOM_OBJECTS2) { + [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS2["className"]; + } else if (className in moduleObjects) { + [cls, fromConfig] = moduleObjects[className]; + } + if (cls == null) { + throw new ValueError2(`Unknown ${printableModuleName}: ${className}. This may be due to one of the following reasons: +1. The ${printableModuleName} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code. +2. The custom ${printableModuleName} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`); + } + if (fromConfig != null) { + const customObjectsCombined = {}; + for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS2)) { + customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS2[key]; + } + for (const key of Object.keys(customObjects)) { + customObjectsCombined[key] = customObjects[key]; + } + const nestedConfig = config3["config"]; + nestedConfig["customObjects"] = customObjectsCombined; + const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS2); + for (const key of Object.keys(customObjects)) { + _GLOBAL_CUSTOM_OBJECTS2[key] = customObjects[key]; + } + convertNDArrayScalarsInConfig2(config3["config"]); + const returnObj = fromConfig(cls, config3["config"], customObjects, fastWeightInit); + _GLOBAL_CUSTOM_OBJECTS2 = Object.assign({}, backupCustomObjects); + return returnObj; + } else { + const backupCustomObjects = Object.assign({}, _GLOBAL_CUSTOM_OBJECTS2); + for (const key of Object.keys(customObjects)) { + _GLOBAL_CUSTOM_OBJECTS2[key] = customObjects[key]; + } + const returnObj = new cls(config3["config"]); + _GLOBAL_CUSTOM_OBJECTS2 = Object.assign({}, backupCustomObjects); + return returnObj; + } + } +} +function numberCompare2(a, b) { + return a < b ? -1 : a > b ? 1 : 0; +} +function reverseNumberCompare2(a, b) { + return -1 * numberCompare2(a, b); +} +function unique6(xs) { + if (xs == null) { + return xs; + } + const out = []; + for (const x of xs) { + if (out.indexOf(x) === -1) { + out.push(x); + } + } + return out; +} +function isObjectEmpty2(obj) { + if (obj == null) { + throw new ValueError2(`Invalid value in obj: ${JSON.stringify(obj)}`); + } + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + return false; + } + } + return true; +} +function checkStringTypeUnionValue2(values, label, value) { + if (value == null) { + return; + } + if (values.indexOf(value) < 0) { + throw new ValueError2(`${value} is not a valid ${label}. Valid values are ${values} or null/undefined.`); + } +} +function checkArrayTypeAndLength2(x, expectedType, minLength = 0, maxLength = Infinity) { + assert4(minLength >= 0); + assert4(maxLength >= minLength); + return Array.isArray(x) && x.length >= minLength && x.length <= maxLength && x.every((e) => typeof e === expectedType); +} +function assertPositiveInteger2(value, name) { + if (Array.isArray(value)) { + util_exports2.assert(value.length > 0, () => `${name} is unexpectedly an empty array.`); + value.forEach((v, i) => assertPositiveInteger2(v, `element ${i + 1} of ${name}`)); + } else { + util_exports2.assert(Number.isInteger(value) && value > 0, () => `Expected ${name} to be a positive integer, but got ${formatAsFriendlyString2(value)}.`); + } +} +function formatAsFriendlyString2(value) { + if (value === null) { + return "null"; + } else if (Array.isArray(value)) { + return "[" + value.map((v) => formatAsFriendlyString2(v)).join(",") + "]"; + } else if (typeof value === "string") { + return `"${value}"`; + } else { + return `${value}`; + } +} +function debounce2(f, waitMs) { + let lastTime = util_exports2.now(); + let lastResult; + const f2 = (...args) => { + const now4 = util_exports2.now(); + if (now4 - lastTime < waitMs) { + return lastResult; + } + lastTime = now4; + lastResult = f(...args); + return lastResult; + }; + return f2; +} +function mapActivationToFusedKernel2(activationName) { + if (activationName === "relu") { + return "relu"; + } + if (activationName === "linear") { + return "linear"; + } + if (activationName === "elu") { + return "elu"; + } + return null; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/constraints.js +function calcL2Norms2(w, axis) { + return tidy2(() => sqrt4(sum7(mul2(w, w), axis, true))); +} +var Constraint2 = class extends serialization_exports2.Serializable { + getConfig() { + return {}; + } +}; +var MaxNorm2 = class extends Constraint2 { + constructor(args) { + super(); + this.defaultMaxValue = 2; + this.defaultAxis = 0; + this.maxValue = args.maxValue != null ? args.maxValue : this.defaultMaxValue; + this.axis = args.axis != null ? args.axis : this.defaultAxis; + } + apply(w) { + return tidy2(() => { + const norms = calcL2Norms2(w, this.axis); + const desired = clipByValue3(norms, 0, this.maxValue); + return mul2(w, div3(desired, add6(epsilon3(), norms))); + }); + } + getConfig() { + return { maxValue: this.maxValue, axis: this.axis }; + } +}; +MaxNorm2.className = "MaxNorm"; +serialization_exports2.registerClass(MaxNorm2); +var UnitNorm2 = class extends Constraint2 { + constructor(args) { + super(); + this.defaultAxis = 0; + this.axis = args.axis != null ? args.axis : this.defaultAxis; + } + apply(w) { + return tidy2(() => div3(w, add6(epsilon3(), calcL2Norms2(w, this.axis)))); + } + getConfig() { + return { axis: this.axis }; + } +}; +UnitNorm2.className = "UnitNorm"; +serialization_exports2.registerClass(UnitNorm2); +var NonNeg2 = class extends Constraint2 { + apply(w) { + return relu4(w); + } +}; +NonNeg2.className = "NonNeg"; +serialization_exports2.registerClass(NonNeg2); +var MinMaxNorm2 = class extends Constraint2 { + constructor(args) { + super(); + this.defaultMinValue = 0; + this.defaultMaxValue = 1; + this.defaultRate = 1; + this.defaultAxis = 0; + this.minValue = args.minValue != null ? args.minValue : this.defaultMinValue; + this.maxValue = args.maxValue != null ? args.maxValue : this.defaultMaxValue; + this.rate = args.rate != null ? args.rate : this.defaultRate; + this.axis = args.axis != null ? args.axis : this.defaultAxis; + } + apply(w) { + return tidy2(() => { + const norms = calcL2Norms2(w, this.axis); + const desired = add6(mul2(this.rate, clipByValue3(norms, this.minValue, this.maxValue)), mul2(1 - this.rate, norms)); + return mul2(w, div3(desired, add6(epsilon3(), norms))); + }); + } + getConfig() { + return { + minValue: this.minValue, + maxValue: this.maxValue, + rate: this.rate, + axis: this.axis + }; + } +}; +MinMaxNorm2.className = "MinMaxNorm"; +serialization_exports2.registerClass(MinMaxNorm2); +var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP2 = { + "maxNorm": "MaxNorm", + "minMaxNorm": "MinMaxNorm", + "nonNeg": "NonNeg", + "unitNorm": "UnitNorm" +}; +function serializeConstraint2(constraint) { + return serializeKerasObject2(constraint); +} +function deserializeConstraint2(config3, customObjects = {}) { + return deserializeKerasObject2(config3, serialization_exports2.SerializationMap.getMap().classNameMap, customObjects, "constraint"); +} +function getConstraint2(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === "string") { + const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP2 ? CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP2[identifier] : identifier; + const config3 = { className, config: {} }; + return deserializeConstraint2(config3); + } else if (identifier instanceof Constraint2) { + return identifier; + } else { + return deserializeConstraint2(identifier); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/keras_format/common.js +var VALID_DATA_FORMAT_VALUES2 = ["channelsFirst", "channelsLast"]; +var VALID_INTERPOLATION_FORMAT_VALUES2 = ["nearest", "bilinear"]; +var VALID_PADDING_MODE_VALUES2 = ["valid", "same", "causal"]; +var VALID_POOL_MODE_VALUES2 = ["max", "avg"]; +var VALID_BIDIRECTIONAL_MERGE_MODES2 = ["sum", "mul", "concat", "ave"]; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/common.js +var nameMap2 = new Map(); +function checkDataFormat2(value) { + checkStringTypeUnionValue2(VALID_DATA_FORMAT_VALUES2, "DataFormat", value); +} +function checkInterpolationFormat2(value) { + checkStringTypeUnionValue2(VALID_INTERPOLATION_FORMAT_VALUES2, "InterpolationFormat", value); +} +function checkPaddingMode2(value) { + checkStringTypeUnionValue2(VALID_PADDING_MODE_VALUES2, "PaddingMode", value); +} +function checkPoolMode2(value) { + checkStringTypeUnionValue2(VALID_POOL_MODE_VALUES2, "PoolMode", value); +} +var _nameScopeStack2 = []; +var _nameScopeDivider2 = "/"; +function nameScope2(name, fn) { + _nameScopeStack2.push(name); + try { + const val = fn(); + _nameScopeStack2.pop(); + return val; + } catch (e) { + _nameScopeStack2.pop(); + throw e; + } +} +function currentNameScopePrefix2() { + if (_nameScopeStack2.length === 0) { + return ""; + } else { + return _nameScopeStack2.join(_nameScopeDivider2) + _nameScopeDivider2; + } +} +function getScopedTensorName2(tensorName) { + if (!isValidTensorName2(tensorName)) { + throw new Error("Not a valid tensor name: '" + tensorName + "'"); + } + return currentNameScopePrefix2() + tensorName; +} +function getUniqueTensorName2(scopedName) { + if (!isValidTensorName2(scopedName)) { + throw new Error("Not a valid tensor name: '" + scopedName + "'"); + } + if (!nameMap2.has(scopedName)) { + nameMap2.set(scopedName, 0); + } + const index = nameMap2.get(scopedName); + nameMap2.set(scopedName, nameMap2.get(scopedName) + 1); + if (index > 0) { + const result = `${scopedName}_${index}`; + nameMap2.set(result, 1); + return result; + } else { + return scopedName; + } +} +var tensorNameRegex2 = new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/); +function isValidTensorName2(name) { + return !!name.match(tensorNameRegex2); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js +function isInteger2(x) { + return x === parseInt(x.toString(), 10); +} +function arrayProd2(array3, begin, end) { + if (begin == null) { + begin = 0; + } + if (end == null) { + end = array3.length; + } + let prod8 = 1; + for (let i = begin; i < end; ++i) { + prod8 *= array3[i]; + } + return prod8; +} +function min7(array3) { + if (array3.length === 0) { + return Number.NaN; + } + let min10 = Number.POSITIVE_INFINITY; + for (let i = 0; i < array3.length; i++) { + const value = array3[i]; + if (value < min10) { + min10 = value; + } + } + return min10; +} +function max7(array3) { + if (array3.length === 0) { + return Number.NaN; + } + let max10 = Number.NEGATIVE_INFINITY; + for (let i = 0; i < array3.length; i++) { + const value = array3[i]; + if (value > max10) { + max10 = value; + } + } + return max10; +} +function range7(begin, end) { + if (end < begin) { + throw new ValueError2(`end (${end}) < begin (${begin}) is forbidden.`); + } + const out = []; + for (let i = begin; i < end; ++i) { + out.push(i); + } + return out; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js +function cast7(x, dtype) { + return cast6(x, dtype); +} +function expandDims7(x, axis = -1) { + const outShape = x.shape.slice(); + if (axis < 0) { + axis = outShape.length + axis + 1; + } + outShape.splice(axis, 0, 1); + return reshape6(x, outShape); +} +function repeat2(x, n) { + return tidy2(() => { + if (x.shape.length !== 2) { + throw new ValueError2(`repeat() expects a rank-2 tensor, but received a rank-${x.shape.length} tensor.`); + } + const y = expandDims7(x, 1); + return tile7(y, [1, n, 1]); + }); +} +function flatten5(x) { + const newShape = [arrayProd2(x.shape)]; + return reshape6(x, newShape); +} +function batchFlatten2(x) { + if (x.rank <= 1) { + throw new ValueError2(`batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`); + } + const newShape = [x.shape[0], arrayProd2(x.shape, 1)]; + return reshape6(x, newShape); +} +function sliceAlongFirstAxis2(array3, start, size2) { + return tidy2(() => { + switch (array3.rank) { + case 1: + return slice1d2(array3, start, size2); + case 2: + return slice2d3(array3, [start, 0], [size2, array3.shape[1]]); + case 3: + return slice3d3(array3, [start, 0, 0], [size2, array3.shape[1], array3.shape[2]]); + case 4: + return slice4d3(array3, [start, 0, 0, 0], [size2, array3.shape[1], array3.shape[2], array3.shape[3]]); + case 5: + return slice5(array3, [start, 0, 0, 0, 0], [ + size2, + array3.shape[1], + array3.shape[2], + array3.shape[3], + array3.shape[4] + ]); + case 6: + return slice5(array3, [start, 0, 0, 0, 0, 0], [ + size2, + array3.shape[1], + array3.shape[2], + array3.shape[3], + array3.shape[4], + array3.shape[5] + ]); + default: + throw new ValueError2(`sliceAlongFirstAxis() received an unsupported tensor rank: ${array3.rank}`); + } + }); +} +function sliceAlongLastAxis2(array3, start, size2) { + return tidy2(() => { + switch (array3.rank) { + case 1: + return slice1d2(array3, start, size2); + case 2: + return slice2d3(array3, [0, start], [array3.shape[0], size2]); + case 3: + return slice3d3(array3, [0, 0, start], [array3.shape[0], array3.shape[1], size2]); + case 4: + return slice4d3(array3, [0, 0, 0, start], [array3.shape[0], array3.shape[1], array3.shape[2], size2]); + default: + throw new ValueError2(`sliceAlongLastAxis() received an unsupported tensor rank: ${array3.rank}`); + } + }); +} +function sliceAlongAxis2(array3, start, size2, axis) { + return tidy2(() => { + switch (array3.rank) { + case 1: + return slice1d2(array3, start, size2); + case 2: + switch (axis) { + case 1: + return sliceAlongFirstAxis2(array3, start, size2); + case 2: + return sliceAlongLastAxis2(array3, start, size2); + default: + throw new ValueError2(`The axis is not within the rank of the tensor ${axis}`); + } + case 3: + switch (axis) { + case 1: + return sliceAlongFirstAxis2(array3, start, size2); + case 2: + return slice3d3(array3, [0, start, 0], [array3.shape[0], size2, array3.shape[2]]); + case 3: + return sliceAlongLastAxis2(array3, start, size2); + default: + throw new ValueError2(`The axis is not within the rank of the tensor ${axis}`); + } + case 4: + switch (axis) { + case 1: + return sliceAlongFirstAxis2(array3, start, size2); + case 2: + return slice4d3(array3, [0, start, 0, 0], [array3.shape[0], size2, array3.shape[2], array3.shape[3]]); + case 3: + return slice4d3(array3, [0, 0, start, 0], [array3.shape[0], array3.shape[1], size2, array3.shape[3]]); + case 4: + return sliceAlongLastAxis2(array3, start, size2); + default: + throw new ValueError2(`The axis is not within the rank of the tensor ${axis}`); + } + default: + throw new ValueError2(`sliceAlongLastAxis() received an unsupported tensor rank: ${array3.rank}`); + } + }); +} +function concatenate3(tensors, axis = -1) { + let rank; + if (axis < 0) { + rank = tensors[0].rank; + if (rank !== 0) { + axis = rank; + } else { + axis = 0; + } + } + if (axis === tensors[0].rank) { + axis = -1; + } + return concat5(tensors, axis); +} +function concatAlongFirstAxis2(a, b) { + switch (a.rank) { + case 1: + return concat1d2([a, b]); + case 2: + return concat2d2([a, b], 0); + case 3: + return concat3d2([a, b], 0); + case 4: + return concat4d2([a, b], 0); + default: + throw new ValueError2(`concatAlongFirstAxis() received an unsupported tensor rank: ${a.rank}`); + } +} +function tile7(x, n) { + if (!Array.isArray(n)) { + n = [n]; + } + if (x.rank !== n.length) { + throw new ValueError2(`The length of input n (${n.length}) does not match the number of dimensions in input x (${x.rank})`); + } + return tile6(x, n); +} +function randomNormal5(shape, mean6 = 0, stddev = 1, dtype, seed) { + return randomNormal4(shape, mean6, stddev, dtype, seed); +} +function dot7(a, b, activation2, bias) { + if (a.rank < 2 || b.rank < 2) { + throw new NotImplementedError2(`dot requires both inputs to be rank >= 2 but got x shape = ${a.shape} and y shape = ${b.shape}`); + } + if (b.rank >= 3) { + const xLastDim = a.shape.slice(-1)[0]; + const ySecondLastDim = b.shape.slice(-2)[0]; + if (xLastDim !== ySecondLastDim) { + throw new NotImplementedError2(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${a.shape} and y shape = ${b.shape}`); + } + } + if (a.rank === 2 && b.rank === 2) { + const transposeA = false; + const transposeB = false; + return fused_ops_exports2.matMul({ + a, + b, + transposeA, + transposeB, + bias: bias ? reshapeBias2(a.rank, bias, imageDataFormat2()) : null, + activation: activation2 + }); + } else { + const aFirstDims = a.shape.slice(); + const aLastDim = aFirstDims.pop(); + a = reshape6(a, [-1, aLastDim]); + const bShape = b.shape.slice(); + const bLastDim = bShape.pop(); + const ySecondLastDim = bShape.pop(); + const yOtherDims = [...bShape, bLastDim]; + const perm = Array.from({ length: b.rank }, (_, i) => { + if (i === 0) { + return b.rank - 2; + } else if (i <= b.rank - 2) { + return i - 1; + } + return i; + }); + b = reshape6(transpose5(b, perm), [ySecondLastDim, -1]); + const outputShape = [...aFirstDims, ...yOtherDims]; + const transposeA = false; + const transposeB = false; + return reshape6(fused_ops_exports2.matMul({ + a, + b, + transposeA, + transposeB, + bias: bias ? reshapeBias2(a.rank, bias, imageDataFormat2()) : null, + activation: activation2 + }), outputShape); + } +} +function gather4(reference, indices, axis) { + return tidy2(() => { + if (Array.isArray(indices)) { + indices = tensor1d2(indices, "int32"); + } else { + indices = cast6(indices, "int32"); + } + return gather3(reference, indices, axis); + }); +} +function square5(x) { + return mul2(x, x); +} +function reshapeBias2(xRank, bias, dataFormat) { + const biasShape = bias.shape; + if (bias.rank !== 1 && bias.rank !== xRank) { + throw new ValueError2(`Unexpected bias dimensions: ${bias.rank}; expected it to be 1 or ${xRank}`); + } + if (xRank === 5) { + if (dataFormat === "channelsFirst") { + if (biasShape.length === 1) { + return reshape6(bias, [1, biasShape[0], 1, 1, 1]); + } else { + return reshape6(bias, [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]); + } + } else if (dataFormat === "channelsLast") { + if (biasShape.length === 1) { + return reshape6(bias, [1, 1, 1, 1, biasShape[0]]); + } else { + return reshape6(bias, [1].concat(biasShape)); + } + } + } else if (xRank === 4) { + if (dataFormat === "channelsFirst") { + if (biasShape.length === 1) { + return reshape6(bias, [1, biasShape[0], 1, 1]); + } else { + return reshape6(bias, [1, biasShape[2], biasShape[0], biasShape[1]]); + } + } else if (dataFormat === "channelsLast") { + if (biasShape.length === 1) { + return reshape6(bias, [1, 1, 1, biasShape[0]]); + } else { + return reshape6(bias, [1].concat(biasShape)); + } + } + } else if (xRank === 3) { + if (dataFormat === "channelsFirst") { + if (biasShape.length === 1) { + return reshape6(bias, [1, biasShape[0], 1]); + } else { + return reshape6(bias, [1, biasShape[1], biasShape[0]]); + } + } else if (dataFormat === "channelsLast") { + if (biasShape.length === 1) { + return reshape6(bias, [1, 1, biasShape[0]]); + } else { + return reshape6(bias, [1].concat(biasShape)); + } + } + } else if (xRank < 3) { + return bias; + } + throw new ValueError2(`Unsupported input rank by biasAdd: ${bias.rank}`); +} +function biasAdd2(x, bias, dataFormat) { + return tidy2(() => { + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + checkDataFormat2(dataFormat); + return add6(x, reshapeBias2(x.rank, bias, dataFormat)); + }); +} +function elu7(x, alpha = 1) { + if (alpha !== 1) { + throw new NotImplementedError2(`Support for alpha values other than 1 (${alpha}) is not implemented yet.`); + } + return elu6(x); +} +function softsign2(x) { + return tidy2(() => div3(x, add6(abs4(x), 1))); +} +function dropout5(x, level, noiseShape, seed) { + return tidy2(() => dropout4(x, level, noiseShape, seed)); +} +function hardSigmoid2(x) { + return tidy2(() => { + const y = add6(0.5, mul2(0.2, x)); + return clipByValue3(y, 0, 1); + }); +} +function inTrainPhase2(x, alt, training = false) { + return training ? x() : alt(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/keras_format/initializer_config.js +var VALID_FAN_MODE_VALUES2 = ["fanIn", "fanOut", "fanAvg"]; +var VALID_DISTRIBUTION_VALUES2 = ["normal", "uniform", "truncatedNormal"]; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/initializers.js +function checkFanMode2(value) { + checkStringTypeUnionValue2(VALID_FAN_MODE_VALUES2, "FanMode", value); +} +function checkDistribution2(value) { + checkStringTypeUnionValue2(VALID_DISTRIBUTION_VALUES2, "Distribution", value); +} +var Initializer2 = class extends serialization_exports2.Serializable { + fromConfigUsesCustomObjects() { + return false; + } + getConfig() { + return {}; + } +}; +var Zeros2 = class extends Initializer2 { + apply(shape, dtype) { + return zeros4(shape, dtype); + } +}; +Zeros2.className = "Zeros"; +serialization_exports2.registerClass(Zeros2); +var Ones2 = class extends Initializer2 { + apply(shape, dtype) { + return ones5(shape, dtype); + } +}; +Ones2.className = "Ones"; +serialization_exports2.registerClass(Ones2); +var Constant2 = class extends Initializer2 { + constructor(args) { + super(); + if (typeof args !== "object") { + throw new ValueError2(`Expected argument of type ConstantConfig but got ${args}`); + } + if (args.value === void 0) { + throw new ValueError2(`config must have value set but got ${args}`); + } + this.value = args.value; + } + apply(shape, dtype) { + return tidy2(() => mul2(scalar2(this.value), ones5(shape, dtype))); + } + getConfig() { + return { + value: this.value + }; + } +}; +Constant2.className = "Constant"; +serialization_exports2.registerClass(Constant2); +var RandomUniform2 = class extends Initializer2 { + constructor(args) { + super(); + this.DEFAULT_MINVAL = -0.05; + this.DEFAULT_MAXVAL = 0.05; + this.minval = args.minval || this.DEFAULT_MINVAL; + this.maxval = args.maxval || this.DEFAULT_MAXVAL; + this.seed = args.seed; + } + apply(shape, dtype) { + return randomUniform3(shape, this.minval, this.maxval, dtype); + } + getConfig() { + return { minval: this.minval, maxval: this.maxval, seed: this.seed }; + } +}; +RandomUniform2.className = "RandomUniform"; +serialization_exports2.registerClass(RandomUniform2); +var RandomNormal2 = class extends Initializer2 { + constructor(args) { + super(); + this.DEFAULT_MEAN = 0; + this.DEFAULT_STDDEV = 0.05; + this.mean = args.mean || this.DEFAULT_MEAN; + this.stddev = args.stddev || this.DEFAULT_STDDEV; + this.seed = args.seed; + } + apply(shape, dtype) { + dtype = dtype || "float32"; + if (dtype !== "float32" && dtype !== "int32") { + throw new NotImplementedError2(`randomNormal does not support dType ${dtype}.`); + } + return randomNormal5(shape, this.mean, this.stddev, dtype, this.seed); + } + getConfig() { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + } +}; +RandomNormal2.className = "RandomNormal"; +serialization_exports2.registerClass(RandomNormal2); +var TruncatedNormal2 = class extends Initializer2 { + constructor(args) { + super(); + this.DEFAULT_MEAN = 0; + this.DEFAULT_STDDEV = 0.05; + this.mean = args.mean || this.DEFAULT_MEAN; + this.stddev = args.stddev || this.DEFAULT_STDDEV; + this.seed = args.seed; + } + apply(shape, dtype) { + dtype = dtype || "float32"; + if (dtype !== "float32" && dtype !== "int32") { + throw new NotImplementedError2(`truncatedNormal does not support dType ${dtype}.`); + } + return truncatedNormal3(shape, this.mean, this.stddev, dtype, this.seed); + } + getConfig() { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + } +}; +TruncatedNormal2.className = "TruncatedNormal"; +serialization_exports2.registerClass(TruncatedNormal2); +var Identity4 = class extends Initializer2 { + constructor(args) { + super(); + this.gain = args.gain != null ? args.gain : 1; + } + apply(shape, dtype) { + return tidy2(() => { + if (shape.length !== 2 || shape[0] !== shape[1]) { + throw new ValueError2("Identity matrix initializer can only be used for 2D square matrices."); + } else { + return mul2(this.gain, eye2(shape[0])); + } + }); + } + getConfig() { + return { gain: this.gain }; + } +}; +Identity4.className = "Identity"; +serialization_exports2.registerClass(Identity4); +function computeFans2(shape, dataFormat = "channelsLast") { + let fanIn; + let fanOut; + checkDataFormat2(dataFormat); + if (shape.length === 2) { + fanIn = shape[0]; + fanOut = shape[1]; + } else if ([3, 4, 5].indexOf(shape.length) !== -1) { + if (dataFormat === "channelsFirst") { + const receptiveFieldSize = arrayProd2(shape, 2); + fanIn = shape[1] * receptiveFieldSize; + fanOut = shape[0] * receptiveFieldSize; + } else if (dataFormat === "channelsLast") { + const receptiveFieldSize = arrayProd2(shape, 0, shape.length - 2); + fanIn = shape[shape.length - 2] * receptiveFieldSize; + fanOut = shape[shape.length - 1] * receptiveFieldSize; + } + } else { + const shapeProd = arrayProd2(shape); + fanIn = Math.sqrt(shapeProd); + fanOut = Math.sqrt(shapeProd); + } + return [fanIn, fanOut]; +} +var VarianceScaling2 = class extends Initializer2 { + constructor(args) { + super(); + if (args.scale < 0) { + throw new ValueError2(`scale must be a positive float. Got: ${args.scale}`); + } + this.scale = args.scale == null ? 1 : args.scale; + this.mode = args.mode == null ? "fanIn" : args.mode; + checkFanMode2(this.mode); + this.distribution = args.distribution == null ? "normal" : args.distribution; + checkDistribution2(this.distribution); + this.seed = args.seed; + } + apply(shape, dtype) { + const fans = computeFans2(shape); + const fanIn = fans[0]; + const fanOut = fans[1]; + let scale4 = this.scale; + if (this.mode === "fanIn") { + scale4 /= Math.max(1, fanIn); + } else if (this.mode === "fanOut") { + scale4 /= Math.max(1, fanOut); + } else { + scale4 /= Math.max(1, (fanIn + fanOut) / 2); + } + if (this.distribution === "normal") { + const stddev = Math.sqrt(scale4); + dtype = dtype || "float32"; + if (dtype !== "float32" && dtype !== "int32") { + throw new NotImplementedError2(`${this.getClassName()} does not support dType ${dtype}.`); + } + return truncatedNormal3(shape, 0, stddev, dtype, this.seed); + } else { + const limit = Math.sqrt(3 * scale4); + return randomUniform3(shape, -limit, limit, dtype); + } + } + getConfig() { + return { + scale: this.scale, + mode: this.mode, + distribution: this.distribution, + seed: this.seed + }; + } +}; +VarianceScaling2.className = "VarianceScaling"; +serialization_exports2.registerClass(VarianceScaling2); +var GlorotUniform2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 1, + mode: "fanAvg", + distribution: "uniform", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +GlorotUniform2.className = "GlorotUniform"; +serialization_exports2.registerClass(GlorotUniform2); +var GlorotNormal2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 1, + mode: "fanAvg", + distribution: "normal", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +GlorotNormal2.className = "GlorotNormal"; +serialization_exports2.registerClass(GlorotNormal2); +var HeNormal2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 2, + mode: "fanIn", + distribution: "normal", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +HeNormal2.className = "HeNormal"; +serialization_exports2.registerClass(HeNormal2); +var HeUniform2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 2, + mode: "fanIn", + distribution: "uniform", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +HeUniform2.className = "HeUniform"; +serialization_exports2.registerClass(HeUniform2); +var LeCunNormal2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 1, + mode: "fanIn", + distribution: "normal", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +LeCunNormal2.className = "LeCunNormal"; +serialization_exports2.registerClass(LeCunNormal2); +var LeCunUniform2 = class extends VarianceScaling2 { + constructor(args) { + super({ + scale: 1, + mode: "fanIn", + distribution: "uniform", + seed: args == null ? null : args.seed + }); + } + getClassName() { + return VarianceScaling2.className; + } +}; +LeCunUniform2.className = "LeCunNormal"; +serialization_exports2.registerClass(LeCunUniform2); +var Orthogonal2 = class extends Initializer2 { + constructor(args) { + super(); + this.DEFAULT_GAIN = 1; + this.gain = args.gain == null ? this.DEFAULT_GAIN : args.gain; + this.seed = args.seed; + if (this.seed != null) { + throw new NotImplementedError2("Random seed is not implemented for Orthogonal Initializer yet."); + } + } + apply(shape, dtype) { + return tidy2(() => { + if (shape.length < 2) { + throw new NotImplementedError2("Shape must be at least 2D."); + } + if (shape[0] * shape[1] > 2e3) { + console.warn(`Orthogonal initializer is being called on a matrix with more than 2000 (${shape[0] * shape[1]}) elements: Slowness may result.`); + } + const normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; + const a = randomNormal5(normalizedShape, 0, 1, "float32"); + let q = linalg2.gramSchmidt(a); + if (shape[0] > shape[1]) { + q = transpose5(q); + } + return mul2(this.gain, q); + }); + } + getConfig() { + return { + gain: this.gain, + seed: this.seed + }; + } +}; +Orthogonal2.className = "Orthogonal"; +serialization_exports2.registerClass(Orthogonal2); +var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2 = { + "constant": "Constant", + "glorotNormal": "GlorotNormal", + "glorotUniform": "GlorotUniform", + "heNormal": "HeNormal", + "heUniform": "HeUniform", + "identity": "Identity", + "leCunNormal": "LeCunNormal", + "leCunUniform": "LeCunUniform", + "ones": "Ones", + "orthogonal": "Orthogonal", + "randomNormal": "RandomNormal", + "randomUniform": "RandomUniform", + "truncatedNormal": "TruncatedNormal", + "varianceScaling": "VarianceScaling", + "zeros": "Zeros" +}; +function deserializeInitializer2(config3, customObjects = {}) { + return deserializeKerasObject2(config3, serialization_exports2.SerializationMap.getMap().classNameMap, customObjects, "initializer"); +} +function serializeInitializer2(initializer) { + return serializeKerasObject2(initializer); +} +function getInitializer2(identifier) { + if (typeof identifier === "string") { + const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2 ? INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2[identifier] : identifier; + if (className === "GlorotNormal") { + return new GlorotNormal2(); + } else if (className === "GlorotUniform") { + return new GlorotUniform2(); + } else if (className === "HeNormal") { + return new HeNormal2(); + } else if (className === "HeUniform") { + return new HeUniform2(); + } else if (className === "LeCunNormal") { + return new LeCunNormal2(); + } else if (className === "LeCunUniform") { + return new LeCunUniform2(); + } else { + const config3 = {}; + config3["className"] = className; + config3["config"] = {}; + return deserializeInitializer2(config3); + } + } else if (identifier instanceof Initializer2) { + return identifier; + } else { + return deserializeInitializer2(identifier); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js +var _nextUniqueTensorId2 = 0; +function getNextUniqueTensorId2() { + return _nextUniqueTensorId2++; +} +var _uidPrefixes2 = {}; +function getUid2(prefix = "") { + if (!(prefix in _uidPrefixes2)) { + _uidPrefixes2[prefix] = 0; + } + _uidPrefixes2[prefix] += 1; + return prefix + _uidPrefixes2[prefix].toString(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js +function isArrayOfShapes2(x) { + return Array.isArray(x) && Array.isArray(x[0]); +} +function normalizeShapeList2(x) { + if (x.length === 0) { + return []; + } + if (!Array.isArray(x[0])) { + return [x]; + } + return x; +} +function getExactlyOneTensor2(xs) { + let x; + if (Array.isArray(xs)) { + if (xs.length !== 1) { + throw new ValueError2(`Expected Tensor length to be 1; got ${xs.length}`); + } + x = xs[0]; + } else { + x = xs; + } + return x; +} +function getExactlyOneShape2(shapes) { + if (Array.isArray(shapes) && Array.isArray(shapes[0])) { + if (shapes.length === 1) { + shapes = shapes; + return shapes[0]; + } else { + throw new ValueError2(`Expected exactly 1 Shape; got ${shapes.length}`); + } + } else { + return shapes; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js +function countParamsInWeights2(weights) { + let count4 = 0; + for (const weight of weights) { + if (weight.shape.length === 0) { + count4 += 1; + } else { + count4 += weight.shape.reduce((a, b) => a * b); + } + } + return count4; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/variables.js +var DEFAULT_VARIABLE_NAME_PREFIX2 = "Variable"; +var LayerVariable2 = class { + constructor(val, dtype = "float32", name = DEFAULT_VARIABLE_NAME_PREFIX2, trainable = true, constraint = null) { + this.dtype = dtype == null ? "float32" : dtype; + this.shape = val.shape; + this.id = getNextUniqueTensorId2(); + name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX2 : name; + this.originalName = getScopedTensorName2(name); + this.name = getUniqueTensorName2(this.originalName); + this.trainable_ = trainable; + this.constraint = constraint; + this.val = variable2(val, this.trainable_, this.name, this.dtype); + } + read() { + this.assertNotDisposed(); + return this.val; + } + write(newVal) { + this.assertNotDisposed(); + checkShapesMatch2(this.val, newVal); + if (this.val.id !== newVal.id) { + this.val.assign(newVal); + if (this.constraint != null) { + this.val.assign(this.constraint.apply(this.val)); + } + } + return this; + } + dispose() { + this.assertNotDisposed(); + this.val.dispose(); + } + assertNotDisposed() { + if (this.val.isDisposed) { + throw new Error(`LayersVariable ${this.name} is already disposed.`); + } + } + get trainable() { + return this.trainable_; + } + set trainable(trainable) { + this.trainable_ = trainable; + this.val.trainable = trainable; + } +}; +function checkShapesMatch2(x, y) { + if (x.shape.toString() !== y.shape.toString()) { + throw new Error("Shape mismatch: " + JSON.stringify(x.shape) + " vs. " + JSON.stringify(y.shape)); + } +} +function batchGetValue2(xs) { + return xs.map((x) => x.read()); +} +function batchSetValue2(variablesAndValues) { + variablesAndValues.forEach((variableAndValue) => { + const variable3 = variableAndValue[0]; + variable3.write(variableAndValue[1]); + }); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js +var InputSpec2 = class { + constructor(args) { + this.dtype = args.dtype; + this.shape = args.shape; + if (args.shape != null) { + this.ndim = args.shape.length; + } else { + this.ndim = args.ndim; + } + this.maxNDim = args.maxNDim; + this.minNDim = args.minNDim; + this.axes = args.axes || {}; + } +}; +var SymbolicTensor2 = class { + constructor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { + this.dtype = dtype; + this.shape = shape; + this.sourceLayer = sourceLayer; + this.inputs = inputs; + this.callArgs = callArgs; + this.outputTensorIndex = outputTensorIndex; + this.id = getNextUniqueTensorId2(); + if (name != null) { + this.originalName = getScopedTensorName2(name); + this.name = getUniqueTensorName2(this.originalName); + } + this.rank = shape.length; + } +}; +var _nextNodeID2 = 0; +var Node2 = class { + constructor(args, callArgs) { + this.callArgs = callArgs; + this.id = _nextNodeID2++; + this.outboundLayer = args.outboundLayer; + this.inboundLayers = args.inboundLayers; + this.nodeIndices = args.nodeIndices; + this.tensorIndices = args.tensorIndices; + this.inputTensors = args.inputTensors; + this.outputTensors = args.outputTensors; + this.inputMasks = args.inputMasks; + this.outputMasks = args.outputMasks; + this.inputShapes = args.inputShapes; + this.outputShapes = args.outputShapes; + for (const layer of args.inboundLayers) { + if (layer != null) { + layer.outboundNodes.push(this); + } + } + args.outboundLayer.inboundNodes.push(this); + } + getConfig() { + const inboundNames = []; + for (const layer of this.inboundLayers) { + if (layer != null) { + inboundNames.push(layer.name); + } else { + inboundNames.push(null); + } + } + return { + outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, + inboundLayers: inboundNames, + nodeIndices: this.nodeIndices, + tensorIndices: this.tensorIndices + }; + } +}; +var _nextLayerID2 = 0; +var Layer2 = class extends serialization_exports2.Serializable { + constructor(args = {}) { + super(); + this._callHook = null; + this._addedWeightNames = []; + this._stateful = false; + this.id = _nextLayerID2++; + this.activityRegularizer = null; + this.inputSpec = null; + this.supportsMasking = false; + this._trainableWeights = []; + this._nonTrainableWeights = []; + this._losses = []; + this._updates = []; + this._built = false; + this.inboundNodes = []; + this.outboundNodes = []; + let name = args.name; + if (!name) { + const prefix = this.getClassName(); + name = toSnakeCase2(prefix) + "_" + getUid2(prefix); + } + this.name = name; + this.trainable_ = args.trainable == null ? true : args.trainable; + if (args.inputShape != null || args.batchInputShape != null) { + let batchInputShape; + if (args.batchInputShape != null) { + batchInputShape = args.batchInputShape; + } else if (args.inputShape != null) { + let batchSize = null; + if (args.batchSize != null) { + batchSize = args.batchSize; + } + batchInputShape = [batchSize].concat(args.inputShape); + } + this.batchInputShape = batchInputShape; + let dtype = args.dtype; + if (dtype == null) { + dtype = args.inputDType; + } + if (dtype == null) { + dtype = "float32"; + } + this.dtype = dtype; + } + if (args.weights != null) { + this.initialWeights = args.weights; + } else { + this.initialWeights = null; + } + this._refCount = null; + this.fastWeightInitDuringBuild = false; + } + static nodeKey(layer, nodeIndex) { + return layer.name + "_ib-" + nodeIndex.toString(); + } + getNodeAtIndex(nodeIndex, attrName) { + if (this.inboundNodes.length === 0) { + throw new RuntimeError2(`The layer has never been called and thus has no defined ${attrName}.`); + } + if (this.inboundNodes.length <= nodeIndex) { + throw new ValueError2(`Asked to get ${attrName} at node ${nodeIndex}, but the layer has only ${this.inboundNodes.length} inbound nodes.`); + } + return this.inboundNodes[nodeIndex]; + } + getInputAt(nodeIndex) { + return singletonOrArray2(this.getNodeAtIndex(nodeIndex, "input").inputTensors); + } + getOutputAt(nodeIndex) { + return singletonOrArray2(this.getNodeAtIndex(nodeIndex, "output").outputTensors); + } + get input() { + if (this.inboundNodes.length > 1) { + throw new AttributeError2(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`); + } else if (this.inboundNodes.length === 0) { + throw new AttributeError2(`Layer ${this.name} is not connected, no input to return.`); + } + return singletonOrArray2(this.getNodeAtIndex(0, "input").inputTensors); + } + get output() { + if (this.inboundNodes.length === 0) { + throw new AttributeError2(`Layer ${this.name} has no inbound nodes.`); + } + if (this.inboundNodes.length > 1) { + throw new AttributeError2(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`); + } + return singletonOrArray2(this.getNodeAtIndex(0, "output").outputTensors); + } + get losses() { + return this._losses; + } + calculateLosses() { + return this.losses.map((lossFn) => lossFn()); + } + get updates() { + return this._updates; + } + get built() { + return this._built; + } + set built(built) { + this._built = built; + } + get trainable() { + return this.trainable_; + } + set trainable(trainable) { + this._trainableWeights.forEach((w) => w.trainable = trainable); + this.trainable_ = trainable; + } + get trainableWeights() { + if (this.trainable_) { + return this._trainableWeights.filter((w) => w.trainable); + } else { + return []; + } + } + set trainableWeights(weights) { + this._trainableWeights = weights; + } + get nonTrainableWeights() { + if (this.trainable) { + return this._trainableWeights.filter((w) => !w.trainable).concat(this._nonTrainableWeights); + } else { + return this._trainableWeights.concat(this._nonTrainableWeights); + } + } + set nonTrainableWeights(weights) { + this._nonTrainableWeights = weights; + } + get weights() { + return this.trainableWeights.concat(this.nonTrainableWeights); + } + get stateful() { + return this._stateful; + } + resetStates() { + if (!this.stateful) { + throw new Error("Cannot call the resetStates() method of a non-stateful Layer object."); + } + } + assertInputCompatibility(inputs) { + inputs = toList2(inputs); + if (this.inputSpec == null || this.inputSpec.length === 0) { + return; + } + const inputSpec = toList2(this.inputSpec); + if (inputs.length !== inputSpec.length) { + throw new ValueError2(`Layer ${this.name} expects ${inputSpec.length} inputs, but it received ${inputs.length} input tensors. Input received: ${inputs}`); + } + for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) { + const x = inputs[inputIndex]; + const spec = inputSpec[inputIndex]; + if (spec == null) { + continue; + } + const ndim = x.rank; + if (spec.ndim != null) { + if (ndim !== spec.ndim) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name}: expected ndim=${spec.ndim}, found ndim=${ndim}`); + } + } + if (spec.maxNDim != null) { + if (ndim > spec.maxNDim) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name}: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`); + } + } + if (spec.minNDim != null) { + if (ndim < spec.minNDim) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name}: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`); + } + } + if (spec.dtype != null) { + if (x.dtype !== spec.dtype) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name} : expected dtype=${spec.dtype}, found dtype=${x.dtype}.`); + } + } + if (spec.axes) { + const xShape = x.shape; + for (const key in spec.axes) { + const axis = Number(key); + const value = spec.axes[key]; + const xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; + if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name}: expected axis ${axis} of input shape to have value ${value} but got shape ${xShape}.`); + } + } + } + if (spec.shape != null) { + for (let i = 0; i < spec.shape.length; ++i) { + const specDim = spec.shape[i]; + const dim = x.shape[i]; + if (specDim != null && dim != null) { + if (specDim !== dim) { + throw new ValueError2(`Input ${inputIndex} is incompatible with layer ${this.name}: expected shape=${spec.shape}, found shape=${x.shape}.`); + } + } + } + } + } + } + call(inputs, kwargs) { + return inputs; + } + invokeCallHook(inputs, kwargs) { + if (this._callHook != null) { + this._callHook(inputs, kwargs); + } + } + setCallHook(callHook) { + this._callHook = callHook; + } + clearCallHook() { + this._callHook = null; + } + apply(inputs, kwargs) { + kwargs = kwargs || {}; + this.assertNotDisposed(); + const inputsList = toList2(inputs); + let allAreSymbolic = true; + for (const input3 of inputsList) { + if (!(input3 instanceof SymbolicTensor2)) { + allAreSymbolic = false; + break; + } + } + let noneAreSymbolic = true; + for (const input3 of inputsList) { + if (input3 instanceof SymbolicTensor2) { + noneAreSymbolic = false; + break; + } + } + if (allAreSymbolic === noneAreSymbolic) { + throw new ValueError2("Arguments to apply() must be all SymbolicTensors or all Tensors"); + } + return nameScope2(this.name, () => { + if (!this.built) { + this.assertInputCompatibility(inputs); + const inputShapes = []; + for (const xElem of toList2(inputs)) { + inputShapes.push(xElem.shape); + } + this.build(singletonOrArray2(inputShapes)); + this.built = true; + if (this.initialWeights) { + this.setWeights(this.initialWeights); + } + if (this._refCount === null && noneAreSymbolic) { + this._refCount = 1; + } + } + this.assertInputCompatibility(inputs); + if (noneAreSymbolic) { + let output = this.call(inputs, kwargs); + const outputList = toList2(output); + const outputListCopy = []; + for (let x of outputList) { + if (inputsList.indexOf(x) !== -1) { + x = x.clone(); + } + outputListCopy.push(x); + } + output = singletonOrArray2(outputListCopy); + if (this.activityRegularizer != null) { + throw new NotImplementedError2("Layer invocation in the presence of activity regularizer(s) is not supported yet."); + } + return output; + } else { + const inputShape = collectInputShape2(inputs); + const outputShape = this.computeOutputShape(inputShape); + let output; + const outputDType = guessOutputDType2(inputs); + this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : inputShape); + if (outputShape != null && outputShape.length > 0 && Array.isArray(outputShape[0])) { + output = outputShape.map((shape, index) => new SymbolicTensor2(outputDType, shape, this, toList2(inputs), kwargs, this.name, index)); + } else { + output = new SymbolicTensor2(outputDType, outputShape, this, toList2(inputs), kwargs, this.name); + } + this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); + this._refCount++; + if (this.activityRegularizer != null) { + throw new NotImplementedError2("Layer invocation in the presence of activity regularizer(s) is not supported yet."); + } + return output; + } + }); + } + warnOnIncompatibleInputShape(inputShape) { + if (this.batchInputShape == null) { + return; + } else if (inputShape.length !== this.batchInputShape.length) { + console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(inputShape)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`); + } else { + let dimMismatch = false; + this.batchInputShape.forEach((dimension, i) => { + if (dimension != null && inputShape[i] != null && inputShape[i] !== dimension) { + dimMismatch = true; + } + }); + if (dimMismatch) { + console.warn(`The shape of the input tensor (${JSON.stringify(inputShape)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`); + } + } + } + get outputShape() { + if (this.inboundNodes == null || this.inboundNodes.length === 0) { + throw new AttributeError2(`The layer ${this.name} has never been called and thus has no defined output shape.`); + } + const allOutputShapes = []; + for (const node2 of this.inboundNodes) { + const shapeString = JSON.stringify(node2.outputShapes); + if (allOutputShapes.indexOf(shapeString) === -1) { + allOutputShapes.push(shapeString); + } + } + if (allOutputShapes.length === 1) { + const outputShapes = this.inboundNodes[0].outputShapes; + if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && outputShapes.length === 1) { + return outputShapes[0]; + } else { + return outputShapes; + } + } else { + throw new AttributeError2(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`); + } + } + countParams() { + if (!this.built) { + throw new RuntimeError2(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`); + } + return countParamsInWeights2(this.weights); + } + build(inputShape) { + this.built = true; + } + getWeights(trainableOnly = false) { + return batchGetValue2(trainableOnly ? this.trainableWeights : this.weights); + } + setWeights(weights) { + tidy2(() => { + const params = this.weights; + if (params.length !== weights.length) { + throw new ValueError2(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${weights.length}, but the layer was expecting ${params.length} weights. Provided weights: ${weights}...`); + } + if (params.length === 0) { + return; + } + const weightValueTuples = []; + const paramValues = batchGetValue2(params); + for (let i = 0; i < paramValues.length; ++i) { + const pv = paramValues[i]; + const p3 = params[i]; + const w = weights[i]; + if (!util_exports2.arraysEqual(pv.shape, w.shape)) { + throw new ValueError2(`Layer weight shape ${pv.shape} not compatible with provided weight shape ${w.shape}`); + } + weightValueTuples.push([p3, w]); + } + batchSetValue2(weightValueTuples); + }); + } + addWeight(name, shape, dtype, initializer, regularizer, trainable, constraint) { + if (this._addedWeightNames.indexOf(name) !== -1) { + throw new ValueError2(`Duplicate weight name ${name} for layer ${this.name}`); + } + this._addedWeightNames.push(name); + if (dtype == null) { + dtype = "float32"; + } + if (this.fastWeightInitDuringBuild) { + initializer = getInitializer2("zeros"); + } + const initValue = initializer.apply(shape, dtype); + const weight = new LayerVariable2(initValue, dtype, name, trainable, constraint); + initValue.dispose(); + if (regularizer != null) { + this.addLoss(() => regularizer.apply(weight.read())); + } + if (trainable == null) { + trainable = true; + } + if (trainable) { + this._trainableWeights.push(weight); + } else { + this._nonTrainableWeights.push(weight); + } + return weight; + } + setFastWeightInitDuringBuild(value) { + this.fastWeightInitDuringBuild = value; + } + addLoss(losses4) { + if (losses4 == null || Array.isArray(losses4) && losses4.length === 0) { + return; + } + losses4 = toList2(losses4); + if (this._losses !== void 0 && this._losses !== null) { + this.losses.push(...losses4); + } + } + computeOutputShape(inputShape) { + return inputShape; + } + computeMask(inputs, mask) { + if (!this.supportsMasking) { + if (mask != null) { + if (Array.isArray(mask)) { + mask.forEach((maskElement) => { + if (maskElement != null) { + throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`); + } + }); + } else { + throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`); + } + } + return null; + } + return mask; + } + addInboundNode(inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs = null) { + const inputTensorList = toList2(inputTensors); + outputTensors = toList2(outputTensors); + inputMasks = toList2(inputMasks); + outputMasks = toList2(outputMasks); + inputShapes = normalizeShapeList2(inputShapes); + outputShapes = normalizeShapeList2(outputShapes); + const inboundLayers = []; + const nodeIndices = []; + const tensorIndices = []; + for (const x of inputTensorList) { + inboundLayers.push(x.sourceLayer); + nodeIndices.push(x.nodeIndex); + tensorIndices.push(x.tensorIndex); + } + new Node2({ + outboundLayer: this, + inboundLayers, + nodeIndices, + tensorIndices, + inputTensors: inputTensorList, + outputTensors, + inputMasks, + outputMasks, + inputShapes, + outputShapes + }, kwargs); + for (let i = 0; i < outputTensors.length; i++) { + outputTensors[i].sourceLayer = this; + outputTensors[i].nodeIndex = this.inboundNodes.length - 1; + outputTensors[i].tensorIndex = i; + } + } + getConfig() { + const config3 = { name: this.name, trainable: this.trainable }; + if (this.batchInputShape != null) { + config3["batchInputShape"] = this.batchInputShape; + } + if (this.dtype != null) { + config3["dtype"] = this.dtype; + } + return config3; + } + disposeWeights() { + this.weights.forEach((weight) => weight.dispose()); + return this.weights.length; + } + assertNotDisposed() { + if (this._refCount === 0) { + throw new Error(`Layer '${this.name}' is already disposed.`); + } + } + dispose() { + if (!this.built) { + throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`); + } + if (this._refCount === null) { + throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`); + } + this.assertNotDisposed(); + let numDisposedVariables = 0; + if (--this._refCount === 0) { + numDisposedVariables = this.disposeWeights(); + } + return { refCountAfterDispose: this._refCount, numDisposedVariables }; + } +}; +function collectInputShape2(inputTensors) { + inputTensors = toList2(inputTensors); + const shapes = []; + for (const x of inputTensors) { + shapes.push(x.shape); + } + return singletonOrArray2(shapes); +} +function guessOutputDType2(inputTensors) { + return "float32"; +} +function getSourceInputs2(tensor3, layer, nodeIndex) { + if (layer == null || nodeIndex != null && nodeIndex > 0) { + layer = tensor3.sourceLayer; + nodeIndex = tensor3.nodeIndex; + } + if (layer.inboundNodes.length === 0) { + return [tensor3]; + } else { + const node2 = layer.inboundNodes[nodeIndex]; + if (node2.inboundLayers.length === 0) { + return node2.inputTensors; + } else { + const sourceTensors = []; + for (let i = 0; i < node2.inboundLayers.length; i++) { + const x = node2.inputTensors[i]; + const layer2 = node2.inboundLayers[i]; + const nodeIndex2 = node2.nodeIndices[i]; + const previousSources = getSourceInputs2(x, layer2, nodeIndex2); + for (const x2 of previousSources) { + if (sourceTensors.indexOf(x2) === -1) { + sourceTensors.push(x2); + } + } + } + return sourceTensors; + } + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js +var InputLayer2 = class extends Layer2 { + constructor(args) { + super({ + dtype: args.dtype, + name: args.name != null ? args.name : getUid2("input").toString() + }); + if (args.batchSize == null) { + args.batchSize = null; + } + if (args.sparse == null) { + args.sparse = false; + } + this.trainable = false; + this.built = true; + this.sparse = args.sparse; + if (args.inputShape != null && args.batchInputShape != null) { + throw new ValueError2("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time."); + } + let batchInputShape = args.batchInputShape; + if (batchInputShape == null) { + if (args.inputShape == null) { + throw new ValueError2("An InputLayer should be passed either a `batchInputShape` or an `inputShape`."); + } else { + batchInputShape = [args.batchSize].concat(args.inputShape); + } + } else { + if (args.batchSize != null) { + throw new ValueError2("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer."); + } + } + const dtype = args.dtype || "float32"; + this.batchInputShape = batchInputShape; + this.dtype = dtype; + this.inputSpec = [{ shape: batchInputShape }]; + const inputTensor = new SymbolicTensor2(this.dtype, this.batchInputShape, this, [], {}, this.name); + inputTensor.nodeIndex = 0; + inputTensor.tensorIndex = 0; + new Node2({ + outboundLayer: this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: [inputTensor], + outputTensors: [inputTensor], + inputMasks: [null], + outputMasks: [null], + inputShapes: [batchInputShape], + outputShapes: [batchInputShape] + }); + } + apply(inputs, kwargs) { + throw new ValueError2(`Cannot pass any input to an InputLayer's apply() method. InputLayer name: ${this.name}`); + } + dispose() { + return { refCountAfterDispose: this._refCount, numDisposedVariables: 0 }; + } + getConfig() { + return { + batchInputShape: this.batchInputShape, + dtype: this.dtype, + sparse: this.sparse, + name: this.name + }; + } +}; +InputLayer2.className = "InputLayer"; +serialization_exports2.registerClass(InputLayer2); +function Input2(config3) { + if (config3.batchShape == null && config3.shape == null) { + throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension."); + } + if (config3.batchShape != null && config3.shape != null) { + throw new ValueError2("Please provide either a `shape` or `batchShape` argument to Input, but not both."); + } + let batchShape = config3.batchShape; + if (config3.shape != null && batchShape == null) { + batchShape = [null].concat(config3.shape); + } + let dtype = config3.dtype; + if (dtype == null) { + dtype = "float32"; + } + const inputLayer2 = new InputLayer2({ + batchInputShape: batchShape, + name: config3.name, + dtype, + sparse: config3.sparse + }); + const outputs = inputLayer2.inboundNodes[0].outputTensors; + return outputs[0]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/logs.js +async function resolveScalarsInLogs2(logs) { + if (logs == null) { + return; + } + const promises = []; + const keys = []; + const scalarsToDispose = []; + for (const key in logs) { + const value = logs[key]; + if (typeof value !== "number") { + const valueScalar = value; + promises.push(valueScalar.data()); + keys.push(key); + scalarsToDispose.push(valueScalar); + } + } + if (promises.length > 0) { + const values = await Promise.all(promises); + for (let i = 0; i < values.length; ++i) { + logs[keys[i]] = values[i][0]; + } + dispose2(scalarsToDispose); + } +} +function disposeTensorsInLogs2(logs) { + if (logs == null) { + return; + } + for (const key in logs) { + const value = logs[key]; + if (typeof value !== "number") { + value.dispose(); + } + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js +var ModelLoggingVerbosity2; +(function(ModelLoggingVerbosity3) { + ModelLoggingVerbosity3[ModelLoggingVerbosity3["SILENT"] = 0] = "SILENT"; + ModelLoggingVerbosity3[ModelLoggingVerbosity3["VERBOSE"] = 1] = "VERBOSE"; +})(ModelLoggingVerbosity2 || (ModelLoggingVerbosity2 = {})); +var DEFAULT_YIELD_EVERY_MS2 = 125; +var BaseCallback2 = class { + constructor() { + this.validationData = null; + } + setParams(params) { + this.params = params; + } + async onEpochBegin(epoch, logs) { + } + async onEpochEnd(epoch, logs) { + } + async onBatchBegin(batch, logs) { + } + async onBatchEnd(batch, logs) { + } + async onTrainBegin(logs) { + } + async onTrainEnd(logs) { + } + setModel(model15) { + } +}; +var CallbackList2 = class { + constructor(callbacks3, queueLength = 10) { + if (callbacks3 == null) { + callbacks3 = []; + } + this.callbacks = callbacks3; + this.queueLength = queueLength; + } + append(callback) { + this.callbacks.push(callback); + } + setParams(params) { + for (const callback of this.callbacks) { + callback.setParams(params); + } + } + setModel(model15) { + for (const callback of this.callbacks) { + callback.setModel(model15); + } + } + async onEpochBegin(epoch, logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onEpochBegin(epoch, logs); + } + } + async onEpochEnd(epoch, logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onEpochEnd(epoch, logs); + } + } + async onBatchBegin(batch, logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onBatchBegin(batch, logs); + } + } + async onBatchEnd(batch, logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onBatchEnd(batch, logs); + } + } + async onTrainBegin(logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onTrainBegin(logs); + } + } + async onTrainEnd(logs) { + if (logs == null) { + logs = {}; + } + for (const callback of this.callbacks) { + await callback.onTrainEnd(logs); + } + } +}; +var BaseLogger2 = class extends BaseCallback2 { + constructor() { + super(); + } + async onEpochBegin(epoch) { + this.seen = 0; + this.totals = {}; + } + async onBatchEnd(batch, logs) { + if (logs == null) { + logs = {}; + } + const batchSize = logs["size"] == null ? 0 : logs["size"]; + this.seen += batchSize; + for (const key in logs) { + const value = logs[key]; + if (typeof value === "number") { + if (!this.totals.hasOwnProperty(key)) { + this.totals[key] = 0; + } + this.totals[key] = this.totals[key] + value * batchSize; + } else { + let oldTotalsToDispose; + if (key in this.totals) { + oldTotalsToDispose = this.totals[key]; + } else { + this.totals[key] = 0; + } + const total = tidy2(() => add6(this.totals[key], mul2(value, batchSize))); + this.totals[key] = total; + if (oldTotalsToDispose != null) { + oldTotalsToDispose.dispose(); + } + } + } + } + async onEpochEnd(epoch, logs) { + if (logs != null) { + for (const key of this.params["metrics"]) { + if (this.totals[key] == null) { + continue; + } + if (typeof this.totals[key] === "number") { + logs[key] = this.totals[key] / this.seen; + } else { + tidy2(() => { + const log13 = mul2(div3(1, this.seen), this.totals[key]); + logs[key] = log13; + this.totals[key].dispose(); + keep2(logs[key]); + }); + } + } + } + } +}; +var History2 = class extends BaseCallback2 { + async onTrainBegin(logs) { + this.epoch = []; + this.history = {}; + } + async onEpochEnd(epoch, logs) { + if (logs == null) { + logs = {}; + } + this.epoch.push(epoch); + for (const key in logs) { + if (this.history[key] == null) { + this.history[key] = []; + } + this.history[key].push(logs[key]); + } + } + async syncData() { + const promises = []; + const keys = []; + const indices = []; + for (const key in this.history) { + const valueArray = this.history[key]; + for (let i = 0; i < valueArray.length; ++i) { + if (typeof valueArray[i] !== "number") { + const valueScalar = valueArray[i]; + promises.push(valueScalar.data()); + keys.push(key); + indices.push(i); + } + } + } + const values = await Promise.all(promises); + for (let n = 0; n < values.length; ++n) { + const tensorToDispose = this.history[keys[n]][indices[n]]; + tensorToDispose.dispose(); + this.history[keys[n]][indices[n]] = values[n][0]; + } + } +}; +var CustomCallback2 = class extends BaseCallback2 { + constructor(args, yieldEvery) { + super(); + this.currentEpoch = 0; + this.yieldEvery = yieldEvery || "auto"; + if (this.yieldEvery === "auto") { + this.yieldEvery = DEFAULT_YIELD_EVERY_MS2; + } + if (this.yieldEvery === "never" && args.onYield != null) { + throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback"); + } + if (util_exports2.isNumber(this.yieldEvery)) { + this.maybeWait = debounce2(this.maybeWait.bind(this), this.yieldEvery); + } + this.trainBegin = args.onTrainBegin; + this.trainEnd = args.onTrainEnd; + this.epochBegin = args.onEpochBegin; + this.epochEnd = args.onEpochEnd; + this.batchBegin = args.onBatchBegin; + this.batchEnd = args.onBatchEnd; + this.yield = args.onYield; + } + async maybeWait(epoch, batch, logs) { + const ps = []; + if (this.yield != null) { + await resolveScalarsInLogs2(logs); + ps.push(this.yield(epoch, batch, logs)); + } + ps.push(nextFrame2()); + await Promise.all(ps); + } + async onEpochBegin(epoch, logs) { + this.currentEpoch = epoch; + if (this.epochBegin != null) { + await resolveScalarsInLogs2(logs); + await this.epochBegin(epoch, logs); + } + } + async onEpochEnd(epoch, logs) { + const ps = []; + if (this.epochEnd != null) { + await resolveScalarsInLogs2(logs); + ps.push(this.epochEnd(epoch, logs)); + } + if (this.yieldEvery === "epoch") { + ps.push(nextFrame2()); + } + await Promise.all(ps); + } + async onBatchBegin(batch, logs) { + if (this.batchBegin != null) { + await resolveScalarsInLogs2(logs); + await this.batchBegin(batch, logs); + } + } + async onBatchEnd(batch, logs) { + const ps = []; + if (this.batchEnd != null) { + await resolveScalarsInLogs2(logs); + ps.push(this.batchEnd(batch, logs)); + } + if (this.yieldEvery === "batch") { + ps.push(nextFrame2()); + } else if (util_exports2.isNumber(this.yieldEvery)) { + ps.push(this.maybeWait(this.currentEpoch, batch, logs)); + } + await Promise.all(ps); + } + async onTrainBegin(logs) { + if (this.trainBegin != null) { + await resolveScalarsInLogs2(logs); + await this.trainBegin(logs); + } + } + async onTrainEnd(logs) { + if (this.trainEnd != null) { + await resolveScalarsInLogs2(logs); + await this.trainEnd(logs); + } + } +}; +function standardizeCallbacks2(callbacks3, yieldEvery) { + if (callbacks3 == null) { + callbacks3 = {}; + } + if (callbacks3 instanceof BaseCallback2) { + return [callbacks3]; + } + if (Array.isArray(callbacks3) && callbacks3[0] instanceof BaseCallback2) { + return callbacks3; + } + const callbackConfigs = toList2(callbacks3); + return callbackConfigs.map((callbackConfig) => new CustomCallback2(callbackConfig, yieldEvery)); +} +var CallbackConstructorRegistry2 = class { + constructor() { + } + static registerCallbackConstructor(verbosityLevel, callbackConstructor) { + util_exports2.assert(verbosityLevel >= 0 && Number.isInteger(verbosityLevel), () => `Verbosity level is expected to be an integer >= 0, but got ${verbosityLevel}`); + CallbackConstructorRegistry2.checkForDuplicate(callbackConstructor); + if (CallbackConstructorRegistry2.constructors[verbosityLevel] == null) { + CallbackConstructorRegistry2.constructors[verbosityLevel] = []; + } + CallbackConstructorRegistry2.constructors[verbosityLevel].push(callbackConstructor); + } + static checkForDuplicate(callbackConstructor) { + for (const levelName in CallbackConstructorRegistry2.constructors) { + const constructors = CallbackConstructorRegistry2.constructors[+levelName]; + constructors.forEach((ctor) => { + if (ctor === callbackConstructor) { + throw new ValueError2("Duplicate callback constructor."); + } + }); + } + } + static clear() { + CallbackConstructorRegistry2.constructors = {}; + } + static createCallbacks(verbosityLevel) { + const constructors = []; + for (const levelName in CallbackConstructorRegistry2.constructors) { + const level = +levelName; + if (verbosityLevel >= level) { + constructors.push(...CallbackConstructorRegistry2.constructors[level]); + } + } + return constructors.map((ctor) => new ctor()); + } +}; +CallbackConstructorRegistry2.constructors = {}; +function configureCallbacks2(callbacks3, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics) { + const history = new History2(); + const actualCallbacks = [ + new BaseLogger2(), + ...CallbackConstructorRegistry2.createCallbacks(verbose) + ]; + if (callbacks3 != null) { + actualCallbacks.push(...callbacks3); + } + actualCallbacks.push(history); + const callbackList = new CallbackList2(actualCallbacks); + callbackList.setParams({ + epochs, + initialEpoch, + samples: numTrainSamples, + steps: stepsPerEpoch, + batchSize, + verbose, + doValidation, + metrics: callbackMetrics + }); + return { callbackList, history }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js +function deserialize2(config3, customObjects = {}, fastWeightInit = false) { + return deserializeKerasObject2(config3, serialization_exports2.SerializationMap.getMap().classNameMap, customObjects, "layer", fastWeightInit); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/losses.js +function l2Normalize2(x, axis) { + return tidy2(() => { + if (x.dtype !== "float32") { + x = cast6(x, "float32"); + } + const squareSum = sum7(square5(x), axis, true); + const epsilonTensor = fill5(squareSum.shape, epsilon3()); + const norm3 = sqrt4(maximum5(squareSum, epsilonTensor)); + return div3(x, norm3); + }); +} +function meanSquaredError4(yTrue, yPred) { + return tidy2(() => mean4(square5(sub4(yPred, yTrue)), -1)); +} +function meanAbsoluteError3(yTrue, yPred) { + return tidy2(() => mean4(abs4(sub4(yPred, yTrue)), -1)); +} +function meanAbsolutePercentageError3(yTrue, yPred) { + return tidy2(() => { + const diff = sub4(yTrue, yPred); + const clippedTrue = clipByValue3(abs4(yTrue), epsilon3(), Number.MAX_VALUE); + const absResult = abs4(div3(diff, clippedTrue)); + return mul2(100, mean4(absResult, -1)); + }); +} +function meanSquaredLogarithmicError2(yTrue, yPred) { + return tidy2(() => { + const clippedPred = clipByValue3(yPred, epsilon3(), Number.MAX_VALUE); + const firstLog = log10(add6(1, clippedPred)); + const clippedTrue = clipByValue3(yTrue, epsilon3(), Number.MAX_VALUE); + const secondLog = log10(add6(1, clippedTrue)); + return mean4(square5(sub4(firstLog, secondLog)), -1); + }); +} +function squaredHinge2(yTrue, yPred) { + return tidy2(() => { + const maxResult = maximum5(0, sub4(1, mul2(yTrue, yPred))); + return mean4(square5(maxResult), -1); + }); +} +function hinge2(yTrue, yPred) { + return tidy2(() => { + const maxResult = maximum5(0, sub4(1, mul2(yTrue, yPred))); + return mean4(maxResult, -1); + }); +} +function categoricalHinge2(yTrue, yPred) { + return tidy2(() => { + const pos = sum7(mul2(yTrue, yPred), -1); + const neg7 = max6(mul2(sub4(1, yTrue), yPred), -1); + return maximum5(0, add6(1, sub4(neg7, pos))); + }); +} +function logcosh2(yTrue, yPred) { + return tidy2(() => { + const log22 = Math.log(2); + const predictionDiff = sub4(yPred, yTrue); + const logcoshResult = sub4(add6(predictionDiff, softplus4(mul2(-2, predictionDiff))), log22); + return mean4(logcoshResult, -1); + }); +} +function categoricalCrossentropy4(target, output, fromLogits = false) { + return tidy2(() => { + if (fromLogits) { + output = softmax6(output); + } else { + const outputSum = sum7(output, output.shape.length - 1, true); + output = div3(output, outputSum); + } + output = clipByValue3(output, epsilon3(), 1 - epsilon3()); + return neg4(sum7(mul2(cast6(target, "float32"), log10(output)), output.shape.length - 1)); + }); +} +function sparseCategoricalCrossentropy3(target, output, fromLogits = false) { + return tidy2(() => { + const flatTarget = cast6(floor4(flatten5(target)), "int32"); + output = clipByValue3(output, epsilon3(), 1 - epsilon3()); + const outputShape = output.shape; + const oneHotTarget = reshape6(oneHot5(flatTarget, outputShape[outputShape.length - 1]), outputShape); + return categoricalCrossentropy4(oneHotTarget, output, fromLogits); + }); +} +function sigmoidCrossEntropyWithLogits2(labels2, logits) { + if (!util_exports2.arraysEqual(labels2.shape, logits.shape)) { + throw new ValueError2(`logits and labels must have the same shape, but got shapes ${JSON.stringify(labels2.shape)} and ${JSON.stringify(logits.shape)}`); + } + return tidy2(() => { + const reluLogits = relu4(logits); + const negAbsLogits = neg4(abs4(logits)); + return add6(sub4(reluLogits, mul2(logits, labels2)), log1p4(exp4(negAbsLogits))); + }); +} +function binaryCrossentropy4(yTrue, yPred) { + return tidy2(() => { + let y; + y = clipByValue3(yPred, epsilon3(), 1 - epsilon3()); + y = log10(div3(y, sub4(1, y))); + return mean4(sigmoidCrossEntropyWithLogits2(yTrue, y), -1); + }); +} +function kullbackLeiblerDivergence2(yTrue, yPred) { + return tidy2(() => { + const clippedTrue = clipByValue3(yTrue, epsilon3(), 1); + const clippedPred = clipByValue3(yPred, epsilon3(), 1); + return sum7(mul2(yTrue, log10(div3(clippedTrue, clippedPred))), -1); + }); +} +function poisson2(yTrue, yPred) { + return tidy2(() => { + const logPred = log10(add6(epsilon3(), yPred)); + return mean4(sub4(yPred, mul2(yTrue, logPred)), -1); + }); +} +function cosineProximity3(yTrue, yPred) { + return tidy2(() => { + const trueNormalized = l2Normalize2(yTrue, -1); + const predNormalized = l2Normalize2(yPred, -1); + const trueXPred = mul2(trueNormalized, predNormalized); + return neg4(sum7(trueXPred, -1)); + }); +} +var lossesMap2 = { + meanSquaredError: meanSquaredError4, + meanAbsoluteError: meanAbsoluteError3, + meanAbsolutePercentageError: meanAbsolutePercentageError3, + meanSquaredLogarithmicError: meanSquaredLogarithmicError2, + squaredHinge: squaredHinge2, + hinge: hinge2, + categoricalHinge: categoricalHinge2, + logcosh: logcosh2, + categoricalCrossentropy: categoricalCrossentropy4, + sparseCategoricalCrossentropy: sparseCategoricalCrossentropy3, + binaryCrossentropy: binaryCrossentropy4, + kullbackLeiblerDivergence: kullbackLeiblerDivergence2, + poisson: poisson2, + cosineProximity: cosineProximity3 +}; +function get4(identifierOrFn) { + if (typeof identifierOrFn === "string") { + if (identifierOrFn in lossesMap2) { + return lossesMap2[identifierOrFn]; + } + let errMsg = `Unknown loss ${identifierOrFn}`; + if (identifierOrFn.toLowerCase().includes("softmaxcrossentropy")) { + errMsg = `Unknown loss ${identifierOrFn}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`; + } + throw new ValueError2(errMsg); + } else { + return identifierOrFn; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/metrics.js +function binaryAccuracy3(yTrue, yPred) { + return tidy2(() => { + const threshold5 = mul2(0.5, onesLike5(yPred)); + const yPredThresholded = cast7(greater5(yPred, threshold5), yTrue.dtype); + return mean4(equal4(yTrue, yPredThresholded), -1); + }); +} +function categoricalAccuracy3(yTrue, yPred) { + return tidy2(() => cast7(equal4(argMax4(yTrue, -1), argMax4(yPred, -1)), "float32")); +} +function truePositives2(yTrue, yPred) { + return tidy2(() => { + return cast6(sum7(logicalAnd4(equal4(yTrue, 1), equal4(yPred, 1))), "float32"); + }); +} +function falsePositives2(yTrue, yPred) { + return tidy2(() => { + return cast6(sum7(logicalAnd4(equal4(yTrue, 0), equal4(yPred, 1))), "float32"); + }); +} +function precision3(yTrue, yPred) { + return tidy2(() => { + const tp = truePositives2(yTrue, yPred); + const fp = falsePositives2(yTrue, yPred); + const denominator = add6(tp, fp); + return cast6(where2(greater5(denominator, 0), div3(tp, denominator), 0), "float32"); + }); +} +function binaryCrossentropy5(yTrue, yPred) { + return binaryCrossentropy4(yTrue, yPred); +} +function sparseCategoricalAccuracy3(yTrue, yPred) { + if (yTrue.rank === yPred.rank) { + yTrue = squeeze2(yTrue, [yTrue.rank - 1]); + } + yPred = argMax4(yPred, -1); + if (yPred.dtype !== yTrue.dtype) { + yPred = cast6(yPred, yTrue.dtype); + } + return cast6(equal4(yTrue, yPred), "float32"); +} +var mse3 = meanSquaredError4; +var MSE3 = meanSquaredError4; +var mae2 = meanAbsoluteError3; +var MAE2 = meanAbsoluteError3; +var mape3 = meanAbsolutePercentageError3; +var MAPE3 = meanAbsolutePercentageError3; +var categoricalCrossentropy5 = categoricalCrossentropy4; +var cosine2 = cosineProximity3; +var sparseCategoricalCrossentropy4 = sparseCategoricalCrossentropy3; +var metricsMap2 = { + binaryAccuracy: binaryAccuracy3, + categoricalAccuracy: categoricalAccuracy3, + precision: precision3, + categoricalCrossentropy: categoricalCrossentropy5, + sparseCategoricalCrossentropy: sparseCategoricalCrossentropy4, + mse: mse3, + MSE: MSE3, + mae: mae2, + MAE: MAE2, + mape: mape3, + MAPE: MAPE3, + cosine: cosine2 +}; +function get5(identifier) { + if (typeof identifier === "string" && identifier in metricsMap2) { + return metricsMap2[identifier]; + } else if (typeof identifier !== "string" && identifier != null) { + return identifier; + } else { + throw new ValueError2(`Unknown metric ${identifier}`); + } +} +function getLossOrMetricName2(fn) { + assert4(fn !== null, `Unknown LossOrMetricFn ${fn}`); + if (typeof fn === "string") { + return fn; + } else { + let fnName; + for (const key of Object.keys(lossesMap2)) { + if (lossesMap2[key] === fn) { + fnName = key; + break; + } + } + if (fnName !== void 0) { + return fnName; + } + for (const key of Object.keys(metricsMap2)) { + if (metricsMap2[key] === fn) { + fnName = key; + break; + } + } + if (fnName !== void 0) { + return fnName; + } + return fn.name; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js +function getOptimizer2(identifier) { + const optimizerMap = { + "Adagrad": () => train2.adagrad(0.01), + "Adadelta": () => train2.adadelta(1, 0.95, epsilon3()), + "Adam": () => train2.adam(1e-3, 0.9, 0.999, epsilon3()), + "Adamax": () => train2.adamax(2e-3, 0.9, 0.999, epsilon3(), 0), + "RMSProp": () => train2.rmsprop(1e-3, 0.9, 0, epsilon3()), + "SGD": () => train2.sgd(0.01) + }; + optimizerMap["adagrad"] = optimizerMap["Adagrad"]; + optimizerMap["adadelta"] = optimizerMap["Adadelta"]; + optimizerMap["adam"] = optimizerMap["Adam"]; + optimizerMap["adamax"] = optimizerMap["Adamax"]; + optimizerMap["rmsprop"] = optimizerMap["RMSProp"]; + optimizerMap["sgd"] = optimizerMap["SGD"]; + if (identifier in optimizerMap) { + return optimizerMap[identifier](); + } + throw new ValueError2(`Unknown Optimizer ${identifier}`); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/user_defined_metadata.js +var MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH2 = 1 * 1024 * 1024; +function checkUserDefinedMetadata2(userDefinedMetadata, modelName, checkSize = false) { + if (userDefinedMetadata == null || typeof userDefinedMetadata !== "object" || Object.getPrototypeOf(userDefinedMetadata) !== Object.prototype || !plainObjectCheck2(userDefinedMetadata)) { + throw new Error("User-defined metadata is expected to be a JSON object, but is not."); + } + if (checkSize) { + const out = JSON.stringify(userDefinedMetadata); + if (out.length > MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH2) { + console.warn(`User-defined metadata of model "${modelName}" is too large in size (length=${out.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= ${MAX_USER_DEFINED_METADATA_SERIALIZED_LENGTH2}.`); + } + } +} +function plainObjectCheck2(x) { + if (x === null) { + return true; + } else if (typeof x === "object") { + if (Object.getPrototypeOf(x) === Object.prototype) { + const keys = Object.keys(x); + for (const key of keys) { + if (typeof key !== "string") { + return false; + } + if (!plainObjectCheck2(x[key])) { + return false; + } + } + return true; + } else { + if (Array.isArray(x)) { + for (const item of x) { + if (!plainObjectCheck2(item)) { + return false; + } + } + return true; + } else { + return false; + } + } + } else { + const xType = typeof x; + return xType === "string" || xType === "number" || xType === "boolean"; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js +function printSummary2(model15, lineLength, positions, printFn = console.log) { + const sequentialLike = isModelSequentialLike2(model15); + const toDisplay = ["Layer (type)", "Output shape", "Param #"]; + if (sequentialLike) { + lineLength = lineLength || 65; + positions = positions || [0.45, 0.85, 1]; + } else { + lineLength = lineLength || 98; + positions = positions || [0.33, 0.55, 0.67, 1]; + } + if (positions[positions.length - 1] <= 1) { + positions = positions.map((p3) => Math.floor(lineLength * p3)); + } + let relevantNodes; + if (!sequentialLike) { + toDisplay.push("Receives inputs"); + relevantNodes = []; + for (const depth in model15.nodesByDepth) { + relevantNodes.push(...model15.nodesByDepth[depth]); + } + } + printFn("_".repeat(lineLength)); + printRow2(toDisplay, positions, printFn); + printFn("=".repeat(lineLength)); + const layers = model15.layers; + for (let i = 0; i < layers.length; ++i) { + if (sequentialLike) { + printLayerSummary2(layers[i], positions, printFn); + } else { + printLayerSummaryWithConnections2(layers[i], positions, relevantNodes, printFn); + } + printFn((i === layers.length - 1 ? "=" : "_").repeat(lineLength)); + } + model15.checkTrainableWeightsConsistency(); + const trainableCount = countTrainableParams2(model15); + const nonTrainableCount = countParamsInWeights2(model15.nonTrainableWeights); + printFn(`Total params: ${trainableCount + nonTrainableCount}`); + printFn(`Trainable params: ${trainableCount}`); + printFn(`Non-trainable params: ${nonTrainableCount}`); + printFn("_".repeat(lineLength)); +} +function countTrainableParams2(model15) { + let trainableCount; + if (model15.collectedTrainableWeights != null) { + trainableCount = countParamsInWeights2(model15.collectedTrainableWeights); + } else { + trainableCount = countParamsInWeights2(model15.trainableWeights); + } + return trainableCount; +} +function isModelSequentialLike2(model15) { + let sequentialLike = true; + const nodesByDepth = []; + const nodes = []; + for (const depth in model15.nodesByDepth) { + nodesByDepth.push(model15.nodesByDepth[depth]); + } + for (const depthNodes of nodesByDepth) { + if (depthNodes.length > 1 || depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { + sequentialLike = false; + break; + } + nodes.push(...depthNodes); + } + if (sequentialLike) { + for (const layer of model15.layers) { + let flag = false; + for (const node2 of layer.inboundNodes) { + if (nodes.indexOf(node2) !== -1) { + if (flag) { + sequentialLike = false; + break; + } else { + flag = true; + } + } + } + if (!sequentialLike) { + break; + } + } + } + return sequentialLike; +} +function printRow2(fields, positions, printFn = console.log) { + let line = ""; + for (let i = 0; i < fields.length; ++i) { + if (i > 0) { + line = line.slice(0, line.length - 1) + " "; + } + line += fields[i]; + line = line.slice(0, positions[i]); + line += " ".repeat(positions[i] - line.length); + } + printFn(line); +} +function printLayerSummary2(layer, positions, printFn) { + let outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } catch (err) { + outputShape = "multiple"; + } + const name = layer.name; + const className = layer.getClassName(); + const fields = [`${name} (${className})`, outputShape, layer.countParams().toString()]; + printRow2(fields, positions, printFn); +} +function printLayerSummaryWithConnections2(layer, positions, relevantNodes, printFn) { + let outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } catch (err) { + outputShape = "multiple"; + } + const connections = []; + for (const node2 of layer.inboundNodes) { + if (relevantNodes != null && relevantNodes.length > 0 && relevantNodes.indexOf(node2) === -1) { + continue; + } + for (let i = 0; i < node2.inboundLayers.length; ++i) { + const inboundLayer = node2.inboundLayers[i].name; + const inboundLayerIndex = node2.nodeIndices[i]; + const inboundTensorIndex = node2.tensorIndices[i]; + connections.push(`${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`); + } + } + const name = layer.name; + const className = layer.getClassName(); + const firstConnection = connections.length === 0 ? "" : connections[0]; + const fields = [ + `${name} (${className})`, + outputShape, + layer.countParams().toString(), + firstConnection + ]; + printRow2(fields, positions, printFn); + for (let i = 1; i < connections.length; ++i) { + printRow2(["", "", "", connections[i]], positions, printFn); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js +function isArrayItemInputOrOutputName2(key, index, value) { + return (key === "inboundNodes" || key === "outputLayers" || key === "inputLayers") && index === 0 && typeof value === "string"; +} +function convertPythonicToTs2(pythonicConfig, key) { + if (pythonicConfig === null) { + return null; + } else if (typeof pythonicConfig === "string") { + return toCamelCase2(pythonicConfig); + } else if (typeof pythonicConfig === "number" || typeof pythonicConfig === "boolean") { + return pythonicConfig; + } else if (pythonicConfig instanceof Array) { + const tsArray = []; + const arrayLength = pythonicConfig.length; + for (let i = 0; i < arrayLength; ++i) { + const item = pythonicConfig[i]; + if (isArrayItemInputOrOutputName2(key, i, item)) { + tsArray.push(item); + } else { + tsArray.push(convertPythonicToTs2(item, key)); + } + } + return tsArray; + } else { + const tsDict = {}; + for (const pythonicKey of Object.keys(pythonicConfig)) { + const pythonicValue = pythonicConfig[pythonicKey]; + if (pythonicKey === "name" && typeof pythonicValue === "string") { + tsDict[pythonicKey] = pythonicValue; + } else { + const tsKey = toCamelCase2(pythonicKey); + tsDict[tsKey] = convertPythonicToTs2(pythonicValue, tsKey); + } + } + return tsDict; + } +} +function convertTsToPythonic2(tsConfig, key) { + if (tsConfig === null || tsConfig === void 0) { + return null; + } else if (typeof tsConfig === "string") { + return toSnakeCase2(tsConfig); + } else if (typeof tsConfig === "number" || typeof tsConfig === "boolean") { + return tsConfig; + } else if (tsConfig instanceof Array) { + const pyArray = []; + const arrayLength = tsConfig.length; + for (let i = 0; i < arrayLength; ++i) { + const item = tsConfig[i]; + if (isArrayItemInputOrOutputName2(key, i, item)) { + pyArray.push(item); + } else { + pyArray.push(convertTsToPythonic2(item, key)); + } + } + return pyArray; + } else { + const pyDict = {}; + for (const tsKey of Object.keys(tsConfig)) { + const tsValue = tsConfig[tsKey]; + const pyKey = toSnakeCase2(tsKey); + if ((tsKey === "name" || tsKey === "className") && typeof tsValue === "string") { + pyDict[pyKey] = tsValue; + } else { + pyDict[pyKey] = convertTsToPythonic2(tsValue, tsKey); + } + } + return pyDict; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/version.js +var version7 = "3.9.0"; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js +function assertFeedCompatibility2(key, val) { + if (key.dtype == null || key.dtype === val.dtype) { + return val; + } + try { + return cast6(val, key.dtype); + } catch (err) { + throw new ValueError2(`The dtype of the feed (${val.dtype}) can not be cast to the dtype of the key '${key.name}' (${key.dtype}).`); + } +} +var FeedDict2 = class { + constructor(feeds) { + this.id2Value = {}; + this.id2Mask = {}; + this.name2Id = {}; + if (feeds instanceof FeedDict2) { + for (const id in feeds.id2Value) { + this.id2Value[id] = feeds.id2Value[id]; + if (id in feeds.id2Mask) { + this.id2Mask[id] = feeds.id2Mask[id]; + } + } + } else { + if (feeds == null) { + return; + } + for (const feed of feeds) { + this.add(feed.key, feed.value); + } + } + } + add(key, value, mask) { + if (this.id2Value[key.id] == null) { + this.id2Value[key.id] = assertFeedCompatibility2(key, value); + this.name2Id[key.name] = key.id; + if (mask != null) { + this.id2Mask[key.id] = mask; + } + } else { + throw new ValueError2(`Duplicate key: name=${key.name}, id=${key.id}`); + } + return this; + } + addFeed(feed) { + this.add(feed.key, feed.value); + } + hasKey(key) { + return this.id2Value[key.id] != null; + } + names() { + return Object.keys(this.name2Id); + } + getValue(key) { + if (key instanceof SymbolicTensor2) { + if (this.id2Value[key.id] == null) { + throw new ValueError2(`Nonexistent key: ${key.name}`); + } else { + return this.id2Value[key.id]; + } + } else { + const id = this.name2Id[key]; + if (id == null) { + throw new ValueError2(`Feed dict has no SymbolicTensor name: ${key}`); + } + return this.id2Value[id]; + } + } + getMask(key) { + if (key instanceof SymbolicTensor2) { + if (this.id2Value[key.id] == null) { + throw new ValueError2(`Nonexistent key: ${key.name}`); + } else { + return this.id2Mask[key.id]; + } + } else { + const id = this.name2Id[key]; + if (id == null) { + throw new ValueError2(`Feed dict has no SymbolicTensor name: ${key}`); + } + return this.id2Mask[id]; + } + } + disposeMasks() { + if (this.id2Mask != null) { + dispose2(this.id2Mask); + } + } +}; +var cachedSorted2 = {}; +var cachedRecipientCounts2 = {}; +function execute2(fetches, feedDict, kwargs, probe) { + const training = kwargs == null ? false : kwargs["training"]; + const arrayFetches = Array.isArray(fetches); + const fetchArray = arrayFetches ? fetches : [fetches]; + const outputNames = fetchArray.map((t) => t.name); + const finalOutputs = []; + const feedNames = feedDict.names(); + for (const outputName of outputNames) { + if (feedNames.indexOf(outputName) !== -1) { + finalOutputs.push(feedDict.getValue(outputName)); + } else { + finalOutputs.push(null); + } + } + if (probe != null) { + probe.maxNumTensors = -Infinity; + probe.minNumTensors = Infinity; + } + const fetchAndFeedKey = outputNames.join(",") + "|" + feedDict.names().join(","); + let sorted; + let recipientCounts; + if (cachedSorted2[fetchAndFeedKey] == null) { + const out = getTopologicalSortAndRecipientCounts2(fetchArray, feedDict); + sorted = out.sorted; + recipientCounts = out.recipientCounts; + cachedSorted2[fetchAndFeedKey] = sorted; + cachedRecipientCounts2[fetchAndFeedKey] = recipientCounts; + } + sorted = cachedSorted2[fetchAndFeedKey]; + recipientCounts = {}; + if (!training) { + Object.assign(recipientCounts, cachedRecipientCounts2[fetchAndFeedKey]); + } + const internalFeedDict = new FeedDict2(feedDict); + for (let i = 0; i < sorted.length; ++i) { + if (probe != null) { + const numTensors = memory2().numTensors; + if (numTensors > probe.maxNumTensors) { + probe.maxNumTensors = numTensors; + } + if (numTensors < probe.minNumTensors) { + probe.minNumTensors = numTensors; + } + } + const symbolic = sorted[i]; + const srcLayer = symbolic.sourceLayer; + if (srcLayer instanceof InputLayer2) { + continue; + } + const inputValues = []; + const inputMasks = []; + const tensorsToDispose = []; + let maskExists = false; + for (const input3 of symbolic.inputs) { + const value = internalFeedDict.getValue(input3); + const mask = internalFeedDict.getMask(input3); + inputValues.push(value); + inputMasks.push(mask); + if (mask != null) { + maskExists = true; + } + if (!training) { + recipientCounts[input3.name]--; + if (recipientCounts[input3.name] === 0 && !feedDict.hasKey(input3) && outputNames.indexOf(input3.name) === -1 && !value.isDisposed && input3.sourceLayer.stateful !== true) { + tensorsToDispose.push(value); + } + } + } + if (maskExists) { + kwargs = kwargs || {}; + kwargs["mask"] = inputMasks[0]; + } + const outputTensors = toList2(srcLayer.apply(inputValues, kwargs)); + let outputMask = null; + if (srcLayer.supportsMasking) { + outputMask = srcLayer.computeMask(inputValues, inputMasks); + } + const layerOutputs = getNodeOutputs2(symbolic); + const outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; + for (let i2 = 0; i2 < outputSymbolicTensors.length; ++i2) { + if (!internalFeedDict.hasKey(outputSymbolicTensors[i2])) { + internalFeedDict.add(outputSymbolicTensors[i2], outputTensors[i2], Array.isArray(outputMask) ? outputMask[0] : outputMask); + } + const index = outputNames.indexOf(outputSymbolicTensors[i2].name); + if (index !== -1) { + finalOutputs[index] = outputTensors[i2]; + } + } + if (!training) { + dispose2(tensorsToDispose); + } + } + internalFeedDict.disposeMasks(); + return arrayFetches ? finalOutputs : finalOutputs[0]; +} +function getTopologicalSortAndRecipientCounts2(fetches, feedDict) { + util_exports2.assert(fetches != null && fetches.length > 0, () => `Expected at least one fetch, got none`); + let finalSorted = []; + let finalRecipientMap = {}; + if (fetches.length === 1) { + const out = getTopologicalSortAndRecipientCountsForOneFetch2(fetches[0], feedDict); + finalSorted = out.sorted; + finalRecipientMap = out.recipientMap; + } else { + const visited = new Set(); + for (const fetch6 of fetches) { + const { sorted, recipientMap } = getTopologicalSortAndRecipientCountsForOneFetch2(fetch6, feedDict); + for (const symbolicTensor of sorted) { + if (!visited.has(symbolicTensor.name)) { + finalSorted.push(symbolicTensor); + visited.add(symbolicTensor.name); + } + } + for (const name in recipientMap) { + if (finalRecipientMap[name] == null) { + finalRecipientMap[name] = new Set(); + } + recipientMap[name].forEach((recipient) => finalRecipientMap[name].add(recipient)); + } + } + } + return { + sorted: finalSorted, + recipientCounts: recipientMap2Counts2(finalRecipientMap) + }; +} +function recipientMap2Counts2(recipientMap) { + const recipientCounts = {}; + for (const name in recipientMap) { + recipientCounts[name] = recipientMap[name].size; + } + return recipientCounts; +} +function getTopologicalSortAndRecipientCountsForOneFetch2(fetch6, feedDict) { + const visited = new Set(); + const sorted = []; + const recipientMap = {}; + for (const key of feedDict.names()) { + visited.add(key); + } + const stack3 = []; + const marks = []; + stack3.push(fetch6); + while (stack3.length > 0) { + const top = stack3[stack3.length - 1]; + if (visited.has(top.name)) { + stack3.pop(); + continue; + } + const topIsMarked = marks[marks.length - 1] === stack3.length - 1; + if (top.inputs.length === 0 || topIsMarked) { + stack3.pop(); + sorted.push(top); + visited.add(top.name); + if (topIsMarked) { + marks.pop(); + } + } else { + marks.push(stack3.length - 1); + for (const input3 of top.inputs) { + if (recipientMap[input3.name] == null) { + recipientMap[input3.name] = new Set(); + } + recipientMap[input3.name].add(top.name); + if (visited.has(input3.name)) { + continue; + } + stack3.push(input3); + } + } + } + return { sorted, recipientMap }; +} +function getNodeOutputs2(fetch6) { + let layerOutputs; + if (fetch6.sourceLayer.inboundNodes.length === 1) { + layerOutputs = fetch6.sourceLayer.output; + } else { + let nodeIndex = null; + for (let i = 0; i < fetch6.sourceLayer.inboundNodes.length; ++i) { + for (const outputTensor of fetch6.sourceLayer.inboundNodes[i].outputTensors) { + if (outputTensor.id === fetch6.id) { + nodeIndex = i; + break; + } + } + } + layerOutputs = fetch6.sourceLayer.getOutputAt(nodeIndex); + } + return layerOutputs; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js +var Container2 = class extends Layer2 { + constructor(args) { + super({}); + this.containerNodes = new Set(); + this.name = args.name; + if (this.name == null) { + const prefix = this.getClassName().toLowerCase(); + this.name = getUid2(prefix); + } + this.supportsMasking = false; + this.trainable_ = true; + if (Array.isArray(args.inputs)) { + this.inputs = args.inputs.slice(); + } else { + this.inputs = [args.inputs]; + } + if (Array.isArray(args.outputs)) { + this.outputs = args.outputs.slice(); + } else { + this.outputs = [args.outputs]; + } + if (unique6(this.inputs).length !== this.inputs.length) { + throw new ValueError2(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map((x) => x.name)}`); + } + if (unique6(this.outputs).length !== this.outputs.length) { + console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map((x) => x.name)}`); + } + this.inputLayers = []; + this.inputLayersNodeIndices = []; + this.inputLayersTensorIndices = []; + this.outputLayers = []; + this.outputLayersNodeIndices = []; + this.outputLayersTensorIndices = []; + this.layers = []; + this.internalContainerRefs = []; + for (const x of this.outputs) { + const layer = x.sourceLayer; + const nodeIndex = x.nodeIndex; + const tensorIndex = x.tensorIndex; + this.outputLayers.push(layer); + this.outputLayersNodeIndices.push(nodeIndex); + this.outputLayersTensorIndices.push(tensorIndex); + } + for (const x of this.inputs) { + const layer = x.sourceLayer; + const nodeIndex = x.nodeIndex; + const tensorIndex = x.tensorIndex; + assert4(nodeIndex === 0, "input layer has >1 nodes"); + assert4(tensorIndex === 0, "input layer has >1 tensors"); + this.inputLayers.push(layer); + this.inputLayersNodeIndices.push(nodeIndex); + this.inputLayersTensorIndices.push(tensorIndex); + } + this.inputNames = []; + this.outputNames = []; + this.feedInputShapes = []; + this.feedInputNames = []; + this.feedOutputNames = []; + for (let i = 0; i < this.inputLayers.length; i++) { + const layer = this.inputLayers[i]; + if (!(layer instanceof InputLayer2)) { + throw new TypeError(`Input layers to a LayersModel must be InputLayer objects. Received inputs: ${args.inputs}. Input ${i} (0-based) originates from layer type ${layer.getClassName()}.`); + } + this.inputNames.push(layer.name); + this.feedInputShapes.push(layer.batchInputShape); + this.feedInputNames.push(layer.name); + } + for (const layer of this.outputLayers) { + this.outputNames.push(layer.name); + } + this.internalInputShapes = this.inputs.map((x) => x.shape); + this.internalOutputShapes = this.outputs.map((x) => x.shape); + const nodesDepths = {}; + const nodeIDToNode = {}; + const layersDepths = {}; + const layerIDToLayer = {}; + const layerIndices = {}; + const nodesInDecreasingDepth = []; + const buildMapOfGraph = (tensor3, finishedNodes2, nodesInProgress2, layer, nodeIndex, tensorIndex) => { + if (layer == null || nodeIndex == null || tensorIndex == null) { + layer = tensor3.sourceLayer; + nodeIndex = tensor3.nodeIndex; + tensorIndex = tensor3.tensorIndex; + } + const node2 = layer.inboundNodes[nodeIndex]; + if (nodesInProgress2.indexOf(node2) !== -1) { + throw new RuntimeError2(`The tensor ${tensor3.name} at layer "${layer.name}" is part of a cycle.`); + } + if (finishedNodes2.indexOf(node2) !== -1) { + return; + } + this.containerNodes.add(Container2.nodeKey(layer, nodeIndex)); + if (!(layer.id in layerIndices)) { + layerIndices[layer.id] = Object.keys(layerIndices).length; + } + if (nodesInProgress2.indexOf(node2) === -1) { + nodesInProgress2.push(node2); + } + const numInboundLayers = node2.inboundLayers.length; + for (let i = 0; i < numInboundLayers; i++) { + const x = node2.inputTensors[i]; + const layer2 = node2.inboundLayers[i]; + const nodeIndex2 = node2.nodeIndices[i]; + const tensorIndex2 = node2.tensorIndices[i]; + buildMapOfGraph(x, finishedNodes2, nodesInProgress2, layer2, nodeIndex2, tensorIndex2); + } + finishedNodes2.push(node2); + while (nodesInProgress2.indexOf(node2) >= 0) { + nodesInProgress2.splice(nodesInProgress2.indexOf(node2), 1); + } + nodesInDecreasingDepth.push(node2); + }; + const finishedNodes = []; + const nodesInProgress = []; + for (const x of this.outputs) { + buildMapOfGraph(x, finishedNodes, nodesInProgress); + } + const reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); + for (const node2 of reversedNodesInDecreasingDepth) { + nodeIDToNode[node2.id] = node2; + if (!(node2.id in nodesDepths)) { + nodesDepths[node2.id] = 0; + } + let depth = nodesDepths[node2.id]; + const previousDepth = layersDepths[node2.outboundLayer.id] == null ? 0 : layersDepths[node2.outboundLayer.id]; + depth = Math.max(depth, previousDepth); + layersDepths[node2.outboundLayer.id] = depth; + layerIDToLayer[node2.outboundLayer.id] = node2.outboundLayer; + nodesDepths[node2.id] = depth; + for (let i = 0; i < node2.inboundLayers.length; i++) { + const inboundLayer = node2.inboundLayers[i]; + const nodeIndex = node2.nodeIndices[i]; + const inboundNode = inboundLayer.inboundNodes[nodeIndex]; + const previousDepth2 = nodesDepths[inboundNode.id] == null ? 0 : nodesDepths[inboundNode.id]; + nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth2); + nodeIDToNode[inboundNode.id] = inboundNode; + } + } + const nodesByDepth = {}; + for (const nodeID in nodesDepths) { + const depth = nodesDepths[nodeID]; + if (!(depth in nodesByDepth)) { + nodesByDepth[depth] = []; + } + nodesByDepth[depth].push(nodeIDToNode[nodeID]); + } + const layersByDepth = {}; + for (const layerID in layersDepths) { + const depth = layersDepths[layerID]; + if (!(depth in layersByDepth)) { + layersByDepth[depth] = []; + } + layersByDepth[depth].push(layerIDToLayer[layerID]); + } + let depthKeys = Object.keys(layersByDepth).map((x) => parseInt(x, 10)).sort(reverseNumberCompare2); + this.layers = []; + for (const depth of depthKeys) { + const layersForDepth = layersByDepth[depth]; + layersForDepth.sort((a, b) => { + const aIndex = layerIndices[a.id]; + const bIndex = layerIndices[b.id]; + if (aIndex < bIndex) { + return -1; + } + if (aIndex > bIndex) { + return 1; + } + return 0; + }); + for (const layer of layersForDepth) { + if (layer instanceof Container2) { + this.internalContainerRefs.push(layer); + } + this.layers.push(layer); + } + } + this.layersByDepth = layersByDepth; + depthKeys = Object.keys(nodesByDepth).map((x) => parseInt(x, 10)).sort(reverseNumberCompare2); + const computableTensors = this.inputs.slice(); + const layersWithCompleteInput = []; + for (const depth of depthKeys) { + for (const node2 of nodesByDepth[depth]) { + const layer = node2.outboundLayer; + if (layer != null) { + for (const x of node2.inputTensors) { + if (computableTensors.indexOf(x) === -1) { + throw new RuntimeError2(`Graph disconnected: cannot obtain value for tensor ${x} at layer "${layer.name}". The following previous layers were accessed without issue: ${layersWithCompleteInput}`); + } + } + for (const x of node2.outputTensors) { + computableTensors.push(x); + } + layersWithCompleteInput.push(layer.name); + } + } + } + this.nodesByDepth = nodesByDepth; + const allNames = this.layers.map((x) => x.name); + for (const name of allNames) { + const numOccurrences = allNames.filter((x) => x === name).length; + if (numOccurrences !== 1) { + throw new RuntimeError2(`The name "${name}" is used ${numOccurrences} times in the model. All layer names should be unique. Layer names: ` + JSON.stringify(allNames)); + } + } + this.outboundNodes = []; + this.inboundNodes = []; + new Node2({ + outboundLayer: this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: this.inputs, + outputTensors: this.outputs, + inputMasks: this.inputs.map((x) => null), + outputMasks: this.outputs.map((x) => null), + inputShapes: this.inputs.map((x) => x.shape), + outputShapes: this.outputs.map((x) => x.shape) + }); + this.built = true; + this._refCount = 1; + } + assertNotDisposed() { + if (this._refCount === 0) { + throw new Error(`Container '${this.name}' is already disposed.`); + } + } + dispose() { + this.assertNotDisposed(); + const result = { refCountAfterDispose: null, numDisposedVariables: 0 }; + if (--this._refCount === 0) { + for (const layer of this.layers) { + result.numDisposedVariables += layer.dispose().numDisposedVariables; + } + for (const container of this.internalContainerRefs) { + result.numDisposedVariables += container.dispose().numDisposedVariables; + } + } + result.refCountAfterDispose = this._refCount; + return result; + } + get trainable() { + return this.trainable_; + } + set trainable(trainable) { + this.layers.forEach((layer) => { + layer._trainableWeights.forEach((w) => w.trainable = trainable); + }); + this.trainable_ = trainable; + } + get trainableWeights() { + if (this._trainableWeights.length > 0) { + throw new ValueError2("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array."); + } + if (!this.trainable) { + return []; + } + let weights = []; + for (const layer of this.layers) { + weights = weights.concat(layer.trainableWeights); + } + return weights; + } + get nonTrainableWeights() { + const weights = []; + for (const layer of this.layers) { + weights.push(...layer.nonTrainableWeights); + } + if (!this.trainable) { + const trainableWeights = []; + for (const layer of this.layers) { + trainableWeights.push(...layer.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + } + get weights() { + return this.trainableWeights.concat(this.nonTrainableWeights); + } + loadWeights(weights, strict = true) { + const nameToWeight = {}; + let totalWeightsCount = 0; + for (const layer of this.layers) { + for (const weight of layer.weights) { + if (nameToWeight[weight.originalName] != null) { + throw new ValueError2(`Duplicate weight name: ${weight.originalName}`); + } + nameToWeight[weight.originalName] = weight; + totalWeightsCount++; + } + } + const weightValueTuples = []; + for (const name in weights) { + let validatedName = name; + if (nameToWeight[name] == null) { + const tokens = name.split("/"); + const shortenNameArray = tokens.slice(0, -2).concat([tokens[tokens.length - 1]]); + validatedName = shortenNameArray.join("/"); + } + if (nameToWeight[validatedName] != null) { + weightValueTuples.push([nameToWeight[validatedName], weights[name]]); + } else if (strict) { + throw new ValueError2(`Provided weight data has no target variable: ${name}`); + } + delete nameToWeight[validatedName]; + } + if (strict) { + const unsetNames = []; + for (const name in nameToWeight) { + unsetNames.push(name); + } + if (unsetNames.length > 0) { + throw new ValueError2(`${unsetNames.length} of ${totalWeightsCount} weights are not set: ${unsetNames}`); + } + } + batchSetValue2(weightValueTuples); + } + updatedConfig() { + const theConfig = this.getConfig(); + const modelConfig = {}; + modelConfig["className"] = this.getClassName(); + modelConfig["config"] = theConfig; + modelConfig["kerasVersion"] = `tfjs-layers ${version7}`; + modelConfig["backend"] = "TensorFlow.js"; + return modelConfig; + } + toJSON(unused, returnString = true) { + const modelConfig = convertTsToPythonic2(this.updatedConfig()); + return returnString ? JSON.stringify(modelConfig) : modelConfig; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = toList2(inputs); + const feedDict = new FeedDict2(); + for (let i = 0; i < this.inputs.length; ++i) { + feedDict.add(this.inputs[i], inputs[i]); + } + return execute2(this.outputs, feedDict, kwargs); + }); + } + computeMask(inputs, mask) { + return tidy2(() => { + inputs = toList2(inputs); + let masks; + if (mask == null) { + masks = pyListRepeat2(null, inputs.length); + } else { + masks = toList2(mask); + } + return this.runInternalGraph(inputs, masks)[1]; + }); + } + computeOutputShape(inputShape) { + const inputShapes = normalizeShapeList2(inputShape); + if (inputShapes.length !== this.inputLayers.length) { + throw new ValueError2(`Invalid inputShape argument ${inputShape}: model has ${this.inputLayers.length} tensor inputs.`); + } + const layersToOutputShapes = {}; + for (let i = 0; i < inputShapes.length; i++) { + const layer = this.inputLayers[i]; + const inputShape2 = inputShapes[i]; + const shapeKey = layer.name + "_0_0"; + layersToOutputShapes[shapeKey] = inputShape2; + } + const depthKeys = Object.keys(this.nodesByDepth).map((x) => parseInt(x, 10)).sort(reverseNumberCompare2); + if (depthKeys.length > 1) { + for (const depth of depthKeys) { + const nodes = this.nodesByDepth[depth]; + for (const node2 of nodes) { + const layer = node2.outboundLayer; + if (this.inputLayers.map((x) => x.id).indexOf(layer.id) !== -1) { + continue; + } + const inputShapes2 = []; + for (let j = 0; j < node2.inboundLayers.length; j++) { + const inboundLayer = node2.inboundLayers[j]; + const nodeIndex2 = node2.nodeIndices[j]; + const tensorIndex = node2.tensorIndices[j]; + const shapeKey = `${inboundLayer.name}_${nodeIndex2}_${tensorIndex}`; + const inputShape2 = layersToOutputShapes[shapeKey]; + inputShapes2.push(inputShape2); + } + const outputShape = layer.computeOutputShape(singletonOrArray2(inputShapes2)); + const outputShapes2 = normalizeShapeList2(outputShape); + const nodeIndex = layer.inboundNodes.indexOf(node2); + for (let j = 0; j < outputShapes2.length; j++) { + const shapeKey = `${layer.name}_${nodeIndex}_${j}`; + layersToOutputShapes[shapeKey] = outputShapes2[j]; + } + } + } + } + const outputShapes = []; + const outputShapeKeys = []; + for (let i = 0; i < this.outputLayers.length; i++) { + const layer = this.outputLayers[i]; + const nodeIndex = this.outputLayersNodeIndices[i]; + const tensorIndex = this.outputLayersTensorIndices[i]; + const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`; + outputShapeKeys.push(shapeKey); + } + for (let i = 0; i < outputShapeKeys.length; i++) { + const key = outputShapeKeys[i]; + assert4(key in layersToOutputShapes); + outputShapes.push(layersToOutputShapes[key]); + } + return singletonOrArray2(outputShapes); + } + runInternalGraph(inputs, masks) { + if (masks == null) { + masks = pyListRepeat2(null, inputs.length); + } + const tensorMap = {}; + for (let i = 0; i < this.inputs.length; ++i) { + const x = this.inputs[i]; + const y = inputs[i]; + const mask = masks[i]; + tensorMap[x.id] = [y, mask]; + } + const depthKeys = Object.keys(this.nodesByDepth).map((x) => parseInt(x, 10)).sort(reverseNumberCompare2); + for (const depth of depthKeys) { + const nodes = this.nodesByDepth[depth]; + for (const node2 of nodes) { + const layer = node2.outboundLayer; + const referenceInputTensors = node2.inputTensors; + const referenceOutputTensors = node2.outputTensors; + const computedData = new Array(); + for (const x of referenceInputTensors) { + if (x.id in tensorMap) { + computedData.push(tensorMap[x.id]); + } + } + if (computedData.length === referenceInputTensors.length) { + let kwargs = {}; + let computedTensors; + let computedMasks; + let outputTensors2; + let outputMasks2; + if (node2.callArgs != null) { + kwargs = node2.callArgs; + } + if (computedData.length === 1) { + const [computedTensor, computedMask] = computedData[0]; + if (kwargs["mask"] == null) { + kwargs["mask"] = computedMask; + } + outputTensors2 = toList2(layer.call(computedTensor, kwargs)); + outputMasks2 = toList2(layer.computeMask(computedTensor, computedMask)); + computedTensors = [computedTensor]; + computedMasks = [computedMask]; + } else { + computedTensors = computedData.map((x) => x[0]); + computedMasks = computedData.map((x) => x[1]); + if (kwargs["mask"] == null) { + kwargs["mask"] = computedMasks; + } + outputTensors2 = toList2(layer.call(computedTensors, kwargs)); + outputMasks2 = toList2(layer.computeMask(computedTensors, computedMasks)); + } + if (layer.activityRegularizer) { + throw new NotImplementedError2("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet."); + } + for (let i = 0; i < referenceOutputTensors.length; ++i) { + const x = referenceOutputTensors[i]; + const y = outputTensors2[i]; + const mask = outputMasks2[i]; + tensorMap[x.id] = [y, mask]; + } + } + } + } + const outputTensors = []; + const outputMasks = []; + const outputShapes = []; + for (const x of this.outputs) { + assert4(x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`); + const [tensor3, mask] = tensorMap[x.id]; + outputShapes.push(tensor3.shape); + outputTensors.push(tensor3); + outputMasks.push(mask); + } + return [outputTensors, outputMasks, outputShapes]; + } + buildNodeConversionMap(layers) { + const nodeConversionMap = {}; + let keptNodes; + for (const layer of this.layers) { + keptNodes = layer instanceof Container2 ? 1 : 0; + for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + const nodeKey = Container2.nodeKey(layer, originalNodeIndex); + if (this.containerNodes.has(nodeKey)) { + nodeConversionMap[nodeKey] = keptNodes; + keptNodes += 1; + } + } + } + return nodeConversionMap; + } + getLayer(name, index) { + if (index != null) { + if (this.layers.length <= index) { + throw new ValueError2(`Was asked to retrieve layer at index ${index}, but model only has ${this.layers.length} layer(s).`); + } else { + return this.layers[index]; + } + } else { + if (name == null) { + throw new ValueError2("Provide either a layer name or layer index"); + } + } + for (const layer of this.layers) { + if (layer.name === name) { + return layer; + } + } + throw new ValueError2(`No such layer: ${name}`); + } + calculateLosses() { + return tidy2(() => { + const losses4 = []; + for (const layer of this.layers) { + for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { + const nodeKey = Container2.nodeKey(layer, nodeIndex); + if (this.containerNodes.has(nodeKey)) { + losses4.push(...layer.calculateLosses()); + } + } + } + return losses4; + }); + } + getConfig() { + const config3 = { name: this.name }; + const nodeConversionMap = this.buildNodeConversionMap(this.layers); + const layerConfigs = []; + for (const layer of this.layers) { + const layerClassName = layer.getClassName(); + const layerConfig = layer.getConfig(); + const filteredInboundNodes = []; + for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + const node2 = layer.inboundNodes[originalNodeIndex]; + const nodeKey = Container2.nodeKey(layer, originalNodeIndex); + let kwargs = {}; + if (this.containerNodes.has(nodeKey)) { + if (node2.callArgs) { + try { + JSON.stringify(node2.callArgs); + kwargs = node2.callArgs; + } catch (err) { + console.warn(`Layer ${layer.name} was passed non-serializable keyword arguments: ${node2.callArgs}. They will not be included in the serialized model (and thus will be missing at deserialization time).`); + kwargs = {}; + } + } + if (node2.inboundLayers.length > 0) { + const nodeData = []; + for (let i = 0; i < node2.inboundLayers.length; i++) { + const inboundLayer = node2.inboundLayers[i]; + const nodeIndex = node2.nodeIndices[i]; + const tensorIndex = node2.tensorIndices[i]; + const nodeKey2 = Container2.nodeKey(inboundLayer, nodeIndex); + let newNodeIndex = nodeConversionMap[nodeKey2]; + if (newNodeIndex == null) { + newNodeIndex = 0; + } + nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); + } + filteredInboundNodes.push(nodeData); + } + } + } + const dict = {}; + dict["name"] = layer.name; + dict["className"] = layerClassName; + dict["config"] = layerConfig; + dict["inboundNodes"] = filteredInboundNodes; + layerConfigs.push(dict); + } + config3["layers"] = layerConfigs; + const modelInputs = []; + for (let i = 0; i < this.inputLayers.length; i++) { + const layer = this.inputLayers[i]; + const nodeIndex = this.inputLayersNodeIndices[i]; + const nodeKey = Container2.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + let newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === void 0) { + newNodeIndex = 0; + } + const tensorIndex = this.inputLayersTensorIndices[i]; + modelInputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config3["inputLayers"] = modelInputs; + const modelOutputs = []; + for (let i = 0; i < this.outputLayers.length; i++) { + const layer = this.outputLayers[i]; + const nodeIndex = this.outputLayersNodeIndices[i]; + const nodeKey = Container2.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + let newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === void 0) { + newNodeIndex = 0; + } + const tensorIndex = this.outputLayersTensorIndices[i]; + modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config3["outputLayers"] = modelOutputs; + return config3; + } + static fromConfig(cls, config3, customObjects = {}, fastWeightInit = false) { + const createdLayers = {}; + const unprocessedNodes = {}; + function addUnprocessedNode(layer, nodeData) { + if (!(layer.name in unprocessedNodes)) { + unprocessedNodes[layer.name] = [nodeData]; + } else { + unprocessedNodes[layer.name].push(nodeData); + } + } + function processNode(layer, nodeData) { + const inputTensors2 = []; + let kwargs; + for (const inputData of nodeData) { + const inboundLayerName = inputData[0]; + const inboundNodeIndex = inputData[1]; + const inboundTensorIndex = inputData[2]; + kwargs = inputData[3] == null ? {} : inputData[3]; + if (!(inboundLayerName in createdLayers)) { + addUnprocessedNode(layer, nodeData); + return; + } + const inboundLayer = createdLayers[inboundLayerName]; + if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { + addUnprocessedNode(layer, nodeData); + return; + } + const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; + inputTensors2.push(inboundNode.outputTensors[inboundTensorIndex]); + } + if (inputTensors2.length > 0) { + layer.apply(singletonOrArray2(inputTensors2), kwargs); + } + } + function processLayer(layerData) { + const layerName = layerData["name"]; + const layer = deserialize2(layerData, config3["customObjects"] != null ? config3["customObjects"] : {}); + layer.setFastWeightInitDuringBuild(fastWeightInit); + createdLayers[layerName] = layer; + const inboundNodesData = layerData["inboundNodes"]; + inboundNodesData.forEach((nodeData) => { + if (!(nodeData instanceof Array)) { + throw new ValueError2(`Corrupted configuration, expected array for nodeData: ${nodeData}`); + } + addUnprocessedNode(layer, nodeData); + }); + } + const name = config3["name"]; + const layersFromConfig = config3["layers"]; + for (const layerData of layersFromConfig) { + processLayer(layerData); + } + while (!isObjectEmpty2(unprocessedNodes)) { + for (const layerData of layersFromConfig) { + const layer = createdLayers[layerData["name"]]; + if (layer.name in unprocessedNodes) { + const currentUnprocessedNodesForLayer = unprocessedNodes[layer.name]; + delete unprocessedNodes[layer.name]; + for (const nodeData of currentUnprocessedNodesForLayer) { + processNode(layer, nodeData); + } + } + } + } + const inputTensors = []; + const outputTensors = []; + const inputLayersFromConfig = config3["inputLayers"]; + for (const layerData of inputLayersFromConfig) { + const layerName = layerData[0]; + const nodeIndex = layerData[1]; + const tensorIndex = layerData[2]; + assert4(layerName in createdLayers); + const layer = createdLayers[layerName]; + const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + inputTensors.push(layerOutputTensors[tensorIndex]); + } + const outputLayersFromConfig = config3["outputLayers"]; + for (const layerData of outputLayersFromConfig) { + const layerName = layerData[0]; + const nodeIndex = layerData[1]; + const tensorIndex = layerData[2]; + assert4(layerName in createdLayers); + const layer = createdLayers[layerName]; + const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + outputTensors.push(layerOutputTensors[tensorIndex]); + } + return new cls({ inputs: inputTensors, outputs: outputTensors, name }); + } + get stateful() { + if (this._stateful) { + throw new ValueError2("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false."); + } + for (const layer of this.layers) { + if (layer.stateful) { + return true; + } + } + return false; + } + resetStates() { + tidy2(() => { + this.layers.forEach((layer) => { + if (layer.stateful) { + layer.resetStates(); + } + }); + }); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/training_utils.js +function standardizeSampleOrClassWeights2(xWeight, outputNames, weightType) { + const numOutputs = outputNames.length; + if (xWeight == null || Array.isArray(xWeight) && xWeight.length === 0) { + return outputNames.map((name) => null); + } + if (numOutputs === 1) { + if (Array.isArray(xWeight) && xWeight.length === 1) { + return xWeight; + } else if (typeof xWeight === "object" && outputNames[0] in xWeight) { + return [xWeight[outputNames[0]]]; + } else { + return [xWeight]; + } + } + if (Array.isArray(xWeight)) { + if (xWeight.length !== numOutputs) { + throw new Error(`Provided ${weightType} is an array of ${xWeight.length} element(s), but the model has ${numOutputs} outputs. Make sure a set of weights is provided for each model output.`); + } + return xWeight; + } else if (typeof xWeight === "object" && Object.keys(xWeight).length > 0 && typeof xWeight[Object.keys(xWeight)[0]] === "object") { + const output = []; + outputNames.forEach((outputName) => { + if (outputName in xWeight) { + output.push(xWeight[outputName]); + } else { + output.push(null); + } + }); + return output; + } else { + throw new Error(`The model has multiple (${numOutputs}) outputs, so ${weightType} must be either an array with ${numOutputs} elements or an object with ${outputNames} keys. Provided ${weightType} not understood: ${JSON.stringify(xWeight)}`); + } +} +function standardizeClassWeights2(classWeight, outputNames) { + return standardizeSampleOrClassWeights2(classWeight, outputNames, "classWeight"); +} +async function standardizeWeights2(y, sampleWeight, classWeight, sampleWeightMode) { + if (sampleWeight != null || sampleWeightMode != null) { + throw new Error("Support sampleWeight is not implemented yet"); + } + if (classWeight != null) { + const yClasses = tidy2(() => { + if (y.shape.length === 1) { + return clone2(y); + } else if (y.shape.length === 2) { + if (y.shape[1] > 1) { + const axis = 1; + return argMax4(y, axis); + } else if (y.shape[1] === 1) { + return reshape6(y, [y.shape[0]]); + } else { + throw new Error(`Encountered unexpected last-dimension size (${y.shape[1]}) during handling of class weights. The size is expected to be >= 1.`); + } + } else { + throw new Error(`Unexpected rank of target (y) tensor (${y.rank}) during handling of class weights. The rank is expected to be 1 or 2.`); + } + }); + const yClassIndices = Array.from(await yClasses.data()); + dispose2(yClasses); + const classSampleWeight = []; + yClassIndices.forEach((classIndex) => { + if (classWeight[classIndex] == null) { + throw new Error(`classWeight must contain all classes in the training data. The class ${classIndex} exists in the data but not in classWeight`); + } else { + classSampleWeight.push(classWeight[classIndex]); + } + }); + return tensor1d2(classSampleWeight, "float32"); + } else { + return null; + } +} +function computeWeightedLoss3(losses4, sampleWeights) { + return mul2(losses4, sampleWeights); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/training_dataset.js +var DEFAULT_VALIDATION_BATCH_SIZE2 = 32; +function standardizeDataIteratorOutput2(model15, iteratorOut) { + let xs; + let ys; + const iteratorOutObj = iteratorOut; + xs = iteratorOutObj["xs"]; + ys = iteratorOutObj["ys"]; + util_exports2.assert(xs != null && ys != null, () => `A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${iteratorOut}`); + const flattenedXs = flattenTensorOrArrayOrMap2("input", model15.inputNames, xs); + const flattenedYs = flattenTensorOrArrayOrMap2("output", model15.outputNames, ys); + const batchSize = flattenedXs[0].shape[0]; + util_exports2.assert(flattenedXs.length === model15.inputs.length, () => `LayersModel has ${model15.inputs.length} inputs, but the dataset provides ${flattenedXs.length} inputs. (Expected input keys: ${JSON.stringify(model15.inputNames)})`); + util_exports2.assert(flattenedYs.length === model15.outputs.length, () => `LayersModel has ${model15.outputs.length} outputs, but the dataset provides ${flattenedYs.length} outputs. (Expected output keys: ${JSON.stringify(model15.outputNames)})`); + for (let xIndex = 0; xIndex < flattenedXs.length; xIndex++) { + util_exports2.assert(flattenedXs[xIndex].shape[0] === batchSize, () => `Batch size mismatch: input ${model15.inputNames[xIndex]} has ${flattenedXs[xIndex].shape[0]}; expected ${batchSize} based on input ${model15.inputNames[0]}.`); + } + for (let yIndex = 0; yIndex < flattenedYs.length; yIndex++) { + util_exports2.assert(flattenedYs[yIndex].shape[0] === batchSize, () => `Batch size mismatch: output ${model15.outputNames[yIndex]} has ${flattenedYs[yIndex].shape[0]}; expected ${batchSize} based on input ${model15.inputNames[0]}.`); + } + return { xs: flattenedXs, ys: flattenedYs }; +} +function flattenTensorOrArrayOrMap2(inputOrOutput, names, values) { + if (values instanceof Tensor2) { + return [values]; + } else if (Array.isArray(values)) { + util_exports2.assert(values.length === names.length, () => `Received an array of ${values.length} Tensors, but expected ${names.length} to match the ${inputOrOutput} keys ${names}.`); + return values; + } else { + const result = []; + for (const name of names) { + if (values[name] == null) { + throw new ValueError2(`The feature data generated by the dataset lacks the required ${inputOrOutput} key '${name}'.`); + } + result.push(values[name]); + } + return result; + } +} +function standardizeTensorValidationData2(data) { + if (data.length === 3) { + throw new NotImplementedError2("Validation with sample weights is not implemented yet."); + } + return { xs: data[0], ys: data[1] }; +} +async function fitDataset2(model15, dataset, args) { + const hasBatchesPerEpoch = args.batchesPerEpoch != null; + util_exports2.assert(model15.optimizer != null, () => "You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."); + util_exports2.assert(args != null, () => `For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.`); + util_exports2.assert(args.epochs != null && args.epochs > 0 && Number.isInteger(args.epochs), () => `For fitDataset(), config.epochs is expected to be a positive integer, but got ${args.epochs}`); + util_exports2.assert(!hasBatchesPerEpoch || args.batchesPerEpoch > 0 && Number.isInteger(args.batchesPerEpoch), () => `For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${args.batchesPerEpoch}`); + util_exports2.assert(args["validationSplit"] == null, () => "`validationSplit` is not supported by `fitDataset()`. Use validationData instead."); + if (model15.isTraining) { + throw new Error("Cannot start training because another fit() call is ongoing."); + } + model15.isTraining = true; + try { + const doValidation = args.validationData != null; + let valXs; + let valYs; + if (doValidation) { + if (isDatasetObject2(args.validationData)) { + util_exports2.assert(args.validationBatches == null || args.validationBatches > 0 && Number.isInteger(args.validationBatches), () => `For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${args.validationBatches}`); + } else { + const validationData = standardizeTensorValidationData2(args.validationData); + valXs = validationData.xs; + valYs = validationData.ys; + } + } + const trainFunction = model15.makeTrainFunction(); + const outLabels = model15.getDedupedMetricsNames(); + let callbackMetrics; + if (doValidation) { + callbackMetrics = outLabels.slice().concat(outLabels.map((n) => "val_" + n)); + } else { + callbackMetrics = outLabels.slice(); + } + const callbacks3 = standardizeCallbacks2(args.callbacks, args.yieldEvery); + const verbose = args.verbose == null ? 1 : args.verbose; + const { callbackList, history } = configureCallbacks2(callbacks3, verbose, args.epochs, null, null, getStepsPerEpoch2(dataset, args), null, doValidation, callbackMetrics); + callbackList.setModel(model15); + model15.history = history; + await callbackList.onTrainBegin(); + model15.stopTraining_ = false; + let epoch = args.initialEpoch == null ? 0 : args.initialEpoch; + let dataIterator = await dataset.iterator(); + while (epoch < args.epochs) { + const epochLogs = {}; + await callbackList.onEpochBegin(epoch); + let stepsDone = 0; + let batchIndex = 0; + if (!hasBatchesPerEpoch) { + dataIterator = await dataset.iterator(); + } + while (hasBatchesPerEpoch ? stepsDone < args.batchesPerEpoch : true) { + const iteratorOut = await dataIterator.next(); + if (hasBatchesPerEpoch && iteratorOut.done) { + console.warn(`You provided \`batchesPerEpoch\` as ${args.batchesPerEpoch}, but your dataset iterator ran out of data after ${stepsDone} batches; interrupting training. Make sure that your dataset can generate at least \`batchesPerEpoch * epochs\` batches (in this case, ${args.batchesPerEpoch * args.epochs} batches). You may need to use the repeat() function when building your dataset.`); + break; + } + if (iteratorOut.value != null) { + const { xs, ys } = standardizeDataIteratorOutput2(model15, iteratorOut.value); + const batchLogs = {}; + batchLogs["batch"] = batchIndex; + batchLogs["size"] = xs[0].shape[0]; + await callbackList.onBatchBegin(batchIndex, batchLogs); + const sampleWeights = []; + if (args.classWeight != null) { + const standardClassWeights = standardizeClassWeights2(args.classWeight, model15.outputNames); + for (let i = 0; i < standardClassWeights.length; ++i) { + sampleWeights.push(await standardizeWeights2(ys[i], null, standardClassWeights[i])); + } + } + const ins = xs.concat(ys).concat(sampleWeights); + const outs = trainFunction(ins); + dispose2(ins); + for (let i = 0; i < outLabels.length; ++i) { + const label = outLabels[i]; + const out = outs[i]; + batchLogs[label] = out; + keep2(out); + } + await callbackList.onBatchEnd(batchIndex, batchLogs); + disposeTensorsInLogs2(batchLogs); + batchIndex++; + stepsDone++; + } + if (hasBatchesPerEpoch ? stepsDone >= args.batchesPerEpoch : iteratorOut.done) { + if (doValidation) { + let valOuts; + if (isDatasetObject2(args.validationData)) { + valOuts = toList2(await model15.evaluateDataset(args.validationData, { batches: args.validationBatches })); + } else { + valOuts = toList2(model15.evaluate(valXs, valYs, { + batchSize: args.validationBatchSize == null ? DEFAULT_VALIDATION_BATCH_SIZE2 : args.validationBatchSize, + verbose: 0 + })); + } + for (let i = 0; i < model15.metricsNames.length; ++i) { + epochLogs[`val_${model15.metricsNames[i]}`] = valOuts[i]; + } + } + break; + } + if (model15.stopTraining_) { + break; + } + } + await callbackList.onEpochEnd(epoch, epochLogs); + epoch++; + if (model15.stopTraining_) { + break; + } + } + await callbackList.onTrainEnd(); + await model15.history.syncData(); + return model15.history; + } finally { + model15.isTraining = false; + } +} +function getStepsPerEpoch2(dataset, args) { + let stepsPerEpoch = null; + if (args.batchesPerEpoch != null) { + stepsPerEpoch = args.batchesPerEpoch; + } else if (Number.isFinite(dataset.size)) { + stepsPerEpoch = dataset.size; + } + return stepsPerEpoch; +} +function isDatasetObject2(dataset) { + return typeof dataset.iterator === "function"; +} +function isLazyIteratorObject2(iterator) { + return typeof iterator.next === "function"; +} +async function evaluateDataset2(model15, dataset, args) { + args = args || {}; + const hasBatches = args.batches != null; + const f = model15.testFunction; + let outs = []; + if (args.verbose > 0) { + throw new NotImplementedError2("Verbose mode is not implemented yet."); + } + util_exports2.assert(!hasBatches || args.batches > 0 && Number.isInteger(args.batches), () => `Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(args.batches)}`); + const dataIterator = isLazyIteratorObject2(dataset) ? dataset : await dataset.iterator(); + let numExamples = 0; + let batch = 0; + while (hasBatches ? batch < args.batches : true) { + const iteratorOut = await dataIterator.next(); + outs = tidy2(() => { + if (iteratorOut.value) { + const { xs, ys } = standardizeDataIteratorOutput2(model15, iteratorOut.value); + const xsAndYs = xs.concat(ys); + const batchOuts = tidy2(() => f(xsAndYs)); + dispose2(xsAndYs); + if (batch === 0) { + for (let i = 0; i < batchOuts.length; ++i) { + outs.push(scalar2(0)); + } + } + const batchSize = xsAndYs[0].shape[0]; + for (let i = 0; i < batchOuts.length; ++i) { + const batchOut = batchOuts[i]; + const oldScalar = outs[i]; + outs[i] = tidy2(() => add6(outs[i], mul2(batchSize, batchOut))); + if (batch > 0) { + dispose2(oldScalar); + } + } + dispose2(batchOuts); + numExamples += batchSize; + ++batch; + } + return outs; + }); + if (iteratorOut.done) { + if (hasBatches) { + console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${args.batches} batches). You may need to use the repeat() function when building your dataset.`); + } + break; + } + } + for (let i = 0; i < outs.length; ++i) { + const oldScalar = outs[i]; + outs[i] = div3(outs[i], numExamples); + dispose2(oldScalar); + } + return singletonOrArray2(outs); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/training_tensors.js +function checkBatchSize2(batchSize) { + util_exports2.assert(batchSize > 0 && Number.isInteger(batchSize), () => `batchSize is required to be a positive integer, but got ${batchSize}`); +} +function sliceArrays2(arrays, start, stop) { + if (arrays == null) { + return [null]; + } else if (Array.isArray(arrays)) { + return arrays.map((array3) => sliceAlongFirstAxis2(array3, start, stop - start)); + } else { + return sliceAlongFirstAxis2(arrays, start, stop - start); + } +} +function sliceArraysByIndices2(arrays, indices) { + return tidy2(() => { + if (arrays == null) { + return null; + } else if (Array.isArray(arrays)) { + return arrays.map((array3) => sliceArraysByIndices2(array3, indices)); + } else { + return gather4(arrays, indices.dtype === "int32" ? indices : cast6(indices, "int32")); + } + }); +} +function makeBatches2(size2, batchSize) { + const output = []; + let batchStart = 0; + let batchEnd = null; + while (batchStart < size2) { + batchEnd = batchStart + batchSize; + if (batchEnd >= size2) { + batchEnd = size2; + } + output.push([batchStart, batchEnd]); + batchStart = batchEnd; + } + return output; +} +async function fitLoop2(model15, f, ins, outLabels, batchSize, epochs, verbose, callbacks3, valF, valIns, shuffle3, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { + if (batchSize == null) { + batchSize = 32; + } + if (epochs == null) { + epochs = 1; + } + if (shuffle3 == null) { + shuffle3 = true; + } + if (initialEpoch == null) { + initialEpoch = 0; + } + let doValidation = false; + if (valF != null && valIns != null) { + doValidation = true; + } + if (validationSteps != null) { + doValidation = true; + if (stepsPerEpoch == null) { + throw new ValueError2("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set."); + } + } + const numTrainSamples = model15.checkNumSamples(ins, batchSize, stepsPerEpoch, "steps_per_epoch"); + let indexArray; + if (numTrainSamples != null) { + indexArray = range7(0, numTrainSamples); + } + if (verbose == null) { + verbose = 1; + } + const { callbackList, history } = configureCallbacks2(callbacks3, verbose, epochs, initialEpoch, numTrainSamples, stepsPerEpoch, batchSize, doValidation, callbackMetrics); + callbackList.setModel(model15); + model15.history = history; + await callbackList.onTrainBegin(); + model15.stopTraining_ = false; + for (let epoch = initialEpoch; epoch < epochs; ++epoch) { + await callbackList.onEpochBegin(epoch); + const epochLogs = {}; + if (stepsPerEpoch != null) { + throw new NotImplementedError2("stepsPerEpoch mode is not implemented yet."); + } else { + if (shuffle3 === "batch") { + throw new NotImplementedError2("batch shuffling is not implemneted yet"); + } else if (shuffle3) { + util_exports2.shuffle(indexArray); + } + const epochIndexArray1D = tensor1d2(indexArray); + const batches = makeBatches2(numTrainSamples, batchSize); + for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + const batchLogs = {}; + await callbackList.onBatchBegin(batchIndex, batchLogs); + tidy2(() => { + const batchStart = batches[batchIndex][0]; + const batchEnd = batches[batchIndex][1]; + const batchIds = sliceAlongFirstAxis2(epochIndexArray1D, batchStart, batchEnd - batchStart); + batchLogs["batch"] = batchIndex; + batchLogs["size"] = batchEnd - batchStart; + const insBatch = sliceArraysByIndices2(ins, batchIds); + const outs = f(insBatch); + for (let i = 0; i < outLabels.length; ++i) { + const label = outLabels[i]; + const out = outs[i]; + batchLogs[label] = out; + keep2(out); + } + if (batchIndex === batches.length - 1) { + if (doValidation) { + const valOuts = model15.testLoop(valF, valIns, batchSize); + for (let i = 0; i < outLabels.length; ++i) { + const label = outLabels[i]; + const out = valOuts[i]; + keep2(out); + epochLogs["val_" + label] = out; + } + } + } + }); + await callbackList.onBatchEnd(batchIndex, batchLogs); + disposeTensorsInLogs2(batchLogs); + if (model15.stopTraining_) { + break; + } + } + epochIndexArray1D.dispose(); + } + await callbackList.onEpochEnd(epoch, epochLogs); + if (model15.stopTraining_) { + break; + } + } + await callbackList.onTrainEnd(); + await model15.history.syncData(); + return model15.history; +} +async function fitTensors2(model15, x, y, args = {}) { + if (model15.isTraining) { + throw new Error("Cannot start training because another fit() call is ongoing."); + } + model15.isTraining = true; + let inputs; + let targets; + let inputValX; + let inputValY; + let valX; + let valY; + let sampleWeights; + try { + const batchSize = args.batchSize == null ? 32 : args.batchSize; + checkBatchSize2(batchSize); + const checkBatchAxis = false; + const standardizedOuts = await model15.standardizeUserData(x, y, args.sampleWeight, args.classWeight, checkBatchAxis, batchSize); + inputs = standardizedOuts[0]; + targets = standardizedOuts[1]; + sampleWeights = standardizedOuts[2]; + let doValidation = false; + let valIns; + if (args.validationData != null && args.validationData.length > 0) { + doValidation = true; + if (args.validationData.length === 2) { + inputValX = args.validationData[0]; + inputValY = args.validationData[1]; + } else if (args.validationData.length === 3) { + throw new NotImplementedError2("validationData including sample weights is not supported yet."); + } else { + throw new ValueError2(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${args.validationData} is invalid.`); + } + const checkBatchAxis2 = true; + const valStandardized = await model15.standardizeUserData(inputValX, inputValY, null, null, checkBatchAxis2, batchSize); + valX = valStandardized[0]; + valY = valStandardized[1]; + valIns = valX.concat(valY); + } else if (args.validationSplit != null && args.validationSplit > 0 && args.validationSplit < 1) { + doValidation = true; + const splitAt = Math.floor(inputs[0].shape[0] * (1 - args.validationSplit)); + const originalBatchSize = inputs[0].shape[0]; + valX = sliceArrays2(inputs, splitAt, originalBatchSize); + inputs = sliceArrays2(inputs, 0, splitAt); + valY = sliceArrays2(targets, splitAt, originalBatchSize); + targets = sliceArrays2(targets, 0, splitAt); + valIns = valX.concat(valY); + } else if (args.validationSteps != null) { + doValidation = true; + } + const ins = inputs.concat(targets).concat(sampleWeights); + model15.checkTrainableWeightsConsistency(); + const trainFunction = model15.makeTrainFunction(); + const outLabels = model15.getDedupedMetricsNames(); + let valFunction; + let callbackMetrics; + if (doValidation) { + model15.makeTestFunction(); + valFunction = model15.testFunction; + callbackMetrics = outLabels.slice().concat(outLabels.map((n) => "val_" + n)); + } else { + valFunction = null; + valIns = []; + callbackMetrics = outLabels.slice(); + } + const callbacks3 = standardizeCallbacks2(args.callbacks, args.yieldEvery); + const out = await fitLoop2(model15, trainFunction, ins, outLabels, batchSize, args.epochs, args.verbose, callbacks3, valFunction, valIns, args.shuffle, callbackMetrics, args.initialEpoch, null, null); + return out; + } finally { + model15.isTraining = false; + disposeNewTensors2(inputs, x); + disposeNewTensors2(targets, y); + disposeNewTensors2(valX, inputValX); + disposeNewTensors2(valY, inputValY); + if (sampleWeights != null) { + dispose2(sampleWeights); + } + } +} +function ensureTensorsRank2OrHigher2(tensors) { + const outs = []; + if (tensors instanceof Tensor2) { + tensors = [tensors]; + } + for (let i = 0; i < tensors.length; ++i) { + const tensor3 = tensors[i]; + if (tensor3.rank === 1) { + outs.push(expandDims7(tensor3, 1)); + } else if (tensor3.rank === 0) { + throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar)."); + } else { + outs.push(tensor3); + } + } + return outs; +} +function disposeNewTensors2(tensors, refTensors) { + if (tensors == null) { + return; + } + const oldTensorIds = []; + if (refTensors instanceof Tensor2) { + oldTensorIds.push(refTensors.id); + } else if (Array.isArray(refTensors)) { + refTensors.forEach((t) => oldTensorIds.push(t.id)); + } else if (refTensors != null) { + for (const name in refTensors) { + const oldTensor = refTensors[name]; + oldTensorIds.push(oldTensor.id); + } + } + const tensorsToDispose = []; + if (tensors instanceof Tensor2) { + if (oldTensorIds.indexOf(tensors.id) === -1) { + tensorsToDispose.push(tensors); + } + } else if (Array.isArray(tensors)) { + tensors.forEach((t) => { + if (oldTensorIds.indexOf(t.id) === -1) { + tensorsToDispose.push(t); + } + }); + } else if (tensors != null) { + for (const name in tensors) { + const tensor3 = tensors[name]; + if (oldTensorIds.indexOf(tensor3.id) === -1) { + tensorsToDispose.push(tensor3); + } + } + } + tensorsToDispose.forEach((t) => { + if (!t.isDisposed) { + t.dispose(); + } + }); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js +function isDataTensor2(x) { + return x instanceof Tensor2; +} +function isDataArray2(x) { + return Array.isArray(x); +} +function isDataDict2(x) { + return !isDataTensor2(x) && !isDataArray2(x); +} +function standardizeInputData2(data, names, shapes, checkBatchAxis = true, exceptionPrefix = "") { + if (names == null || names.length === 0) { + if (data != null) { + let gotUnexpectedData = false; + if (isDataArray2(data) && data.length > 0) { + gotUnexpectedData = true; + } else if (isDataDict2(data)) { + for (const key in data) { + if (data.hasOwnProperty(key)) { + gotUnexpectedData = true; + break; + } + } + } else { + gotUnexpectedData = true; + } + if (gotUnexpectedData) { + throw new ValueError2(`Error when checking model ${exceptionPrefix} expected no data, but got ${data}`); + } + } + return []; + } + if (data == null) { + return names.map((name) => null); + } + let arrays; + if (isDataDict2(data)) { + data = data; + arrays = []; + for (const name of names) { + if (data[name] == null) { + throw new ValueError2(`No data provided for "${name}". Need data for each key in: ${names}`); + } + arrays.push(data[name]); + } + } else if (isDataArray2(data)) { + data = data; + if (data.length !== names.length) { + throw new ValueError2(`Error when checking model ${exceptionPrefix}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${names.length} Tensor(s), but instead got the following list of Tensor(s): ${data}`); + } + arrays = data; + } else { + data = data; + if (names.length > 1) { + throw new ValueError2(`The model ${exceptionPrefix} expects ${names.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${data.shape}`); + } + arrays = [data]; + } + arrays = ensureTensorsRank2OrHigher2(arrays); + if (shapes != null) { + for (let i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + const array3 = arrays[i]; + if (array3.shape.length !== shapes[i].length) { + throw new ValueError2(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s). but got array with shape ${array3.shape}`); + } + for (let j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + const dim = array3.shape[j]; + const refDim = shapes[i][j]; + if (refDim != null && refDim >= 0 && dim !== refDim) { + throw new ValueError2(`${exceptionPrefix} expected a batch of elements where each example has shape [${shapes[i].slice(1, shapes[i].length)}] (i.e.,tensor shape [*,${shapes[i].slice(1, shapes[i].length)}]) but the ${exceptionPrefix} received an input with ${array3.shape[0]} examples, each with shape [${array3.shape.slice(1, array3.shape.length)}] (tensor shape [${array3.shape}])`); + } + } + } + } + return arrays; +} +function checkArrayLengths2(inputs, targets, weights) { + const setX = unique6(inputs.map((input3) => input3.shape[0])); + setX.sort(); + const setY = unique6(targets.map((target) => target.shape[0])); + setY.sort(); + if (setX.length > 1) { + throw new ValueError2(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(inputs.map((input3) => input3.shape))}`); + } + if (setY.length > 1) { + throw new ValueError2(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(targets.map((target) => target.shape))}`); + } + if (setX.length > 0 && setY.length > 0 && !util_exports2.arraysEqual(setX, setY)) { + throw new ValueError2(`Input Tensors should have the same number of samples as target Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target sample(s).`); + } +} +function checkLossAndTargetCompatibility2(targets, lossFns, outputShapes) { + const keyLosses = [ + meanSquaredError4, + binaryCrossentropy4, + categoricalCrossentropy4 + ]; + for (let i = 0; i < targets.length; ++i) { + const y = targets[i]; + const loss = lossFns[i]; + const shape = outputShapes[i]; + if (loss == null) { + continue; + } + if (loss === categoricalCrossentropy4) { + if (y.shape[y.shape.length - 1] === 1) { + throw new ValueError2(`You are passing a target array of shape ${y.shape} while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].`); + } + } + if (keyLosses.indexOf(loss) !== -1) { + const slicedYShape = y.shape.slice(1); + const slicedShape = shape.slice(1); + for (let j = 0; j < slicedYShape.length; ++j) { + const targetDim = slicedYShape[j]; + const outDim = slicedShape[j]; + if (outDim != null && targetDim !== outDim) { + throw new ValueError2(`A target Tensor with shape ${y.shape} was passed for an output of shape ${shape}, while using a loss function that expects targets to have the same shape as the output.`); + } + } + } + } +} +function checkInputData2(data, names, shapes, checkBatchAxis = true, exceptionPrefix = "") { + let arrays; + if (Array.isArray(data)) { + if (data.length !== names.length) { + throw new ValueError2(`Error when checking model ${exceptionPrefix}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${names.length} Tensor(s), but instead got ${data.length} Tensors(s).`); + } + arrays = data; + } else { + if (names.length > 1) { + throw new ValueError2(`The model expects ${names.length} ${exceptionPrefix} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(data.shape)}.`); + } + arrays = [data]; + } + if (shapes != null) { + for (let i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + const array3 = arrays[i]; + if (array3.shape.length !== shapes[i].length) { + throw new ValueError2(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have ${shapes[i].length} dimension(s), but got array with shape ${JSON.stringify(array3.shape)}`); + } + for (let j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + const dim = array3.shape[j]; + const refDim = shapes[i][j]; + if (refDim != null) { + if (refDim !== dim) { + throw new ValueError2(`Error when checking ${exceptionPrefix}: expected ${names[i]} to have shape ${JSON.stringify(shapes[i])} but got array with shape ${JSON.stringify(array3.shape)}.`); + } + } + } + } + } +} +function collectMetrics2(metrics2, outputNames) { + if (metrics2 == null || Array.isArray(metrics2) && metrics2.length === 0) { + return outputNames.map((name) => []); + } + let wrappedMetrics; + if (typeof metrics2 === "string" || typeof metrics2 === "function") { + wrappedMetrics = [metrics2]; + } else if (Array.isArray(metrics2) || typeof metrics2 === "object") { + wrappedMetrics = metrics2; + } else { + throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${metrics2}`); + } + if (Array.isArray(wrappedMetrics)) { + return outputNames.map((name) => wrappedMetrics); + } else { + const nestedMetrics = []; + for (const name of outputNames) { + let outputMetrics = wrappedMetrics.hasOwnProperty(name) ? wrappedMetrics[name] : []; + if (!Array.isArray(outputMetrics)) { + outputMetrics = [outputMetrics]; + } + nestedMetrics.push(outputMetrics); + } + return nestedMetrics; + } +} +var LAYERS_MODEL_FORMAT_NAME2 = "layers-model"; +var LayersModel2 = class extends Container2 { + constructor(args) { + super(args); + this.isTraining = false; + } + summary(lineLength, positions, printFn = console.log) { + if (!this.built) { + throw new ValueError2(`This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).`); + } + printSummary2(this, lineLength, positions, printFn); + } + compile(args) { + if (args.loss == null) { + args.loss = []; + } + this.loss = args.loss; + if (typeof args.optimizer === "string") { + this.optimizer_ = getOptimizer2(args.optimizer); + this.isOptimizerOwned = true; + } else { + if (!(args.optimizer instanceof Optimizer2)) { + throw new ValueError2(`User-defined optimizer must be an instance of tf.Optimizer.`); + } + this.optimizer_ = args.optimizer; + this.isOptimizerOwned = false; + } + let lossFunctions = []; + if (!Array.isArray(args.loss) && typeof args.loss !== "string" && typeof args.loss !== "function") { + args.loss = args.loss; + for (const name in args.loss) { + if (this.outputNames.indexOf(name) === -1) { + throw new ValueError2(`Unknown entry in loss dictionary: "${name}". Only expected the following keys: ${this.outputNames}`); + } + } + for (const name of this.outputNames) { + if (args.loss[name] == null) { + console.warn(`Output "${name}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${name} during training`); + } + lossFunctions.push(get4(args.loss[name])); + } + } else if (Array.isArray(args.loss)) { + if (args.loss.length !== this.outputs.length) { + throw new ValueError2(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${args.loss}.`); + } + const theLosses = args.loss; + lossFunctions = theLosses.map((l) => get4(l)); + } else { + const lossFunction = get4(args.loss); + this.outputs.forEach((_) => { + lossFunctions.push(lossFunction); + }); + } + this.lossFunctions = lossFunctions; + this.feedOutputNames = []; + this.feedOutputShapes = []; + this.feedLossFns = []; + for (let i = 0; i < this.outputs.length; ++i) { + const shape = this.internalOutputShapes[i]; + const name = this.outputNames[i]; + this.feedOutputNames.push(name); + this.feedOutputShapes.push(shape); + this.feedLossFns.push(this.lossFunctions[i]); + } + const skipTargetIndices = []; + this.metrics = args.metrics; + this.metricsNames = ["loss"]; + this.metricsTensors = []; + nameScope2("loss", () => { + for (let i = 0; i < this.outputs.length; ++i) { + if (skipTargetIndices.indexOf(i) !== -1) { + continue; + } + const weightedLoss = this.lossFunctions[i]; + if (this.outputs.length > 1) { + this.metricsTensors.push([weightedLoss, i]); + this.metricsNames.push(this.outputNames[i] + "_loss"); + } + } + }); + const nestedMetrics = collectMetrics2(args.metrics, this.outputNames); + const appendMetric = (outputIndex, metricName, metricTensor) => { + if (this.outputNames.length > 1) { + metricName = this.outputNames[outputIndex] + "_" + metricName; + } + this.metricsNames.push(metricName); + this.metricsTensors.push([metricTensor, outputIndex]); + }; + nameScope2("metric", () => { + for (let i = 0; i < this.outputs.length; ++i) { + if (skipTargetIndices.indexOf(i) !== -1) { + continue; + } + const outputMetrics = nestedMetrics[i]; + const handleMetrics = (metrics2) => { + const metricNamePrefix = ""; + let metricName; + let accFn; + let weightedMetricFn; + for (const metric of metrics2) { + if (typeof metric === "string" && ["accuracy", "acc", "crossentropy", "ce"].indexOf(metric) !== -1) { + const outputShape = this.internalOutputShapes[i]; + if (outputShape[outputShape.length - 1] === 1 || this.lossFunctions[i] === binaryCrossentropy4) { + if (["accuracy", "acc"].indexOf(metric) !== -1) { + accFn = binaryAccuracy3; + } else if (["crossentropy", "ce"].indexOf(metric) !== -1) { + accFn = binaryCrossentropy5; + } + } else if (this.lossFunctions[i] === sparseCategoricalCrossentropy3) { + if (["accuracy", "acc"].indexOf(metric) !== -1) { + accFn = sparseCategoricalAccuracy3; + } else if (["crossentropy", "ce"].indexOf(metric) !== -1) { + accFn = sparseCategoricalCrossentropy4; + } + } else { + if (["accuracy", "acc"].indexOf(metric) !== -1) { + accFn = categoricalAccuracy3; + } else if (["crossentropy", "ce"].indexOf(metric) !== -1) { + accFn = categoricalCrossentropy5; + } + } + let suffix; + if (["accuracy", "acc"].indexOf(metric) !== -1) { + suffix = "acc"; + } else if (["crossentropy", "ce"].indexOf(metric) !== -1) { + suffix = "ce"; + } + weightedMetricFn = accFn; + metricName = metricNamePrefix + suffix; + } else { + const metricFn = get5(metric); + weightedMetricFn = metricFn; + metricName = metricNamePrefix + getLossOrMetricName2(metric); + } + let metricResult; + nameScope2(metricName, () => { + metricResult = weightedMetricFn; + }); + appendMetric(i, metricName, metricResult); + } + }; + handleMetrics(outputMetrics); + } + }); + this.collectedTrainableWeights = this.trainableWeights; + } + checkTrainableWeightsConsistency() { + if (this.collectedTrainableWeights == null) { + return; + } + if (this.trainableWeights.length !== this.collectedTrainableWeights.length) { + console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?"); + } + } + evaluate(x, y, args = {}) { + const batchSize = args.batchSize == null ? 32 : args.batchSize; + checkBatchSize2(batchSize); + const checkBatchAxis = true; + const standardizedOuts = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); + try { + const ins = standardizedOuts[0].concat(standardizedOuts[1]); + this.makeTestFunction(); + const f = this.testFunction; + const testOuts = this.testLoop(f, ins, batchSize, args.verbose, args.steps); + return singletonOrArray2(testOuts); + } finally { + disposeNewTensors2(standardizedOuts[0], x); + disposeNewTensors2(standardizedOuts[1], y); + } + } + async evaluateDataset(dataset, args) { + this.makeTestFunction(); + return evaluateDataset2(this, dataset, args); + } + checkNumSamples(ins, batchSize, steps, stepsName = "steps") { + let numSamples; + if (steps != null) { + numSamples = null; + if (batchSize != null) { + throw new ValueError2(`If ${stepsName} is set, batchSize must be null or undefined.Got batchSize = ${batchSize}`); + } + } else if (ins != null) { + if (Array.isArray(ins)) { + numSamples = ins[0].shape[0]; + } else { + numSamples = ins.shape[0]; + } + } else { + throw new ValueError2(`Either the input data should have a defined shape, or ${stepsName} shoud be specified.`); + } + return numSamples; + } + execute(inputs, outputs) { + if (Array.isArray(outputs) && outputs.length === 0) { + throw new ValueError2("`outputs` is an empty Array, which is not allowed."); + } + const outputsIsArray = Array.isArray(outputs); + const outputNames = outputsIsArray ? outputs : [outputs]; + const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); + const feedDict = new FeedDict2(); + if (inputs instanceof Tensor2) { + inputs = [inputs]; + } + if (Array.isArray(inputs)) { + if (inputs.length !== this.inputs.length) { + throw new ValueError2(`The number of inputs provided (${inputs.length}) does not match the number of inputs of this model (${this.inputs.length}).`); + } + for (let i = 0; i < this.inputs.length; ++i) { + feedDict.add(this.inputs[i], inputs[i]); + } + } else { + for (const input3 of this.inputs) { + const tensorValue = inputs[input3.name]; + if (tensorValue == null) { + throw new ValueError2(`No value is provided for the model's input ${input3.name}`); + } + feedDict.add(input3, tensorValue); + } + } + const executeOutputs = execute2(outputSymbolicTensors, feedDict); + return outputsIsArray ? executeOutputs : executeOutputs[0]; + } + retrieveSymbolicTensors(symbolicTensorNames) { + const outputSymbolicTensors = pyListRepeat2(null, symbolicTensorNames.length); + let outputsRemaining = symbolicTensorNames.length; + for (const layer of this.layers) { + const layerOutputs = Array.isArray(layer.output) ? layer.output : [layer.output]; + const layerOutputNames = layerOutputs.map((output) => output.name); + for (let i = 0; i < symbolicTensorNames.length; ++i) { + const index = layerOutputNames.indexOf(symbolicTensorNames[i]); + if (index !== -1) { + outputSymbolicTensors[i] = layerOutputs[index]; + outputsRemaining--; + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining > 0) { + const remainingNames = []; + outputSymbolicTensors.forEach((tensor3, i) => { + if (tensor3 == null) { + remainingNames.push(symbolicTensorNames[i]); + } + }); + throw new ValueError2(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(remainingNames)}`); + } + return outputSymbolicTensors; + } + predictLoop(ins, batchSize = 32, verbose = false) { + return tidy2(() => { + const numSamples = this.checkNumSamples(ins); + if (verbose) { + throw new NotImplementedError2("Verbose predictLoop() is not implemented yet."); + } + const batches = makeBatches2(numSamples, batchSize); + const outsBatches = this.outputs.map((output) => []); + for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + const batchOuts = tidy2(() => { + const batchStart = batches[batchIndex][0]; + const batchEnd = batches[batchIndex][1]; + const insBatch = sliceArrays2(ins, batchStart, batchEnd); + const feeds = []; + if (Array.isArray(insBatch)) { + for (let i = 0; i < insBatch.length; ++i) { + feeds.push({ key: this.inputs[i], value: insBatch[i] }); + } + } else { + feeds.push({ key: this.inputs[0], value: insBatch }); + } + const feedDict = new FeedDict2(feeds); + return execute2(this.outputs, feedDict); + }); + batchOuts.forEach((batchOut, i) => outsBatches[i].push(batchOut)); + } + return singletonOrArray2(outsBatches.map((batches2) => concat5(batches2, 0))); + }); + } + predict(x, args = {}) { + const xsRank2OrHigher = ensureTensorsRank2OrHigher2(x); + checkInputData2(xsRank2OrHigher, this.inputNames, this.feedInputShapes, false); + try { + const batchSize = args.batchSize == null ? 32 : args.batchSize; + checkBatchSize2(batchSize); + return this.predictLoop(xsRank2OrHigher, batchSize); + } finally { + disposeNewTensors2(xsRank2OrHigher, x); + } + } + predictOnBatch(x) { + checkInputData2(x, this.inputNames, this.feedInputShapes, true); + const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; + return this.predictLoop(x, batchSize); + } + standardizeUserDataXY(x, y, checkBatchAxis = true, batchSize) { + if (this.optimizer_ == null) { + throw new RuntimeError2("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs)."); + } + const outputShapes = []; + for (let i = 0; i < this.feedOutputShapes.length; ++i) { + const outputShape = this.feedOutputShapes[i]; + const lossFn = this.feedLossFns[i]; + if (lossFn === sparseCategoricalCrossentropy3) { + outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); + } else { + outputShapes.push(outputShape); + } + } + x = standardizeInputData2(x, this.feedInputNames, this.feedInputShapes, false, "input"); + y = standardizeInputData2(y, this.feedOutputNames, outputShapes, false, "target"); + checkArrayLengths2(x, y, null); + checkLossAndTargetCompatibility2(y, this.feedLossFns, this.feedOutputShapes); + if (this.stateful && batchSize != null && batchSize > 0) { + if (x[0].shape[0] % batchSize !== 0) { + throw new ValueError2(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${batchSize}. Found: ${x[0].shape[0]} sample(s).`); + } + } + return [x, y]; + } + async standardizeUserData(x, y, sampleWeight, classWeight, checkBatchAxis = true, batchSize) { + const [standardXs, standardYs] = this.standardizeUserDataXY(x, y, checkBatchAxis, batchSize); + if (sampleWeight != null) { + throw new Error("sample weight is not supported yet."); + } + let standardSampleWeights = null; + if (classWeight != null) { + const classWeights = standardizeClassWeights2(classWeight, this.outputNames); + standardSampleWeights = []; + for (let i = 0; i < classWeights.length; ++i) { + standardSampleWeights.push(await standardizeWeights2(standardYs[i], null, classWeights[i])); + } + } + return [standardXs, standardYs, standardSampleWeights]; + } + testLoop(f, ins, batchSize, verbose = 0, steps) { + return tidy2(() => { + const numSamples = this.checkNumSamples(ins, batchSize, steps, "steps"); + const outs = []; + if (verbose > 0) { + throw new NotImplementedError2("Verbose mode is not implemented yet."); + } + if (steps != null) { + throw new NotImplementedError2("steps mode in testLoop() is not implemented yet"); + } else { + const batches = makeBatches2(numSamples, batchSize); + const indexArray = tensor1d2(range7(0, numSamples)); + for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + const batchStart = batches[batchIndex][0]; + const batchEnd = batches[batchIndex][1]; + const batchIds = sliceAlongFirstAxis2(indexArray, batchStart, batchEnd - batchStart); + const insBatch = sliceArraysByIndices2(ins, batchIds); + const batchOuts = f(insBatch); + if (batchIndex === 0) { + for (let i = 0; i < batchOuts.length; ++i) { + outs.push(scalar2(0)); + } + } + for (let i = 0; i < batchOuts.length; ++i) { + const batchOut = batchOuts[i]; + outs[i] = add6(outs[i], mul2(batchEnd - batchStart, batchOut)); + } + } + for (let i = 0; i < outs.length; ++i) { + outs[i] = div3(outs[i], numSamples); + } + } + return outs; + }); + } + getDedupedMetricsNames() { + const outLabels = this.metricsNames; + const dedupedOutLabels = []; + for (let i = 0; i < outLabels.length; ++i) { + const label = outLabels[i]; + let newLabel = label; + if (count3(outLabels, label) > 1) { + const dupIndex = count3(outLabels.slice(0, i), label); + newLabel += `_${dupIndex}`; + } + dedupedOutLabels.push(newLabel); + } + return dedupedOutLabels; + } + makeTrainFunction() { + return (data) => { + const lossValues = []; + const inputs = data.slice(0, this.inputs.length); + const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); + const sampleWeights = data.slice(this.inputs.length + this.outputs.length, this.inputs.length + this.outputs.length * 2); + const metricsValues = []; + const totalLossFunction = () => { + const feeds = []; + for (let i = 0; i < this.inputs.length; ++i) { + feeds.push({ key: this.inputs[i], value: inputs[i] }); + } + const feedDict = new FeedDict2(feeds); + const outputs = execute2(this.outputs, feedDict, { "training": true }); + let totalLoss; + for (let i = 0; i < this.lossFunctions.length; ++i) { + const lossFunction = this.lossFunctions[i]; + let loss = lossFunction(targets[i], outputs[i]); + if (sampleWeights[i] != null) { + loss = computeWeightedLoss3(loss, sampleWeights[i]); + } + const meanLoss = mean4(loss); + lossValues.push(meanLoss); + if (i === 0) { + totalLoss = loss; + } else { + totalLoss = add6(totalLoss, loss); + } + } + for (let i = 0; i < this.metricsTensors.length; ++i) { + let weightedMetric; + if (this.outputs.length > 1 && i < this.outputs.length) { + weightedMetric = lossValues[i]; + } else { + const metric = this.metricsTensors[i][0]; + const outputIndex = this.metricsTensors[i][1]; + weightedMetric = mean4(metric(targets[outputIndex], outputs[outputIndex])); + } + keep2(weightedMetric); + metricsValues.push(weightedMetric); + } + totalLoss = mean4(totalLoss); + this.calculateLosses().forEach((regularizerLoss) => { + totalLoss = add6(totalLoss, regularizerLoss); + }); + return totalLoss; + }; + const variables = this.collectedTrainableWeights.map((param) => param.read()); + const returnCost = true; + const totalLossValue = this.optimizer_.minimize(totalLossFunction, returnCost, variables); + return [totalLossValue].concat(metricsValues); + }; + } + makeTestFunction() { + this.testFunction = (data) => { + return tidy2(() => { + const valOutputs = []; + let totalLoss; + const inputs = data.slice(0, this.inputs.length); + const targets = data.slice(this.inputs.length, this.inputs.length + this.outputs.length); + const feeds = []; + for (let i = 0; i < this.inputs.length; ++i) { + feeds.push({ key: this.inputs[i], value: inputs[i] }); + } + const feedDict = new FeedDict2(feeds); + const outputs = execute2(this.outputs, feedDict); + for (let i = 0; i < this.lossFunctions.length; ++i) { + const lossFunction = this.lossFunctions[i]; + const loss = mean4(lossFunction(targets[i], outputs[i])); + if (i === 0) { + totalLoss = loss; + } else { + totalLoss = add6(totalLoss, loss); + } + valOutputs.push(totalLoss); + } + for (let i = 0; i < this.metricsTensors.length; ++i) { + const metric = this.metricsTensors[i][0]; + const outputIndex = this.metricsTensors[i][1]; + const meanMetric = mean4(metric(targets[outputIndex], outputs[outputIndex])); + valOutputs.push(meanMetric); + } + return valOutputs; + }); + }; + } + async fit(x, y, args = {}) { + return fitTensors2(this, x, y, args); + } + async fitDataset(dataset, args) { + return fitDataset2(this, dataset, args); + } + async trainOnBatch(x, y) { + const standardizeOut = await this.standardizeUserData(x, y); + const inputs = standardizeOut[0]; + const targets = standardizeOut[1]; + const trainFunction = this.makeTrainFunction(); + const losses4 = trainFunction(inputs.concat(targets)); + const lossValues = []; + for (const loss of losses4) { + const v = await loss.data(); + lossValues.push(v[0]); + } + dispose2(losses4); + return singletonOrArray2(lossValues); + } + getNamedWeights(config3) { + const namedWeights = []; + const trainableOnly = config3 != null && config3.trainableOnly; + const weights = trainableOnly ? this.trainableWeights : this.weights; + const weightValues = this.getWeights(trainableOnly); + for (let i = 0; i < weights.length; ++i) { + if (trainableOnly && !weights[i].trainable) { + continue; + } + namedWeights.push({ name: weights[i].originalName, tensor: weightValues[i] }); + } + return namedWeights; + } + set stopTraining(stop) { + this.stopTraining_ = stop; + } + get stopTraining() { + return this.stopTraining_; + } + get optimizer() { + return this.optimizer_; + } + set optimizer(optimizer) { + if (this.optimizer_ !== optimizer) { + this.optimizer_ = optimizer; + this.isOptimizerOwned = false; + } + } + dispose() { + const result = super.dispose(); + if (result.refCountAfterDispose === 0 && this.optimizer != null && this.isOptimizerOwned) { + const numTensorsBeforeOptmizerDisposal = memory2().numTensors; + this.optimizer_.dispose(); + result.numDisposedVariables += numTensorsBeforeOptmizerDisposal - memory2().numTensors; + } + return result; + } + getLossIdentifiers() { + let lossNames; + if (typeof this.loss === "string") { + lossNames = toSnakeCase2(this.loss); + } else if (Array.isArray(this.loss)) { + for (const loss of this.loss) { + if (typeof loss !== "string") { + throw new Error("Serialization of non-string loss is not supported."); + } + } + lossNames = this.loss.map((name) => toSnakeCase2(name)); + } else { + const outputNames = Object.keys(this.loss); + lossNames = {}; + const losses4 = this.loss; + for (const outputName of outputNames) { + if (typeof losses4[outputName] === "string") { + lossNames[outputName] = toSnakeCase2(losses4[outputName]); + } else { + throw new Error("Serialization of non-string loss is not supported."); + } + } + } + return lossNames; + } + getMetricIdentifiers() { + if (typeof this.metrics === "string" || typeof this.metrics === "function") { + return [toSnakeCase2(getLossOrMetricName2(this.metrics))]; + } else if (Array.isArray(this.metrics)) { + return this.metrics.map((metric) => toSnakeCase2(getLossOrMetricName2(metric))); + } else { + const metricsIdentifiers = {}; + for (const key in this.metrics) { + metricsIdentifiers[key] = toSnakeCase2(getLossOrMetricName2(this.metrics[key])); + } + return metricsIdentifiers; + } + } + getTrainingConfig() { + return { + loss: this.getLossIdentifiers(), + metrics: this.getMetricIdentifiers(), + optimizer_config: { + class_name: this.optimizer.getClassName(), + config: this.optimizer.getConfig() + } + }; + } + loadTrainingConfig(trainingConfig) { + if (trainingConfig.weighted_metrics != null) { + throw new Error("Loading weight_metrics is not supported yet."); + } + if (trainingConfig.loss_weights != null) { + throw new Error("Loading loss_weights is not supported yet."); + } + if (trainingConfig.sample_weight_mode != null) { + throw new Error("Loading sample_weight_mode is not supported yet."); + } + const tsConfig = convertPythonicToTs2(trainingConfig.optimizer_config); + const optimizer = deserialize2(tsConfig); + let loss; + if (typeof trainingConfig.loss === "string") { + loss = toCamelCase2(trainingConfig.loss); + } else if (Array.isArray(trainingConfig.loss)) { + loss = trainingConfig.loss.map((lossEntry) => toCamelCase2(lossEntry)); + } else if (trainingConfig.loss != null) { + loss = {}; + for (const key in trainingConfig.loss) { + loss[key] = toCamelCase2(trainingConfig.loss[key]); + } + } + let metrics2; + if (Array.isArray(trainingConfig.metrics)) { + metrics2 = trainingConfig.metrics.map((metric) => toCamelCase2(metric)); + } else if (trainingConfig.metrics != null) { + metrics2 = {}; + for (const key in trainingConfig.metrics) { + metrics2[key] = toCamelCase2(trainingConfig.metrics[key]); + } + } + this.compile({ loss, metrics: metrics2, optimizer }); + } + async save(handlerOrURL, config3) { + if (typeof handlerOrURL === "string") { + const handlers = io_exports2.getSaveHandlers(handlerOrURL); + if (handlers.length === 0) { + throw new ValueError2(`Cannot find any save handlers for URL '${handlerOrURL}'`); + } else if (handlers.length > 1) { + throw new ValueError2(`Found more than one (${handlers.length}) save handlers for URL '${handlerOrURL}'`); + } + handlerOrURL = handlers[0]; + } + if (handlerOrURL.save == null) { + throw new ValueError2("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined."); + } + const weightDataAndSpecs = await io_exports2.encodeWeights(this.getNamedWeights(config3)); + const returnString = false; + const unusedArg = null; + const modelConfig = this.toJSON(unusedArg, returnString); + const modelArtifacts = { + modelTopology: modelConfig, + format: LAYERS_MODEL_FORMAT_NAME2, + generatedBy: `TensorFlow.js tfjs-layers v${version7}`, + convertedBy: null + }; + const includeOptimizer = config3 == null ? false : config3.includeOptimizer; + if (includeOptimizer && this.optimizer != null) { + modelArtifacts.trainingConfig = this.getTrainingConfig(); + const weightType = "optimizer"; + const { data: optimizerWeightData, specs: optimizerWeightSpecs } = await io_exports2.encodeWeights(await this.optimizer.getWeights(), weightType); + weightDataAndSpecs.specs.push(...optimizerWeightSpecs); + weightDataAndSpecs.data = io_exports2.concatenateArrayBuffers([weightDataAndSpecs.data, optimizerWeightData]); + } + if (this.userDefinedMetadata != null) { + const checkSize = true; + checkUserDefinedMetadata2(this.userDefinedMetadata, this.name, checkSize); + modelArtifacts.userDefinedMetadata = this.userDefinedMetadata; + } + modelArtifacts.weightData = weightDataAndSpecs.data; + modelArtifacts.weightSpecs = weightDataAndSpecs.specs; + return handlerOrURL.save(modelArtifacts); + } + setUserDefinedMetadata(userDefinedMetadata) { + checkUserDefinedMetadata2(userDefinedMetadata, this.name); + this.userDefinedMetadata = userDefinedMetadata; + } + getUserDefinedMetadata() { + return this.userDefinedMetadata; + } +}; +LayersModel2.className = "Model"; +serialization_exports2.registerClass(LayersModel2); +var Functional2 = class extends LayersModel2 { +}; +Functional2.className = "Functional"; +serialization_exports2.registerClass(Functional2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/models.js +var Sequential2 = class extends LayersModel2 { + constructor(args) { + super({ inputs: [], outputs: [] }); + args = args || {}; + this.trainable = true; + this.built = false; + this.name = args.name != null ? args.name : getUid2("sequential_"); + if (args.layers != null) { + for (const layer of args.layers) { + this.add(layer); + } + } + } + checkShape(layer) { + const shape = layer.inboundNodes[0].outputTensors[0].shape; + if (shape.some((x) => x < 0)) { + throw new ValueError2(`Negative dimension size caused by adding layer ${layer.name} with input shape [${layer.inboundNodes[0].inputTensors[0].shape}]`); + } + } + add(layer) { + const isLayerModelInstance = layer instanceof Sequential2 || layer instanceof LayersModel2; + let modelLayer; + if (isLayerModelInstance) { + modelLayer = layer; + if (modelLayer.outputs.length !== 1) { + throw new ValueError2("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API."); + } + if (modelLayer.inputs.length !== 1) { + throw new ValueError2("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API."); + } + } + if (this.outputs.length === 0) { + if (layer.inboundNodes.length === 0) { + if (layer.batchInputShape == null) { + throw new ValueError2("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument."); + } + const x = Input2({ + batchShape: layer.batchInputShape, + dtype: layer.dtype, + name: layer.name + "_input" + }); + layer.apply(x); + } + if (isLayerModelInstance) { + this.outputs = modelLayer.outputs; + this.inputs = modelLayer.inputs; + } else { + if (layer.inboundNodes.length !== 1) { + throw new ValueError2(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${layer.name} which has ${layer.inboundNodes.length} pre-existing inbound connections.`); + } + if (layer.inboundNodes[0].outputTensors.length !== 1) { + throw new ValueError2("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API."); + } + this.checkShape(layer); + this.outputs = [layer.inboundNodes[0].outputTensors[0]]; + this.inputs = getSourceInputs2(this.outputs[0]); + } + this.inboundNodes = []; + new Node2({ + outboundLayer: this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: this.inputs, + outputTensors: this.outputs, + inputMasks: pyListRepeat2(null, this.inputs.length), + outputMasks: [null], + inputShapes: this.inputs.map((x) => x.shape), + outputShapes: this.outputs[0].shape + }); + } else { + const outputTensor = layer.apply(this.outputs[0]); + if (Array.isArray(outputTensor)) { + throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API."); + } + this.checkShape(layer); + this.outputs = [outputTensor]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + this.layers.push(layer); + this.built = false; + } + pop() { + if (this.layers.length === 0) { + throw new TypeError("There are no layers in the model."); + } + this.layers.pop(); + if (this.layers.length === 0) { + this.outputs = []; + this.inboundNodes = []; + this.outboundNodes = []; + } else { + const lastLayerIndex = this.layers.length - 1; + this.layers[lastLayerIndex].outboundNodes = []; + this.outputs = [this.layers[lastLayerIndex].output]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + } + call(inputs, kwargs) { + if (this.model == null) { + this.build(); + } + return this.model.call(inputs, kwargs); + } + build(inputShape) { + getExactlyOneShape2(inputShape); + if (this.inputs.length === 0 || this.outputs.length === 0) { + throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first."); + } + this.model = new LayersModel2({ + inputs: this.inputs, + outputs: this.outputs[0], + name: this.name + "_model" + }); + this.model.trainable = this.trainable; + this.supportsMasking = this.model.supportsMasking; + this.inputLayers = this.model.inputLayers; + this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; + this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; + this.outputLayers = this.model.outputLayers; + this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; + this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; + this.nodesByDepth = this.model.nodesByDepth; + this.containerNodes = this.model.containerNodes; + this.outputNames = this.model.outputNames; + this.inputNames = this.model.inputNames; + this.built = true; + } + countParams() { + if (!this.built) { + this.build(); + } + return super.countParams(); + } + summary(lineLength, positions, printFn = console.log) { + if (!this.built) { + this.build(); + } + super.summary(lineLength, positions, printFn); + } + setWeights(weights) { + if (this.model == null) { + this.build(); + } + this.model.setWeights(weights); + } + evaluate(x, y, args = {}) { + if (!this.built) { + throw new RuntimeError2("The model needs to be compiled before being used."); + } + return this.model.evaluate(x, y, args); + } + async evaluateDataset(dataset, args) { + if (!this.built) { + throw new RuntimeError2("The model needs to be compiled before being used."); + } + return this.model.evaluateDataset(dataset, args); + } + predict(x, args = {}) { + if (this.model == null) { + this.build(); + } + return this.model.predict(x, args); + } + predictOnBatch(x) { + if (this.model == null) { + this.build(); + } + return this.model.predictOnBatch(x); + } + compile(args) { + this.build(); + this.model.compile(args); + this.optimizer_ = this.model.optimizer; + this.isOptimizerOwned = this.model.isOptimizerOwned; + this.loss = this.model.loss; + this.metrics = this.model.metrics; + this.metricsTensors = this.model.metricsTensors; + this.metricsNames = this.model.metricsNames; + } + get optimizer() { + return this.model == null ? void 0 : this.model.optimizer; + } + set optimizer(optimizer) { + this.model.optimizer = optimizer; + } + async fit(x, y, args = {}) { + if (!this.built) { + throw new RuntimeError2("The model needs to be compiled before being used."); + } + return this.model.fit(x, y, args); + } + async fitDataset(dataset, args) { + if (!this.built) { + throw new RuntimeError2("The model needs to be compiled before being used."); + } + return this.model.fitDataset(dataset, args); + } + async trainOnBatch(x, y) { + return this.model.trainOnBatch(x, y); + } + static fromConfig(cls, config3, customObjects = {}, fastWeightInit = false) { + let configArray; + let extraModelConfig = {}; + if (config3 instanceof Array) { + if (!(config3[0].className != null) || config3[0]["className"] === "Merge") { + throw new ValueError2("Legacy serialization format not supported yet."); + } + configArray = config3; + } else { + util_exports2.assert(config3["layers"] != null, () => `When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.`); + configArray = config3["layers"]; + delete config3["layers"]; + extraModelConfig = config3; + } + const model15 = new cls(extraModelConfig); + if (!(model15 instanceof Sequential2)) { + throw new NotImplementedError2(`Sequential.fromConfig called on non-Sequential input: ${model15}`); + } + for (const conf of configArray) { + const customObjects2 = void 0; + const layer = deserialize2(conf, customObjects2, fastWeightInit); + if (fastWeightInit) { + layer.setFastWeightInitDuringBuild(true); + } + model15.add(layer); + } + return model15; + } + set stopTraining(stop) { + if (this.model == null) { + throw new ValueError2("Cannot set the stopTraining property of a sequential model before it is compiled."); + } + this.model.stopTraining = stop; + } + get stopTraining() { + if (this.model == null) { + throw new ValueError2("Cannot get the stopTraining property of a sequential model before it is compiled."); + } + return this.model.stopTraining; + } + getConfig() { + const layers = []; + for (const layer of this.layers) { + const dict = {}; + dict["className"] = layer.getClassName(); + dict["config"] = layer.getConfig(); + layers.push(dict); + } + return { name: this.name, layers }; + } +}; +Sequential2.className = "Sequential"; +serialization_exports2.registerClass(Sequential2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/activations.js +var Activation3 = class extends serialization_exports2.Serializable { + getConfig() { + return {}; + } +}; +var Elu4 = class extends Activation3 { + apply(x, alpha = 1) { + return elu7(x, alpha); + } +}; +Elu4.className = "elu"; +serialization_exports2.registerClass(Elu4); +var Selu4 = class extends Activation3 { + apply(x) { + return selu4(x); + } +}; +Selu4.className = "selu"; +serialization_exports2.registerClass(Selu4); +var Relu4 = class extends Activation3 { + apply(x) { + return relu4(x); + } +}; +Relu4.className = "relu"; +serialization_exports2.registerClass(Relu4); +var Relu64 = class extends Activation3 { + apply(x) { + return tidy2(() => minimum5(6, relu4(x))); + } +}; +Relu64.className = "relu6"; +serialization_exports2.registerClass(Relu64); +var Linear2 = class extends Activation3 { + apply(x) { + return x; + } +}; +Linear2.className = "linear"; +serialization_exports2.registerClass(Linear2); +var Sigmoid4 = class extends Activation3 { + apply(x) { + return sigmoid5(x); + } +}; +Sigmoid4.className = "sigmoid"; +serialization_exports2.registerClass(Sigmoid4); +var HardSigmoid2 = class extends Activation3 { + apply(x) { + return hardSigmoid2(x); + } +}; +HardSigmoid2.className = "hardSigmoid"; +serialization_exports2.registerClass(HardSigmoid2); +var Softplus4 = class extends Activation3 { + apply(x) { + return softplus4(x); + } +}; +Softplus4.className = "softplus"; +serialization_exports2.registerClass(Softplus4); +var Softsign2 = class extends Activation3 { + apply(x) { + return softsign2(x); + } +}; +Softsign2.className = "softsign"; +serialization_exports2.registerClass(Softsign2); +var Tanh4 = class extends Activation3 { + apply(x) { + return tanh6(x); + } +}; +Tanh4.className = "tanh"; +serialization_exports2.registerClass(Tanh4); +var Softmax5 = class extends Activation3 { + apply(x, axis = -1) { + return softmax6(x, axis); + } +}; +Softmax5.className = "softmax"; +serialization_exports2.registerClass(Softmax5); +var LogSoftmax4 = class extends Activation3 { + apply(x, axis = -1) { + return logSoftmax2(x, axis); + } +}; +LogSoftmax4.className = "logSoftmax"; +serialization_exports2.registerClass(LogSoftmax4); +var Swish2 = class extends Activation3 { + apply(x, alpha = 1) { + return tidy2(() => mul2(sigmoid5(mul2(x, alpha)), x)); + } +}; +Swish2.className = "swish"; +serialization_exports2.registerClass(Swish2); +var Mish2 = class extends Activation3 { + apply(x) { + return tidy2(() => mul2(x, tanh6(softplus4(x)))); + } +}; +Mish2.className = "mish"; +serialization_exports2.registerClass(Mish2); +function serializeActivation2(activation2) { + return activation2.getClassName(); +} +function deserializeActivation2(config3, customObjects = {}) { + return deserializeKerasObject2(config3, serialization_exports2.SerializationMap.getMap().classNameMap, customObjects, "activation"); +} +function getActivation2(identifier) { + if (identifier == null) { + const config3 = {}; + config3["className"] = "linear"; + config3["config"] = {}; + return deserializeActivation2(config3); + } + if (typeof identifier === "string") { + const config3 = {}; + config3["className"] = identifier; + config3["config"] = {}; + return deserializeActivation2(config3); + } else if (identifier instanceof Activation3) { + return identifier; + } else { + return deserializeActivation2(identifier); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js +function assertObjectArgs2(args) { + if (args != null && typeof args !== "object") { + throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${args}`); + } +} +var Regularizer2 = class extends serialization_exports2.Serializable { +}; +var L1L22 = class extends Regularizer2 { + constructor(args) { + super(); + assertObjectArgs2(args); + this.l1 = args == null || args.l1 == null ? 0.01 : args.l1; + this.l2 = args == null || args.l2 == null ? 0.01 : args.l2; + this.hasL1 = this.l1 !== 0; + this.hasL2 = this.l2 !== 0; + } + apply(x) { + return tidy2(() => { + let regularization = zeros4([1]); + if (this.hasL1) { + regularization = add6(regularization, sum7(mul2(this.l1, abs4(x)))); + } + if (this.hasL2) { + regularization = add6(regularization, sum7(mul2(this.l2, square5(x)))); + } + return reshape6(regularization, []); + }); + } + getConfig() { + return { "l1": this.l1, "l2": this.l2 }; + } + static fromConfig(cls, config3) { + return new cls({ l1: config3["l1"], l2: config3["l2"] }); + } +}; +L1L22.className = "L1L2"; +serialization_exports2.registerClass(L1L22); +var REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2 = { + "l1l2": "L1L2" +}; +function serializeRegularizer2(constraint) { + return serializeKerasObject2(constraint); +} +function deserializeRegularizer2(config3, customObjects = {}) { + return deserializeKerasObject2(config3, serialization_exports2.SerializationMap.getMap().classNameMap, customObjects, "regularizer"); +} +function getRegularizer2(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === "string") { + const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2 ? REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP2[identifier] : identifier; + const config3 = { className, config: {} }; + return deserializeRegularizer2(config3); + } else if (identifier instanceof Regularizer2) { + return identifier; + } else { + return deserializeRegularizer2(identifier); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js +var ReLU2 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.supportsMasking = true; + if (args != null) { + this.maxValue = args.maxValue; + } + } + call(inputs, kwargs) { + inputs = getExactlyOneTensor2(inputs); + let output = relu4(inputs); + if (this.maxValue != null) { + output = clipByValue3(output, 0, this.maxValue); + } + return output; + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const config3 = { maxValue: this.maxValue }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +ReLU2.className = "ReLU"; +serialization_exports2.registerClass(ReLU2); +var LeakyReLU2 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.DEFAULT_ALPHA = 0.3; + if (args == null) { + args = {}; + } + this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; + } + call(inputs, kwargs) { + const x = getExactlyOneTensor2(inputs); + return leakyRelu5(x, this.alpha); + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const config3 = { alpha: this.alpha }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +LeakyReLU2.className = "LeakyReLU"; +serialization_exports2.registerClass(LeakyReLU2); +var PReLU2 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.DEFAULT_ALPHA_INITIALIZER = "zeros"; + if (args == null) { + args = {}; + } + this.supportsMasking = true; + this.alphaInitializer = getInitializer2(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); + this.alphaRegularizer = getRegularizer2(args.alphaRegularizer); + this.alphaConstraint = getConstraint2(args.alphaConstraint); + if (args.sharedAxes == null) { + this.sharedAxes = null; + } else if (Array.isArray(args.sharedAxes)) { + this.sharedAxes = args.sharedAxes; + } else if (typeof args.sharedAxes === "number") { + this.sharedAxes = [args.sharedAxes]; + } else { + throw new ValueError2(`Expected sharedAxes to be a number or an array of numbers, but got ${args.sharedAxes}`); + } + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const paramShape = inputShape.slice(1); + if (this.sharedAxes != null) { + for (const i of this.sharedAxes) { + paramShape[i - 1] = 1; + } + } + this.alpha = this.addWeight("alpha", paramShape, "float32", this.alphaInitializer, this.alphaRegularizer, true, this.alphaConstraint); + const axes = {}; + if (this.sharedAxes != null) { + for (let i = 1; i < inputShape.length; ++i) { + axes[i] = inputShape[i]; + } + } + this.inputSpec = [new InputSpec2({ + ndim: inputShape.length, + axes + })]; + this.built = true; + } + call(inputs, kwargs) { + inputs = getExactlyOneTensor2(inputs); + return prelu6(inputs, this.alpha.read()); + } + getConfig() { + const config3 = { + alphaInitializer: serializeInitializer2(this.alphaInitializer), + alphaRegularizer: serializeRegularizer2(this.alphaRegularizer), + alphaConstraint: serializeConstraint2(this.alphaConstraint), + sharedAxes: this.sharedAxes + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +PReLU2.className = "PReLU"; +serialization_exports2.registerClass(PReLU2); +var ELU5 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.DEFAULT_ALPHA = 1; + if (args == null) { + args = {}; + } + if (args.alpha != null && args.alpha !== this.DEFAULT_ALPHA) { + throw new NotImplementedError2(`Non-default alpha value (${args.alpha}) is not supported by the ELU layer yet.`); + } + this.alpha = args.alpha == null ? this.DEFAULT_ALPHA : args.alpha; + } + call(inputs, kwargs) { + const x = getExactlyOneTensor2(inputs); + return elu6(x); + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const config3 = { alpha: this.alpha }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +ELU5.className = "ELU"; +serialization_exports2.registerClass(ELU5); +var ThresholdedReLU2 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.DEFAULT_THETA = 1; + if (args == null) { + args = {}; + } + this.theta = args.theta == null ? this.DEFAULT_THETA : args.theta; + } + call(inputs, kwargs) { + const x = getExactlyOneTensor2(inputs); + return mul2(x, cast6(greater5(x, this.theta), "float32")); + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const config3 = { theta: this.theta }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +ThresholdedReLU2.className = "ThresholdedReLU"; +serialization_exports2.registerClass(ThresholdedReLU2); +var Softmax6 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.DEFAULT_AXIS = 1; + if (args == null) { + args = {}; + } + this.softmax = new Softmax5().apply; + this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; + } + call(inputs, kwargs) { + const x = getExactlyOneTensor2(inputs); + return this.softmax(x, this.axis); + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const config3 = { axis: this.axis }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Softmax6.className = "Softmax"; +serialization_exports2.registerClass(Softmax6); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js +function normalizeArray2(value, n, name) { + if (typeof value === "number") { + return pyListRepeat2(value, n); + } else { + if (value.length !== n) { + throw new ValueError2(`The ${name} argument must be an integer or tuple of ${n} integers. Received: ${value.length} elements.`); + } + for (let i = 0; i < n; ++i) { + const singleValue = value[i]; + if (!isInteger2(singleValue)) { + throw new ValueError2(`The ${name} argument must be an integer or tuple of ${n} integers. Received: ${JSON.stringify(value)} including a non-integer number ${singleValue}`); + } + } + return value; + } +} +function convOutputLength2(inputLength, filterSize, padding2, stride, dilation = 1) { + if (inputLength == null) { + return inputLength; + } + const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); + let outputLength; + if (padding2 === "same") { + outputLength = inputLength; + } else { + outputLength = inputLength - dilatedFilterSize + 1; + } + return Math.floor((outputLength + stride - 1) / stride); +} +function deconvLength2(dimSize, strideSize, kernelSize, padding2) { + if (dimSize == null) { + return null; + } + if (padding2 === "valid") { + dimSize = dimSize * strideSize + max7([kernelSize - strideSize, 0]); + } else if (padding2 === "same") { + dimSize = dimSize * strideSize; + } else { + throw new ValueError2(`Unsupport padding mode: ${padding2}.`); + } + return dimSize; +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js +function preprocessConv2DInput2(x, dataFormat) { + return tidy2(() => { + checkDataFormat2(dataFormat); + if (dataFormat === "channelsFirst") { + return transpose5(x, [0, 2, 3, 1]); + } else { + return x; + } + }); +} +function preprocessConv3DInput2(x, dataFormat) { + return tidy2(() => { + checkDataFormat2(dataFormat); + if (dataFormat === "channelsFirst") { + return transpose5(x, [0, 2, 3, 4, 1]); + } else { + return x; + } + }); +} +function conv1dWithBias2(x, kernel, bias, strides = 1, padding2 = "valid", dataFormat, dilationRate = 1) { + return tidy2(() => { + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + checkDataFormat2(dataFormat); + if (x.shape.length !== 3) { + throw new ValueError2(`The input of a conv1dWithBias operation should be 3, but is ${x.shape.length} instead.`); + } + if (kernel.shape.length !== 3) { + throw new ValueError2(`The kernel for a conv1dWithBias operation should be 3, but is ${kernel.shape.length} instead`); + } + if (bias != null && bias.shape.length !== 1) { + throw new ValueError2(`The bias for a conv1dWithBias operation should be 1, but is ${kernel.shape.length} instead`); + } + if (dataFormat === "channelsFirst") { + x = transpose5(x, [0, 2, 1]); + } + if (padding2 === "causal") { + throw new NotImplementedError2("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet."); + } + let y = conv1d3(x, kernel, strides, padding2 === "same" ? "same" : "valid", "NWC", dilationRate); + if (bias != null) { + y = biasAdd2(y, bias); + } + return y; + }); +} +function conv2dWithBiasActivation2(x, kernel, bias, strides = [1, 1], padding2 = "valid", dataFormat, dilationRate, activation2 = null) { + return tidy2(() => { + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + checkDataFormat2(dataFormat); + if (x.rank !== 3 && x.rank !== 4) { + throw new ValueError2(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${x.rank}.`); + } + if (kernel.rank !== 3 && kernel.rank !== 4) { + throw new ValueError2(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${x.rank}.`); + } + let y = preprocessConv2DInput2(x, dataFormat); + if (padding2 === "causal") { + throw new NotImplementedError2("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet."); + } + y = fused_ops_exports2.conv2d({ + x: y, + filter: kernel, + strides, + pad: padding2 === "same" ? "same" : "valid", + dilations: dilationRate, + dataFormat: "NHWC", + bias, + activation: activation2 + }); + if (dataFormat === "channelsFirst") { + y = transpose5(y, [0, 3, 1, 2]); + } + return y; + }); +} +function conv3dWithBias2(x, kernel, bias, strides = [1, 1, 1], padding2 = "valid", dataFormat, dilationRate) { + return tidy2(() => { + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + checkDataFormat2(dataFormat); + if (x.rank !== 4 && x.rank !== 5) { + throw new ValueError2(`conv3dWithBias expects input to be of rank 4 or 5, but received ${x.rank}.`); + } + if (kernel.rank !== 4 && kernel.rank !== 5) { + throw new ValueError2(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${x.rank}.`); + } + let y = preprocessConv3DInput2(x, dataFormat); + if (padding2 === "causal") { + throw new NotImplementedError2("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet."); + } + y = conv3d3(y, kernel, strides, padding2 === "same" ? "same" : "valid", "NDHWC", dilationRate); + if (bias != null) { + y = biasAdd2(y, bias); + } + if (dataFormat === "channelsFirst") { + y = transpose5(y, [0, 4, 1, 2, 3]); + } + return y; + }); +} +var BaseConv2 = class extends Layer2 { + constructor(rank, args) { + super(args); + this.bias = null; + this.DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; + this.DEFAULT_BIAS_INITIALIZER = "zeros"; + BaseConv2.verifyArgs(args); + this.rank = rank; + assertPositiveInteger2(this.rank, "rank"); + if (this.rank !== 1 && this.rank !== 2 && this.rank !== 3) { + throw new NotImplementedError2(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`); + } + this.kernelSize = normalizeArray2(args.kernelSize, rank, "kernelSize"); + this.strides = normalizeArray2(args.strides == null ? 1 : args.strides, rank, "strides"); + this.padding = args.padding == null ? "valid" : args.padding; + checkPaddingMode2(this.padding); + this.dataFormat = args.dataFormat == null ? "channelsLast" : args.dataFormat; + checkDataFormat2(this.dataFormat); + this.activation = getActivation2(args.activation); + this.useBias = args.useBias == null ? true : args.useBias; + this.biasInitializer = getInitializer2(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); + this.biasConstraint = getConstraint2(args.biasConstraint); + this.biasRegularizer = getRegularizer2(args.biasRegularizer); + this.activityRegularizer = getRegularizer2(args.activityRegularizer); + this.dilationRate = normalizeArray2(args.dilationRate == null ? 1 : args.dilationRate, rank, "dilationRate"); + if (this.rank === 1 && (Array.isArray(this.dilationRate) && this.dilationRate.length !== 1)) { + throw new ValueError2(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`); + } else if (this.rank === 2) { + if (typeof this.dilationRate === "number") { + this.dilationRate = [this.dilationRate, this.dilationRate]; + } else if (this.dilationRate.length !== 2) { + throw new ValueError2(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`); + } + } else if (this.rank === 3) { + if (typeof this.dilationRate === "number") { + this.dilationRate = [this.dilationRate, this.dilationRate, this.dilationRate]; + } else if (this.dilationRate.length !== 3) { + throw new ValueError2(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`); + } + } + } + static verifyArgs(args) { + assert4("kernelSize" in args, `required key 'kernelSize' not in config`); + if (typeof args.kernelSize !== "number" && !checkArrayTypeAndLength2(args.kernelSize, "number", 1, 3)) { + throw new ValueError2(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(args.kernelSize)}.`); + } + } + getConfig() { + const config3 = { + kernelSize: this.kernelSize, + strides: this.strides, + padding: this.padding, + dataFormat: this.dataFormat, + dilationRate: this.dilationRate, + activation: serializeActivation2(this.activation), + useBias: this.useBias, + biasInitializer: serializeInitializer2(this.biasInitializer), + biasRegularizer: serializeRegularizer2(this.biasRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + biasConstraint: serializeConstraint2(this.biasConstraint) + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +var Conv2 = class extends BaseConv2 { + constructor(rank, args) { + super(rank, args); + this.kernel = null; + Conv2.verifyArgs(args); + this.filters = args.filters; + assertPositiveInteger2(this.filters, "filters"); + this.kernelInitializer = getInitializer2(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.kernelConstraint = getConstraint2(args.kernelConstraint); + this.kernelRegularizer = getRegularizer2(args.kernelRegularizer); + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError2(`The channel dimension of the input should be defined. Found ${inputShape[channelAxis]}`); + } + const inputDim = inputShape[channelAxis]; + const kernelShape = this.kernelSize.concat([inputDim, this.filters]); + this.kernel = this.addWeight("kernel", kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = [{ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } }]; + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + let outputs; + const biasValue = this.bias == null ? null : this.bias.read(); + const fusedActivationName = mapActivationToFusedKernel2(this.activation.getClassName()); + if (fusedActivationName != null && this.rank === 2) { + outputs = conv2dWithBiasActivation2(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate, fusedActivationName); + } else { + if (this.rank === 1) { + outputs = conv1dWithBias2(inputs, this.kernel.read(), biasValue, this.strides[0], this.padding, this.dataFormat, this.dilationRate[0]); + } else if (this.rank === 2) { + outputs = conv2dWithBiasActivation2(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); + } else if (this.rank === 3) { + outputs = conv3dWithBias2(inputs, this.kernel.read(), biasValue, this.strides, this.padding, this.dataFormat, this.dilationRate); + } else { + throw new NotImplementedError2("convolutions greater than 3D are not implemented yet."); + } + if (this.activation != null) { + outputs = this.activation.apply(outputs); + } + } + return outputs; + }); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const newSpace = []; + const space = this.dataFormat === "channelsLast" ? inputShape.slice(1, inputShape.length - 1) : inputShape.slice(2); + for (let i = 0; i < space.length; ++i) { + const newDim = convOutputLength2(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === "number" ? this.dilationRate : this.dilationRate[i]); + newSpace.push(newDim); + } + let outputShape = [inputShape[0]]; + if (this.dataFormat === "channelsLast") { + outputShape = outputShape.concat(newSpace); + outputShape.push(this.filters); + } else { + outputShape.push(this.filters); + outputShape = outputShape.concat(newSpace); + } + return outputShape; + } + getConfig() { + const config3 = { + filters: this.filters, + kernelInitializer: serializeInitializer2(this.kernelInitializer), + kernelRegularizer: serializeRegularizer2(this.kernelRegularizer), + kernelConstraint: serializeConstraint2(this.kernelConstraint) + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } + static verifyArgs(args) { + if (!("filters" in args) || typeof args.filters !== "number" || args.filters < 1) { + throw new ValueError2(`Convolution layer expected config.filters to be a 'number' > 0 but got ${JSON.stringify(args.filters)}`); + } + } +}; +var Conv2D4 = class extends Conv2 { + constructor(args) { + super(2, args); + Conv2D4.verifyArgs(args); + } + getConfig() { + const config3 = super.getConfig(); + delete config3["rank"]; + return config3; + } + static verifyArgs(args) { + if (typeof args.kernelSize !== "number" && !checkArrayTypeAndLength2(args.kernelSize, "number", 1, 2)) { + throw new ValueError2(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(args.kernelSize)}.`); + } + } +}; +Conv2D4.className = "Conv2D"; +serialization_exports2.registerClass(Conv2D4); +var Conv3D4 = class extends Conv2 { + constructor(args) { + super(3, args); + Conv3D4.verifyArgs(args); + } + getConfig() { + const config3 = super.getConfig(); + delete config3["rank"]; + return config3; + } + static verifyArgs(args) { + if (typeof args.kernelSize !== "number") { + if (!(Array.isArray(args.kernelSize) && (args.kernelSize.length === 1 || args.kernelSize.length === 3))) { + throw new ValueError2(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(args.kernelSize)}.`); + } + } + } +}; +Conv3D4.className = "Conv3D"; +serialization_exports2.registerClass(Conv3D4); +var Conv2DTranspose2 = class extends Conv2D4 { + constructor(args) { + super(args); + this.inputSpec = [new InputSpec2({ ndim: 4 })]; + if (this.padding !== "same" && this.padding !== "valid") { + throw new ValueError2(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`); + } + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (inputShape.length !== 4) { + throw new ValueError2("Input should have rank 4; Received input shape: " + JSON.stringify(inputShape)); + } + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError2("The channel dimension of the inputs should be defined. Found `None`."); + } + const inputDim = inputShape[channelAxis]; + const kernelShape = this.kernelSize.concat([this.filters, inputDim]); + this.kernel = this.addWeight("kernel", kernelShape, "float32", this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.filters], "float32", this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = [new InputSpec2({ ndim: 4, axes: { [channelAxis]: inputDim } })]; + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + let input3 = getExactlyOneTensor2(inputs); + if (input3.shape.length !== 4) { + throw new ValueError2(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input3.shape.length}`); + } + const inputShape = input3.shape; + const batchSize = inputShape[0]; + let hAxis; + let wAxis; + if (this.dataFormat === "channelsFirst") { + hAxis = 2; + wAxis = 3; + } else { + hAxis = 1; + wAxis = 2; + } + const height = inputShape[hAxis]; + const width = inputShape[wAxis]; + const kernelH = this.kernelSize[0]; + const kernelW = this.kernelSize[1]; + const strideH = this.strides[0]; + const strideW = this.strides[1]; + const outHeight = deconvLength2(height, strideH, kernelH, this.padding); + const outWidth = deconvLength2(width, strideW, kernelW, this.padding); + const outputShape = [batchSize, outHeight, outWidth, this.filters]; + if (this.dataFormat !== "channelsLast") { + input3 = transpose5(input3, [0, 2, 3, 1]); + } + let outputs = conv2dTranspose3(input3, this.kernel.read(), outputShape, this.strides, this.padding); + if (this.dataFormat !== "channelsLast") { + outputs = transpose5(outputs, [0, 3, 1, 2]); + } + if (this.bias != null) { + outputs = biasAdd2(outputs, this.bias.read(), this.dataFormat); + } + if (this.activation != null) { + outputs = this.activation.apply(outputs); + } + return outputs; + }); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const outputShape = inputShape.slice(); + let channelAxis; + let heightAxis; + let widthAxis; + if (this.dataFormat === "channelsFirst") { + channelAxis = 1; + heightAxis = 2; + widthAxis = 3; + } else { + channelAxis = 3; + heightAxis = 1; + widthAxis = 2; + } + const kernelH = this.kernelSize[0]; + const kernelW = this.kernelSize[1]; + const strideH = this.strides[0]; + const strideW = this.strides[1]; + outputShape[channelAxis] = this.filters; + outputShape[heightAxis] = deconvLength2(outputShape[heightAxis], strideH, kernelH, this.padding); + outputShape[widthAxis] = deconvLength2(outputShape[widthAxis], strideW, kernelW, this.padding); + return outputShape; + } + getConfig() { + const config3 = super.getConfig(); + delete config3["dilationRate"]; + return config3; + } +}; +Conv2DTranspose2.className = "Conv2DTranspose"; +serialization_exports2.registerClass(Conv2DTranspose2); +var Conv3DTranspose2 = class extends Conv3D4 { + constructor(args) { + super(args); + this.inputSpec = [new InputSpec2({ ndim: 5 })]; + if (this.padding !== "same" && this.padding !== "valid") { + throw new ValueError2(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`); + } + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (inputShape.length !== 5) { + throw new ValueError2("Input should have rank 5; Received input shape: " + JSON.stringify(inputShape)); + } + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError2("The channel dimension of the inputs should be defined. Found `None`."); + } + const inputDim = inputShape[channelAxis]; + const kernelShape = this.kernelSize.concat([this.filters, inputDim]); + this.kernel = this.addWeight("kernel", kernelShape, "float32", this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.filters], "float32", this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = [new InputSpec2({ ndim: 5, axes: { [channelAxis]: inputDim } })]; + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + let input3 = getExactlyOneTensor2(inputs); + if (input3.shape.length !== 5) { + throw new ValueError2(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${input3.shape.length}`); + } + const inputShape = input3.shape; + const batchSize = inputShape[0]; + let hAxis; + let wAxis; + let dAxis; + if (this.dataFormat === "channelsFirst") { + dAxis = 2; + hAxis = 3; + wAxis = 4; + } else { + dAxis = 1; + hAxis = 2; + wAxis = 3; + } + const depth = inputShape[dAxis]; + const height = inputShape[hAxis]; + const width = inputShape[wAxis]; + const kernelD = this.kernelSize[0]; + const kernelH = this.kernelSize[1]; + const kernelW = this.kernelSize[2]; + const strideD = this.strides[0]; + const strideH = this.strides[1]; + const strideW = this.strides[2]; + const outDepth = deconvLength2(depth, strideD, kernelD, this.padding); + const outHeight = deconvLength2(height, strideH, kernelH, this.padding); + const outWidth = deconvLength2(width, strideW, kernelW, this.padding); + const outputShape = [batchSize, outDepth, outHeight, outWidth, this.filters]; + if (this.dataFormat !== "channelsLast") { + input3 = transpose5(input3, [0, 2, 3, 4, 1]); + } + let outputs = conv3dTranspose3(input3, this.kernel.read(), outputShape, this.strides, this.padding); + if (this.dataFormat !== "channelsLast") { + outputs = transpose5(outputs, [0, 4, 1, 2, 3]); + } + if (this.bias !== null) { + outputs = biasAdd2(outputs, this.bias.read(), this.dataFormat); + } + if (this.activation !== null) { + outputs = this.activation.apply(outputs); + } + return outputs; + }); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const outputShape = inputShape.slice(); + let channelAxis; + let depthAxis; + let heightAxis; + let widthAxis; + if (this.dataFormat === "channelsFirst") { + channelAxis = 1; + depthAxis = 2; + heightAxis = 3; + widthAxis = 4; + } else { + channelAxis = 4; + depthAxis = 1; + heightAxis = 2; + widthAxis = 3; + } + const kernelD = this.kernelSize[0]; + const kernelH = this.kernelSize[1]; + const kernelW = this.kernelSize[2]; + const strideD = this.strides[0]; + const strideH = this.strides[1]; + const strideW = this.strides[2]; + outputShape[channelAxis] = this.filters; + outputShape[depthAxis] = deconvLength2(outputShape[depthAxis], strideD, kernelD, this.padding); + outputShape[heightAxis] = deconvLength2(outputShape[heightAxis], strideH, kernelH, this.padding); + outputShape[widthAxis] = deconvLength2(outputShape[widthAxis], strideW, kernelW, this.padding); + return outputShape; + } + getConfig() { + const config3 = super.getConfig(); + delete config3["dilationRate"]; + return config3; + } +}; +Conv3DTranspose2.className = "Conv3DTranspose"; +serialization_exports2.registerClass(Conv3DTranspose2); +var SeparableConv2 = class extends Conv2 { + constructor(rank, config3) { + super(rank, config3); + this.DEFAULT_DEPTHWISE_INITIALIZER = "glorotUniform"; + this.DEFAULT_POINTWISE_INITIALIZER = "glorotUniform"; + this.depthwiseKernel = null; + this.pointwiseKernel = null; + if (config3.filters == null) { + throw new ValueError2("The `filters` configuration field is required by SeparableConv, but is unspecified."); + } + if (config3.kernelInitializer != null || config3.kernelRegularizer != null || config3.kernelConstraint != null) { + throw new ValueError2("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead."); + } + if (config3.padding != null && config3.padding !== "same" && config3.padding !== "valid") { + throw new ValueError2(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(config3.padding)}`); + } + this.depthMultiplier = config3.depthMultiplier == null ? 1 : config3.depthMultiplier; + this.depthwiseInitializer = getInitializer2(config3.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); + this.depthwiseRegularizer = getRegularizer2(config3.depthwiseRegularizer); + this.depthwiseConstraint = getConstraint2(config3.depthwiseConstraint); + this.pointwiseInitializer = getInitializer2(config3.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); + this.pointwiseRegularizer = getRegularizer2(config3.pointwiseRegularizer); + this.pointwiseConstraint = getConstraint2(config3.pointwiseConstraint); + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (inputShape.length < this.rank + 2) { + throw new ValueError2(`Inputs to SeparableConv${this.rank}D should have rank ${this.rank + 2}, but received input shape: ${JSON.stringify(inputShape)}`); + } + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new ValueError2(`The channel dimension of the inputs should be defined, but found ${JSON.stringify(inputShape[channelAxis])}`); + } + const inputDim = inputShape[channelAxis]; + const depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); + const pointwiseKernelShape = []; + for (let i = 0; i < this.rank; ++i) { + pointwiseKernelShape.push(1); + } + pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); + const trainable = true; + this.depthwiseKernel = this.addWeight("depthwise_kernel", depthwiseKernelShape, "float32", this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); + this.pointwiseKernel = this.addWeight("pointwise_kernel", pointwiseKernelShape, "float32", this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.filters], "float32", this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); + } else { + this.bias = null; + } + this.inputSpec = [new InputSpec2({ ndim: this.rank + 2, axes: { [channelAxis]: inputDim } })]; + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + let output; + if (this.rank === 1) { + throw new NotImplementedError2("1D separable convolution is not implemented yet."); + } else if (this.rank === 2) { + if (this.dataFormat === "channelsFirst") { + inputs = transpose5(inputs, [0, 2, 3, 1]); + } + output = separableConv2d3(inputs, this.depthwiseKernel.read(), this.pointwiseKernel.read(), this.strides, this.padding, this.dilationRate, "NHWC"); + } + if (this.useBias) { + output = biasAdd2(output, this.bias.read(), this.dataFormat); + } + if (this.activation != null) { + output = this.activation.apply(output); + } + if (this.dataFormat === "channelsFirst") { + output = transpose5(output, [0, 3, 1, 2]); + } + return output; + }); + } + getConfig() { + const config3 = super.getConfig(); + delete config3["rank"]; + delete config3["kernelInitializer"]; + delete config3["kernelRegularizer"]; + delete config3["kernelConstraint"]; + config3["depthwiseInitializer"] = serializeInitializer2(this.depthwiseInitializer); + config3["pointwiseInitializer"] = serializeInitializer2(this.pointwiseInitializer); + config3["depthwiseRegularizer"] = serializeRegularizer2(this.depthwiseRegularizer); + config3["pointwiseRegularizer"] = serializeRegularizer2(this.pointwiseRegularizer); + config3["depthwiseConstraint"] = serializeConstraint2(this.depthwiseConstraint); + config3["pointwiseConstraint"] = serializeConstraint2(this.pointwiseConstraint); + return config3; + } +}; +SeparableConv2.className = "SeparableConv"; +var SeparableConv2D2 = class extends SeparableConv2 { + constructor(args) { + super(2, args); + } +}; +SeparableConv2D2.className = "SeparableConv2D"; +serialization_exports2.registerClass(SeparableConv2D2); +var Conv1D2 = class extends Conv2 { + constructor(args) { + super(1, args); + Conv1D2.verifyArgs(args); + this.inputSpec = [{ ndim: 3 }]; + } + getConfig() { + const config3 = super.getConfig(); + delete config3["rank"]; + delete config3["dataFormat"]; + return config3; + } + static verifyArgs(args) { + if (typeof args.kernelSize !== "number" && !checkArrayTypeAndLength2(args.kernelSize, "number", 1, 1)) { + throw new ValueError2(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(args.kernelSize)}.`); + } + } +}; +Conv1D2.className = "Conv1D"; +serialization_exports2.registerClass(Conv1D2); +var Cropping2D2 = class extends Layer2 { + constructor(args) { + super(args); + if (typeof args.cropping === "number") { + this.cropping = [[args.cropping, args.cropping], [args.cropping, args.cropping]]; + } else if (typeof args.cropping[0] === "number") { + this.cropping = [ + [args.cropping[0], args.cropping[0]], + [args.cropping[1], args.cropping[1]] + ]; + } else { + this.cropping = args.cropping; + } + this.dataFormat = args.dataFormat === void 0 ? "channelsLast" : args.dataFormat; + this.inputSpec = [{ ndim: 4 }]; + } + computeOutputShape(inputShape) { + if (this.dataFormat === "channelsFirst") { + return [ + inputShape[0], + inputShape[1], + inputShape[2] - this.cropping[0][0] - this.cropping[0][1], + inputShape[3] - this.cropping[1][0] - this.cropping[1][1] + ]; + } else { + return [ + inputShape[0], + inputShape[1] - this.cropping[0][0] - this.cropping[0][1], + inputShape[2] - this.cropping[1][0] - this.cropping[1][1], + inputShape[3] + ]; + } + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + if (this.dataFormat === "channelsLast") { + const hSliced = sliceAlongAxis2(inputs, this.cropping[0][0], inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2); + return sliceAlongAxis2(hSliced, this.cropping[1][0], inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3); + } else { + const hSliced = sliceAlongAxis2(inputs, this.cropping[0][0], inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3); + return sliceAlongAxis2(hSliced, this.cropping[1][0], inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4); + } + }); + } + getConfig() { + const config3 = { cropping: this.cropping, dataFormat: this.dataFormat }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Cropping2D2.className = "Cropping2D"; +serialization_exports2.registerClass(Cropping2D2); +var UpSampling2D2 = class extends Layer2 { + constructor(args) { + super(args); + this.DEFAULT_SIZE = [2, 2]; + this.inputSpec = [{ ndim: 4 }]; + this.size = args.size == null ? this.DEFAULT_SIZE : args.size; + this.dataFormat = args.dataFormat == null ? "channelsLast" : args.dataFormat; + checkDataFormat2(this.dataFormat); + this.interpolation = args.interpolation == null ? "nearest" : args.interpolation; + checkInterpolationFormat2(this.interpolation); + } + computeOutputShape(inputShape) { + if (this.dataFormat === "channelsFirst") { + const height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; + const width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; + return [inputShape[0], inputShape[1], height, width]; + } else { + const height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; + const width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; + return [inputShape[0], height, width, inputShape[3]]; + } + } + call(inputs, kwargs) { + return tidy2(() => { + let input3 = getExactlyOneTensor2(inputs); + const inputShape = input3.shape; + if (this.dataFormat === "channelsFirst") { + input3 = transpose5(input3, [0, 2, 3, 1]); + const height = this.size[0] * inputShape[2]; + const width = this.size[1] * inputShape[3]; + const resized = this.interpolation === "nearest" ? image3.resizeNearestNeighbor(input3, [height, width]) : image3.resizeBilinear(input3, [height, width]); + return transpose5(resized, [0, 3, 1, 2]); + } else { + const height = this.size[0] * inputShape[1]; + const width = this.size[1] * inputShape[2]; + return this.interpolation === "nearest" ? image3.resizeNearestNeighbor(input3, [height, width]) : image3.resizeBilinear(input3, [height, width]); + } + }); + } + getConfig() { + const config3 = { size: this.size, dataFormat: this.dataFormat }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +UpSampling2D2.className = "UpSampling2D"; +serialization_exports2.registerClass(UpSampling2D2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js +function depthwiseConv2d8(x, depthwiseKernel, strides = [1, 1], padding2 = "valid", dataFormat, dilationRate) { + return tidy2(() => { + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + checkDataFormat2(dataFormat); + let y = preprocessConv2DInput2(x, dataFormat); + if (x.rank !== 4) { + throw new ValueError2(`Input for depthwiseConv2d is required to be 4-D, but is instead ${x.rank}-D`); + } + if (depthwiseKernel.rank !== 4) { + throw new ValueError2(`depthwiseKernel is required to be 4-D, but is instead ${depthwiseKernel.rank}-D`); + } + y = depthwiseConv2d6(y, depthwiseKernel, strides, padding2 === "same" ? "same" : "valid", "NHWC", dilationRate); + if (dataFormat === "channelsFirst") { + y = transpose5(y, [0, 3, 1, 2]); + } + return y; + }); +} +var DepthwiseConv2D2 = class extends BaseConv2 { + constructor(args) { + super(2, args); + this.depthwiseKernel = null; + this.depthMultiplier = args.depthMultiplier == null ? 1 : args.depthMultiplier; + this.depthwiseInitializer = getInitializer2(args.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.depthwiseConstraint = getConstraint2(args.depthwiseConstraint); + this.depthwiseRegularizer = getRegularizer2(args.depthwiseRegularizer); + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (inputShape.length < 4) { + throw new ValueError2(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(inputShape)}.`); + } + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : 3; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new ValueError2(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${inputShape[channelAxis]}).`); + } + const inputDim = inputShape[channelAxis]; + const depthwiseKernelShape = [ + this.kernelSize[0], + this.kernelSize[1], + inputDim, + this.depthMultiplier + ]; + this.depthwiseKernel = this.addWeight("depthwise_kernel", depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } else { + this.bias = null; + } + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + let outputs = depthwiseConv2d8(inputs, this.depthwiseKernel.read(), this.strides, this.padding, this.dataFormat, null); + if (this.useBias) { + outputs = biasAdd2(outputs, this.bias.read(), this.dataFormat); + } + if (this.activation != null) { + outputs = this.activation.apply(outputs); + } + return outputs; + }); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const rows = this.dataFormat === "channelsFirst" ? inputShape[2] : inputShape[1]; + const cols = this.dataFormat === "channelsFirst" ? inputShape[3] : inputShape[2]; + const outFilters = this.dataFormat === "channelsFirst" ? inputShape[1] * this.depthMultiplier : inputShape[3] * this.depthMultiplier; + const outRows = convOutputLength2(rows, this.kernelSize[0], this.padding, this.strides[0]); + const outCols = convOutputLength2(cols, this.kernelSize[1], this.padding, this.strides[1]); + if (this.dataFormat === "channelsFirst") { + return [inputShape[0], outFilters, outRows, outCols]; + } else { + return [inputShape[0], outRows, outCols, outFilters]; + } + } + getConfig() { + const config3 = super.getConfig(); + config3["depthMultiplier"] = this.depthMultiplier; + config3["depthwiseInitializer"] = serializeInitializer2(this.depthwiseInitializer); + config3["depthwiseRegularizer"] = serializeRegularizer2(this.depthwiseRegularizer); + config3["depthwiseConstraint"] = serializeConstraint2(this.depthwiseRegularizer); + return config3; + } +}; +DepthwiseConv2D2.className = "DepthwiseConv2D"; +serialization_exports2.registerClass(DepthwiseConv2D2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js +function standardizeArgs2(inputs, initialState, constants, numConstants) { + if (Array.isArray(inputs)) { + if (initialState != null || constants != null) { + throw new ValueError2("When inputs is an array, neither initialState or constants should be provided"); + } + if (numConstants != null) { + constants = inputs.slice(inputs.length - numConstants, inputs.length); + inputs = inputs.slice(0, inputs.length - numConstants); + } + if (inputs.length > 1) { + initialState = inputs.slice(1, inputs.length); + } + inputs = inputs[0]; + } + function toListOrNull(x) { + if (x == null || Array.isArray(x)) { + return x; + } else { + return [x]; + } + } + initialState = toListOrNull(initialState); + constants = toListOrNull(constants); + return { inputs, initialState, constants }; +} +function rnn3(stepFunction, inputs, initialStates, goBackwards = false, mask, constants, unroll = false, needPerStepOutputs = false) { + return tidy2(() => { + const ndim = inputs.shape.length; + if (ndim < 3) { + throw new ValueError2(`Input should be at least 3D, but is ${ndim}D.`); + } + const axes = [1, 0].concat(range7(2, ndim)); + inputs = transpose5(inputs, axes); + if (constants != null) { + throw new NotImplementedError2("The rnn() functoin of the deeplearn.js backend does not support constants yet."); + } + if (unroll) { + console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."); + } + if (mask != null) { + mask = cast6(cast6(mask, "bool"), "float32"); + if (mask.rank === ndim - 1) { + mask = expandDims6(mask, -1); + } + mask = transpose5(mask, axes); + } + if (goBackwards) { + inputs = reverse5(inputs, 0); + if (mask != null) { + mask = reverse5(mask, 0); + } + } + const perStepOutputs = []; + let lastOutput; + let states = initialStates; + const timeSteps = inputs.shape[0]; + const perStepInputs = unstack2(inputs); + let perStepMasks; + if (mask != null) { + perStepMasks = unstack2(mask); + } + for (let t = 0; t < timeSteps; ++t) { + const currentInput = perStepInputs[t]; + const stepOutputs = tidy2(() => stepFunction(currentInput, states)); + if (mask == null) { + lastOutput = stepOutputs[0]; + states = stepOutputs[1]; + } else { + const maskedOutputs = tidy2(() => { + const stepMask = perStepMasks[t]; + const negStepMask = sub4(onesLike5(stepMask), stepMask); + const output = add6(mul2(stepOutputs[0], stepMask), mul2(states[0], negStepMask)); + const newStates = states.map((state, i) => { + return add6(mul2(stepOutputs[1][i], stepMask), mul2(state, negStepMask)); + }); + return { output, newStates }; + }); + lastOutput = maskedOutputs.output; + states = maskedOutputs.newStates; + } + if (needPerStepOutputs) { + perStepOutputs.push(lastOutput); + } + } + let outputs; + if (needPerStepOutputs) { + const axis = 1; + outputs = stack2(perStepOutputs, axis); + } + return [lastOutput, outputs, states]; + }); +} +var RNN2 = class extends Layer2 { + constructor(args) { + super(args); + let cell; + if (args.cell == null) { + throw new ValueError2("cell property is missing for the constructor of RNN."); + } else if (Array.isArray(args.cell)) { + cell = new StackedRNNCells2({ cells: args.cell }); + } else { + cell = args.cell; + } + if (cell.stateSize == null) { + throw new ValueError2("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state)."); + } + this.cell = cell; + this.returnSequences = args.returnSequences == null ? false : args.returnSequences; + this.returnState = args.returnState == null ? false : args.returnState; + this.goBackwards = args.goBackwards == null ? false : args.goBackwards; + this._stateful = args.stateful == null ? false : args.stateful; + this.unroll = args.unroll == null ? false : args.unroll; + this.supportsMasking = true; + this.inputSpec = [new InputSpec2({ ndim: 3 })]; + this.stateSpec = null; + this.states_ = null; + this.numConstants = null; + this.keptStates = []; + } + getStates() { + if (this.states_ == null) { + const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; + return range7(0, numStates).map((x) => null); + } else { + return this.states_; + } + } + setStates(states) { + this.states_ = states; + } + computeOutputShape(inputShape) { + if (isArrayOfShapes2(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + let stateSize = this.cell.stateSize; + if (!Array.isArray(stateSize)) { + stateSize = [stateSize]; + } + const outputDim = stateSize[0]; + let outputShape; + if (this.returnSequences) { + outputShape = [inputShape[0], inputShape[1], outputDim]; + } else { + outputShape = [inputShape[0], outputDim]; + } + if (this.returnState) { + const stateShape = []; + for (const dim of stateSize) { + stateShape.push([inputShape[0], dim]); + } + return [outputShape].concat(stateShape); + } else { + return outputShape; + } + } + computeMask(inputs, mask) { + return tidy2(() => { + if (Array.isArray(mask)) { + mask = mask[0]; + } + const outputMask = this.returnSequences ? mask : null; + if (this.returnState) { + const stateMask = this.states.map((s) => null); + return [outputMask].concat(stateMask); + } else { + return outputMask; + } + }); + } + get states() { + if (this.states_ == null) { + const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; + const output = []; + for (let i = 0; i < numStates; ++i) { + output.push(null); + } + return output; + } else { + return this.states_; + } + } + set states(s) { + this.states_ = s; + } + build(inputShape) { + const constantShape = null; + if (this.numConstants != null) { + throw new NotImplementedError2("Constants support is not implemented in RNN yet."); + } + if (isArrayOfShapes2(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + const batchSize = this.stateful ? inputShape[0] : null; + const inputDim = inputShape.slice(2); + this.inputSpec[0] = new InputSpec2({ shape: [batchSize, null, ...inputDim] }); + const stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (constantShape != null) { + throw new NotImplementedError2("Constants support is not implemented in RNN yet."); + } else { + this.cell.build(stepInputShape); + } + let stateSize; + if (Array.isArray(this.cell.stateSize)) { + stateSize = this.cell.stateSize; + } else { + stateSize = [this.cell.stateSize]; + } + if (this.stateSpec != null) { + if (!util_exports2.arraysEqual(this.stateSpec.map((spec) => spec.shape[spec.shape.length - 1]), stateSize)) { + throw new ValueError2(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`); + } + } else { + this.stateSpec = stateSize.map((dim) => new InputSpec2({ shape: [null, dim] })); + } + if (this.stateful) { + this.resetStates(); + } + } + resetStates(states, training = false) { + tidy2(() => { + if (!this.stateful) { + throw new AttributeError2("Cannot call resetStates() on an RNN Layer that is not stateful."); + } + const batchSize = this.inputSpec[0].shape[0]; + if (batchSize == null) { + throw new ValueError2("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer."); + } + if (this.states_ == null) { + if (Array.isArray(this.cell.stateSize)) { + this.states_ = this.cell.stateSize.map((dim) => zeros4([batchSize, dim])); + } else { + this.states_ = [zeros4([batchSize, this.cell.stateSize])]; + } + } else if (states == null) { + dispose2(this.states_); + if (this.keptStates != null) { + dispose2(this.keptStates); + this.keptStates = []; + } + if (Array.isArray(this.cell.stateSize)) { + this.states_ = this.cell.stateSize.map((dim) => zeros4([batchSize, dim])); + } else { + this.states_[0] = zeros4([batchSize, this.cell.stateSize]); + } + } else { + if (!Array.isArray(states)) { + states = [states]; + } + if (states.length !== this.states_.length) { + throw new ValueError2(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${states.length} state value(s). Input received: ${states}`); + } + if (training === true) { + this.keptStates.push(this.states_.slice()); + } else { + dispose2(this.states_); + } + for (let index = 0; index < this.states_.length; ++index) { + const value = states[index]; + const dim = Array.isArray(this.cell.stateSize) ? this.cell.stateSize[index] : this.cell.stateSize; + const expectedShape = [batchSize, dim]; + if (!util_exports2.arraysEqual(value.shape, expectedShape)) { + throw new ValueError2(`State ${index} is incompatible with layer ${this.name}: expected shape=${expectedShape}, received shape=${value.shape}`); + } + this.states_[index] = value; + } + } + this.states_ = this.states_.map((state) => keep2(state.clone())); + }); + } + apply(inputs, kwargs) { + let initialState = kwargs == null ? null : kwargs["initialState"]; + let constants = kwargs == null ? null : kwargs["constants"]; + if (kwargs == null) { + kwargs = {}; + } + const standardized = standardizeArgs2(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + let additionalInputs = []; + let additionalSpecs = []; + if (initialState != null) { + kwargs["initialState"] = initialState; + additionalInputs = additionalInputs.concat(initialState); + this.stateSpec = []; + for (const state of initialState) { + this.stateSpec.push(new InputSpec2({ shape: state.shape })); + } + additionalSpecs = additionalSpecs.concat(this.stateSpec); + } + if (constants != null) { + kwargs["constants"] = constants; + additionalInputs = additionalInputs.concat(constants); + this.numConstants = constants.length; + } + const isTensor = additionalInputs[0] instanceof SymbolicTensor2; + if (isTensor) { + const fullInput = [inputs].concat(additionalInputs); + const fullInputSpec = this.inputSpec.concat(additionalSpecs); + const originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + const output = super.apply(fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } else { + return super.apply(inputs, kwargs); + } + } + call(inputs, kwargs) { + return tidy2(() => { + const mask = kwargs == null ? null : kwargs["mask"]; + const training = kwargs == null ? null : kwargs["training"]; + let initialState = kwargs == null ? null : kwargs["initialState"]; + inputs = getExactlyOneTensor2(inputs); + if (initialState == null) { + if (this.stateful) { + initialState = this.states_; + } else { + initialState = this.getInitialState(inputs); + } + } + const numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; + if (initialState.length !== numStates) { + throw new ValueError2(`RNN Layer has ${numStates} state(s) but was passed ${initialState.length} initial state(s).`); + } + if (this.unroll) { + console.warn("Ignoring unroll = true for RNN layer, due to imperative backend."); + } + const cellCallKwargs = { training }; + const step8 = (inputs2, states2) => { + const outputs2 = this.cell.call([inputs2].concat(states2), cellCallKwargs); + return [outputs2[0], outputs2.slice(1)]; + }; + const rnnOutputs = rnn3(step8, inputs, initialState, this.goBackwards, mask, null, this.unroll, this.returnSequences); + const lastOutput = rnnOutputs[0]; + const outputs = rnnOutputs[1]; + const states = rnnOutputs[2]; + if (this.stateful) { + this.resetStates(states, training); + } + const output = this.returnSequences ? outputs : lastOutput; + if (this.returnState) { + return [output].concat(states); + } else { + return output; + } + }); + } + getInitialState(inputs) { + return tidy2(() => { + let initialState = zeros4(inputs.shape); + initialState = sum7(initialState, [1, 2]); + initialState = expandDims7(initialState); + if (Array.isArray(this.cell.stateSize)) { + return this.cell.stateSize.map((dim) => dim > 1 ? tile7(initialState, [1, dim]) : initialState); + } else { + return this.cell.stateSize > 1 ? [tile7(initialState, [1, this.cell.stateSize])] : [initialState]; + } + }); + } + get trainableWeights() { + if (!this.trainable) { + return []; + } + return this.cell.trainableWeights; + } + get nonTrainableWeights() { + if (!this.trainable) { + return this.cell.weights; + } + return this.cell.nonTrainableWeights; + } + setFastWeightInitDuringBuild(value) { + super.setFastWeightInitDuringBuild(value); + if (this.cell != null) { + this.cell.setFastWeightInitDuringBuild(value); + } + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { + returnSequences: this.returnSequences, + returnState: this.returnState, + goBackwards: this.goBackwards, + stateful: this.stateful, + unroll: this.unroll + }; + if (this.numConstants != null) { + config3["numConstants"] = this.numConstants; + } + const cellConfig = this.cell.getConfig(); + if (this.getClassName() === RNN2.className) { + config3["cell"] = { + "className": this.cell.getClassName(), + "config": cellConfig + }; + } + return Object.assign({}, cellConfig, baseConfig, config3); + } + static fromConfig(cls, config3, customObjects = {}) { + const cellConfig = config3["cell"]; + const cell = deserialize2(cellConfig, customObjects); + return new cls(Object.assign(config3, { cell })); + } +}; +RNN2.className = "RNN"; +serialization_exports2.registerClass(RNN2); +var RNNCell2 = class extends Layer2 { +}; +var SimpleRNNCell2 = class extends RNNCell2 { + constructor(args) { + super(args); + this.DEFAULT_ACTIVATION = "tanh"; + this.DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; + this.DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; + this.DEFAULT_BIAS_INITIALIZER = "zeros"; + this.units = args.units; + assertPositiveInteger2(this.units, `units`); + this.activation = getActivation2(args.activation == null ? this.DEFAULT_ACTIVATION : args.activation); + this.useBias = args.useBias == null ? true : args.useBias; + this.kernelInitializer = getInitializer2(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.recurrentInitializer = getInitializer2(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); + this.biasInitializer = getInitializer2(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); + this.kernelRegularizer = getRegularizer2(args.kernelRegularizer); + this.recurrentRegularizer = getRegularizer2(args.recurrentRegularizer); + this.biasRegularizer = getRegularizer2(args.biasRegularizer); + this.kernelConstraint = getConstraint2(args.kernelConstraint); + this.recurrentConstraint = getConstraint2(args.recurrentConstraint); + this.biasConstraint = getConstraint2(args.biasConstraint); + this.dropout = min7([1, max7([0, args.dropout == null ? 0 : args.dropout])]); + this.recurrentDropout = min7([ + 1, + max7([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) + ]); + this.stateSize = this.units; + this.dropoutMask = null; + this.recurrentDropoutMask = null; + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + this.kernel = this.addWeight("kernel", [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } else { + this.bias = null; + } + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = inputs; + if (inputs.length !== 2) { + throw new ValueError2(`SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`); + } + let prevOutput = inputs[1]; + inputs = inputs[0]; + const training = kwargs["training"] == null ? false : kwargs["training"]; + if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { + this.dropoutMask = generateDropoutMask2({ + ones: () => onesLike5(inputs), + rate: this.dropout, + training + }); + } + if (0 < this.recurrentDropout && this.recurrentDropout < 1 && this.recurrentDropoutMask == null) { + this.recurrentDropoutMask = generateDropoutMask2({ + ones: () => onesLike5(prevOutput), + rate: this.recurrentDropout, + training + }); + } + let h; + const dpMask = this.dropoutMask; + const recDpMask = this.recurrentDropoutMask; + if (dpMask != null) { + h = dot7(mul2(inputs, dpMask), this.kernel.read()); + } else { + h = dot7(inputs, this.kernel.read()); + } + if (this.bias != null) { + h = biasAdd2(h, this.bias.read()); + } + if (recDpMask != null) { + prevOutput = mul2(prevOutput, recDpMask); + } + let output = add6(h, dot7(prevOutput, this.recurrentKernel.read())); + if (this.activation != null) { + output = this.activation.apply(output); + } + return [output, output]; + }); + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { + units: this.units, + activation: serializeActivation2(this.activation), + useBias: this.useBias, + kernelInitializer: serializeInitializer2(this.kernelInitializer), + recurrentInitializer: serializeInitializer2(this.recurrentInitializer), + biasInitializer: serializeInitializer2(this.biasInitializer), + kernelRegularizer: serializeRegularizer2(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer2(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer2(this.biasRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + kernelConstraint: serializeConstraint2(this.kernelConstraint), + recurrentConstraint: serializeConstraint2(this.recurrentConstraint), + biasConstraint: serializeConstraint2(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout + }; + return Object.assign({}, baseConfig, config3); + } +}; +SimpleRNNCell2.className = "SimpleRNNCell"; +serialization_exports2.registerClass(SimpleRNNCell2); +var SimpleRNN2 = class extends RNN2 { + constructor(args) { + args.cell = new SimpleRNNCell2(args); + super(args); + } + call(inputs, kwargs) { + return tidy2(() => { + if (this.cell.dropoutMask != null) { + dispose2(this.cell.dropoutMask); + this.cell.dropoutMask = null; + } + if (this.cell.recurrentDropoutMask != null) { + dispose2(this.cell.recurrentDropoutMask); + this.cell.recurrentDropoutMask = null; + } + const mask = kwargs == null ? null : kwargs["mask"]; + const training = kwargs == null ? null : kwargs["training"]; + const initialState = kwargs == null ? null : kwargs["initialState"]; + return super.call(inputs, { mask, training, initialState }); + }); + } + static fromConfig(cls, config3) { + return new cls(config3); + } +}; +SimpleRNN2.className = "SimpleRNN"; +serialization_exports2.registerClass(SimpleRNN2); +var GRUCell2 = class extends RNNCell2 { + constructor(args) { + super(args); + this.DEFAULT_ACTIVATION = "tanh"; + this.DEFAULT_RECURRENT_ACTIVATION = "hardSigmoid"; + this.DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; + this.DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; + this.DEFAULT_BIAS_INITIALIZER = "zeros"; + if (args.resetAfter) { + throw new ValueError2(`GRUCell does not support reset_after parameter set to true.`); + } + this.units = args.units; + assertPositiveInteger2(this.units, "units"); + this.activation = getActivation2(args.activation === void 0 ? this.DEFAULT_ACTIVATION : args.activation); + this.recurrentActivation = getActivation2(args.recurrentActivation === void 0 ? this.DEFAULT_RECURRENT_ACTIVATION : args.recurrentActivation); + this.useBias = args.useBias == null ? true : args.useBias; + this.kernelInitializer = getInitializer2(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.recurrentInitializer = getInitializer2(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); + this.biasInitializer = getInitializer2(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); + this.kernelRegularizer = getRegularizer2(args.kernelRegularizer); + this.recurrentRegularizer = getRegularizer2(args.recurrentRegularizer); + this.biasRegularizer = getRegularizer2(args.biasRegularizer); + this.kernelConstraint = getConstraint2(args.kernelConstraint); + this.recurrentConstraint = getConstraint2(args.recurrentConstraint); + this.biasConstraint = getConstraint2(args.biasConstraint); + this.dropout = min7([1, max7([0, args.dropout == null ? 0 : args.dropout])]); + this.recurrentDropout = min7([ + 1, + max7([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) + ]); + this.implementation = args.implementation; + this.stateSize = this.units; + this.dropoutMask = null; + this.recurrentDropoutMask = null; + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight("kernel", [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } else { + this.bias = null; + } + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = inputs; + if (inputs.length !== 2) { + throw new ValueError2(`GRUCell expects 2 input Tensors (inputs, h, c), got ${inputs.length}.`); + } + const training = kwargs["training"] == null ? false : kwargs["training"]; + let hTMinus1 = inputs[1]; + inputs = inputs[0]; + if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { + this.dropoutMask = generateDropoutMask2({ + ones: () => onesLike5(inputs), + rate: this.dropout, + training, + count: 3 + }); + } + if (0 < this.recurrentDropout && this.recurrentDropout < 1 && this.recurrentDropoutMask == null) { + this.recurrentDropoutMask = generateDropoutMask2({ + ones: () => onesLike5(hTMinus1), + rate: this.recurrentDropout, + training, + count: 3 + }); + } + const dpMask = this.dropoutMask; + const recDpMask = this.recurrentDropoutMask; + let z; + let r; + let hh; + if (0 < this.dropout && this.dropout < 1) { + inputs = mul2(inputs, dpMask[0]); + } + let matrixX = dot7(inputs, this.kernel.read()); + if (this.useBias) { + matrixX = biasAdd2(matrixX, this.bias.read()); + } + if (0 < this.recurrentDropout && this.recurrentDropout < 1) { + hTMinus1 = mul2(hTMinus1, recDpMask[0]); + } + const recurrentKernelValue = this.recurrentKernel.read(); + const [rk1, rk2] = split4(recurrentKernelValue, [2 * this.units, this.units], recurrentKernelValue.rank - 1); + const matrixInner = dot7(hTMinus1, rk1); + const [xZ, xR, xH] = split4(matrixX, 3, matrixX.rank - 1); + const [recurrentZ, recurrentR] = split4(matrixInner, 2, matrixInner.rank - 1); + z = this.recurrentActivation.apply(add6(xZ, recurrentZ)); + r = this.recurrentActivation.apply(add6(xR, recurrentR)); + const recurrentH = dot7(mul2(r, hTMinus1), rk2); + hh = this.activation.apply(add6(xH, recurrentH)); + const h = add6(mul2(z, hTMinus1), mul2(add6(1, neg4(z)), hh)); + return [h, h]; + }); + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { + units: this.units, + activation: serializeActivation2(this.activation), + recurrentActivation: serializeActivation2(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer2(this.kernelInitializer), + recurrentInitializer: serializeInitializer2(this.recurrentInitializer), + biasInitializer: serializeInitializer2(this.biasInitializer), + kernelRegularizer: serializeRegularizer2(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer2(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer2(this.biasRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + kernelConstraint: serializeConstraint2(this.kernelConstraint), + recurrentConstraint: serializeConstraint2(this.recurrentConstraint), + biasConstraint: serializeConstraint2(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + resetAfter: false + }; + return Object.assign({}, baseConfig, config3); + } +}; +GRUCell2.className = "GRUCell"; +serialization_exports2.registerClass(GRUCell2); +var GRU2 = class extends RNN2 { + constructor(args) { + if (args.implementation === 0) { + console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."); + } + args.cell = new GRUCell2(args); + super(args); + } + call(inputs, kwargs) { + return tidy2(() => { + if (this.cell.dropoutMask != null) { + dispose2(this.cell.dropoutMask); + this.cell.dropoutMask = null; + } + if (this.cell.recurrentDropoutMask != null) { + dispose2(this.cell.recurrentDropoutMask); + this.cell.recurrentDropoutMask = null; + } + const mask = kwargs == null ? null : kwargs["mask"]; + const training = kwargs == null ? null : kwargs["training"]; + const initialState = kwargs == null ? null : kwargs["initialState"]; + return super.call(inputs, { mask, training, initialState }); + }); + } + static fromConfig(cls, config3) { + if (config3["implmentation"] === 0) { + config3["implementation"] = 1; + } + return new cls(config3); + } +}; +GRU2.className = "GRU"; +serialization_exports2.registerClass(GRU2); +var LSTMCell2 = class extends RNNCell2 { + constructor(args) { + super(args); + this.DEFAULT_ACTIVATION = "tanh"; + this.DEFAULT_RECURRENT_ACTIVATION = "hardSigmoid"; + this.DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; + this.DEFAULT_RECURRENT_INITIALIZER = "orthogonal"; + this.DEFAULT_BIAS_INITIALIZER = "zeros"; + this.units = args.units; + assertPositiveInteger2(this.units, "units"); + this.activation = getActivation2(args.activation === void 0 ? this.DEFAULT_ACTIVATION : args.activation); + this.recurrentActivation = getActivation2(args.recurrentActivation === void 0 ? this.DEFAULT_RECURRENT_ACTIVATION : args.recurrentActivation); + this.useBias = args.useBias == null ? true : args.useBias; + this.kernelInitializer = getInitializer2(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.recurrentInitializer = getInitializer2(args.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER); + this.biasInitializer = getInitializer2(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); + this.unitForgetBias = args.unitForgetBias; + this.kernelRegularizer = getRegularizer2(args.kernelRegularizer); + this.recurrentRegularizer = getRegularizer2(args.recurrentRegularizer); + this.biasRegularizer = getRegularizer2(args.biasRegularizer); + this.kernelConstraint = getConstraint2(args.kernelConstraint); + this.recurrentConstraint = getConstraint2(args.recurrentConstraint); + this.biasConstraint = getConstraint2(args.biasConstraint); + this.dropout = min7([1, max7([0, args.dropout == null ? 0 : args.dropout])]); + this.recurrentDropout = min7([ + 1, + max7([0, args.recurrentDropout == null ? 0 : args.recurrentDropout]) + ]); + this.implementation = args.implementation; + this.stateSize = [this.units, this.units]; + this.dropoutMask = null; + this.recurrentDropoutMask = null; + } + build(inputShape) { + var _a; + inputShape = getExactlyOneShape2(inputShape); + const inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight("kernel", [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + let biasInitializer; + if (this.useBias) { + if (this.unitForgetBias) { + const capturedBiasInit = this.biasInitializer; + const capturedUnits = this.units; + biasInitializer = new (_a = class CustomInit extends Initializer2 { + apply(shape, dtype) { + const bI = capturedBiasInit.apply([capturedUnits]); + const bF = new Ones2().apply([capturedUnits]); + const bCAndH = capturedBiasInit.apply([capturedUnits * 2]); + return concatAlongFirstAxis2(concatAlongFirstAxis2(bI, bF), bCAndH); + } + }, _a.className = "CustomInit", _a)(); + } else { + biasInitializer = this.biasInitializer; + } + this.bias = this.addWeight("bias", [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } else { + this.bias = null; + } + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + const training = kwargs["training"] == null ? false : kwargs["training"]; + inputs = inputs; + if (inputs.length !== 3) { + throw new ValueError2(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${inputs.length}.`); + } + let hTMinus1 = inputs[1]; + const cTMinus1 = inputs[2]; + inputs = inputs[0]; + if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { + this.dropoutMask = generateDropoutMask2({ + ones: () => onesLike5(inputs), + rate: this.dropout, + training, + count: 4 + }); + } + if (0 < this.recurrentDropout && this.recurrentDropout < 1 && this.recurrentDropoutMask == null) { + this.recurrentDropoutMask = generateDropoutMask2({ + ones: () => onesLike5(hTMinus1), + rate: this.recurrentDropout, + training, + count: 4 + }); + } + const dpMask = this.dropoutMask; + const recDpMask = this.recurrentDropoutMask; + let i; + let f; + let c; + let o; + if (0 < this.dropout && this.dropout < 1) { + inputs = mul2(inputs, dpMask[0]); + } + let z = dot7(inputs, this.kernel.read()); + if (0 < this.recurrentDropout && this.recurrentDropout < 1) { + hTMinus1 = mul2(hTMinus1, recDpMask[0]); + } + z = add6(z, dot7(hTMinus1, this.recurrentKernel.read())); + if (this.useBias) { + z = biasAdd2(z, this.bias.read()); + } + const [z0, z1, z2, z3] = split4(z, 4, z.rank - 1); + i = this.recurrentActivation.apply(z0); + f = this.recurrentActivation.apply(z1); + c = add6(mul2(f, cTMinus1), mul2(i, this.activation.apply(z2))); + o = this.recurrentActivation.apply(z3); + const h = mul2(o, this.activation.apply(c)); + return [h, h, c]; + }); + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { + units: this.units, + activation: serializeActivation2(this.activation), + recurrentActivation: serializeActivation2(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer2(this.kernelInitializer), + recurrentInitializer: serializeInitializer2(this.recurrentInitializer), + biasInitializer: serializeInitializer2(this.biasInitializer), + unitForgetBias: this.unitForgetBias, + kernelRegularizer: serializeRegularizer2(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer2(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer2(this.biasRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + kernelConstraint: serializeConstraint2(this.kernelConstraint), + recurrentConstraint: serializeConstraint2(this.recurrentConstraint), + biasConstraint: serializeConstraint2(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation + }; + return Object.assign({}, baseConfig, config3); + } +}; +LSTMCell2.className = "LSTMCell"; +serialization_exports2.registerClass(LSTMCell2); +var LSTM2 = class extends RNN2 { + constructor(args) { + if (args.implementation === 0) { + console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."); + } + args.cell = new LSTMCell2(args); + super(args); + } + call(inputs, kwargs) { + return tidy2(() => { + if (this.cell.dropoutMask != null) { + dispose2(this.cell.dropoutMask); + this.cell.dropoutMask = null; + } + if (this.cell.recurrentDropoutMask != null) { + dispose2(this.cell.recurrentDropoutMask); + this.cell.recurrentDropoutMask = null; + } + const mask = kwargs == null ? null : kwargs["mask"]; + const training = kwargs == null ? null : kwargs["training"]; + const initialState = kwargs == null ? null : kwargs["initialState"]; + return super.call(inputs, { mask, training, initialState }); + }); + } + static fromConfig(cls, config3) { + if (config3["implmentation"] === 0) { + config3["implementation"] = 1; + } + return new cls(config3); + } +}; +LSTM2.className = "LSTM"; +serialization_exports2.registerClass(LSTM2); +var StackedRNNCells2 = class extends RNNCell2 { + constructor(args) { + super(args); + this.cells = args.cells; + } + get stateSize() { + const stateSize = []; + for (const cell of this.cells.slice().reverse()) { + if (Array.isArray(cell.stateSize)) { + stateSize.push(...cell.stateSize); + } else { + stateSize.push(cell.stateSize); + } + } + return stateSize; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = inputs; + let states = inputs.slice(1); + const nestedStates = []; + for (const cell of this.cells.slice().reverse()) { + if (Array.isArray(cell.stateSize)) { + nestedStates.push(states.splice(0, cell.stateSize.length)); + } else { + nestedStates.push(states.splice(0, 1)); + } + } + nestedStates.reverse(); + const newNestedStates = []; + let callInputs; + for (let i = 0; i < this.cells.length; ++i) { + const cell = this.cells[i]; + states = nestedStates[i]; + if (i === 0) { + callInputs = [inputs[0]].concat(states); + } else { + callInputs = [callInputs[0]].concat(states); + } + callInputs = cell.call(callInputs, kwargs); + newNestedStates.push(callInputs.slice(1)); + } + states = []; + for (const cellStates of newNestedStates.slice().reverse()) { + states.push(...cellStates); + } + return [callInputs[0]].concat(states); + }); + } + build(inputShape) { + if (isArrayOfShapes2(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + let outputDim; + this.cells.forEach((cell, i) => { + nameScope2(`RNNCell_${i}`, () => { + cell.build(inputShape); + if (Array.isArray(cell.stateSize)) { + outputDim = cell.stateSize[0]; + } else { + outputDim = cell.stateSize; + } + inputShape = [inputShape[0], outputDim]; + }); + }); + this.built = true; + } + getConfig() { + const baseConfig = super.getConfig(); + const getCellConfig = (cell) => { + return { + "className": cell.getClassName(), + "config": cell.getConfig() + }; + }; + const cellConfigs = this.cells.map(getCellConfig); + const config3 = { "cells": cellConfigs }; + return Object.assign({}, baseConfig, config3); + } + static fromConfig(cls, config3, customObjects = {}) { + const cells = []; + for (const cellConfig of config3["cells"]) { + cells.push(deserialize2(cellConfig, customObjects)); + } + return new cls({ cells }); + } + get trainableWeights() { + if (!this.trainable) { + return []; + } + const weights = []; + for (const cell of this.cells) { + weights.push(...cell.trainableWeights); + } + return weights; + } + get nonTrainableWeights() { + const weights = []; + for (const cell of this.cells) { + weights.push(...cell.nonTrainableWeights); + } + if (!this.trainable) { + const trainableWeights = []; + for (const cell of this.cells) { + trainableWeights.push(...cell.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + } + getWeights() { + const weights = []; + for (const cell of this.cells) { + weights.push(...cell.weights); + } + return batchGetValue2(weights); + } + setWeights(weights) { + const tuples = []; + for (const cell of this.cells) { + const numParams = cell.weights.length; + const inputWeights = weights.splice(numParams); + for (let i = 0; i < cell.weights.length; ++i) { + tuples.push([cell.weights[i], inputWeights[i]]); + } + } + batchSetValue2(tuples); + } +}; +StackedRNNCells2.className = "StackedRNNCells"; +serialization_exports2.registerClass(StackedRNNCells2); +function generateDropoutMask2(args) { + const { ones: ones6, rate, training = false, count: count4 = 1 } = args; + const droppedInputs = () => dropout5(ones6(), rate); + const createMask = () => inTrainPhase2(droppedInputs, ones6, training); + if (!count4 || count4 <= 1) { + return keep2(createMask().clone()); + } + const masks = Array(count4).fill(void 0).map(createMask); + return masks.map((m) => keep2(m.clone())); +} + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_recurrent.js +var __rest2 = function(s, e) { + var t = {}; + for (var p3 in s) + if (Object.prototype.hasOwnProperty.call(s, p3) && e.indexOf(p3) < 0) + t[p3] = s[p3]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p3 = Object.getOwnPropertySymbols(s); i < p3.length; i++) { + if (e.indexOf(p3[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p3[i])) + t[p3[i]] = s[p3[i]]; + } + return t; +}; +var ConvRNN2D2 = class extends RNN2 { + constructor(args) { + if (args.unroll) { + throw new NotImplementedError2("Unrolling is not possible with convolutional RNNs."); + } + if (Array.isArray(args.cell)) { + throw new NotImplementedError2("It is not possible at the moment to stack convolutional cells."); + } + super(args); + this.inputSpec = [new InputSpec2({ ndim: 5 })]; + } + call(inputs, kwargs) { + return tidy2(() => { + if (this.cell.dropoutMask != null) { + dispose2(this.cell.dropoutMask); + this.cell.dropoutMask = null; + } + if (this.cell.recurrentDropoutMask != null) { + dispose2(this.cell.recurrentDropoutMask); + this.cell.recurrentDropoutMask = null; + } + if (kwargs && kwargs["constants"]) { + throw new ValueError2("ConvRNN2D cell does not support constants"); + } + const mask = kwargs == null ? null : kwargs["mask"]; + const training = kwargs == null ? null : kwargs["training"]; + const initialState = kwargs == null ? null : kwargs["initialState"]; + return super.call(inputs, { mask, training, initialState }); + }); + } + computeOutputShape(inputShape) { + let outShape = this.computeSingleOutputShape(inputShape); + if (!this.returnSequences) { + outShape = [outShape[0], ...outShape.slice(2)]; + } + if (this.returnState) { + outShape = [outShape, ...Array(2).fill([inputShape[0], ...outShape.slice(-3)])]; + } + return outShape; + } + getInitialState(inputs) { + return tidy2(() => { + const { stateSize } = this.cell; + const inputShape = inputs.shape; + const outputShape = this.computeSingleOutputShape(inputShape); + const stateShape = [outputShape[0], ...outputShape.slice(2)]; + const initialState = zeros4(stateShape); + if (Array.isArray(stateSize)) { + return Array(stateSize.length).fill(initialState); + } + return [initialState]; + }); + } + resetStates(states, training = false) { + tidy2(() => { + if (!this.stateful) { + throw new AttributeError2("Cannot call resetStates() on an RNN Layer that is not stateful."); + } + const inputShape = this.inputSpec[0].shape; + const outputShape = this.computeSingleOutputShape(inputShape); + const stateShape = [outputShape[0], ...outputShape.slice(2)]; + const batchSize = inputShape[0]; + if (batchSize == null) { + throw new ValueError2("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer."); + } + if (this.getStates() == null) { + if (Array.isArray(this.cell.stateSize)) { + this.states_ = this.cell.stateSize.map(() => zeros4(stateShape)); + } else { + this.states_ = [zeros4(stateShape)]; + } + } else if (states == null) { + dispose2(this.states_); + if (this.keptStates != null) { + dispose2(this.keptStates); + this.keptStates = []; + } + if (Array.isArray(this.cell.stateSize)) { + this.states_ = this.cell.stateSize.map(() => zeros4(stateShape)); + } else { + this.states_[0] = zeros4(stateShape); + } + } else { + if (!Array.isArray(states)) { + states = [states]; + } + if (states.length !== this.states_.length) { + throw new ValueError2(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${states.length} state value(s). Input received: ${states}`); + } + if (training) { + this.keptStates.push(this.states_.slice()); + } else { + dispose2(this.states_); + } + for (let index = 0; index < this.states_.length; ++index) { + const value = states[index]; + const expectedShape = stateShape; + if (!util_exports2.arraysEqual(value.shape, expectedShape)) { + throw new ValueError2(`State ${index} is incompatible with layer ${this.name}: expected shape=${expectedShape}, received shape=${value.shape}`); + } + this.states_[index] = value; + } + } + this.states_ = this.states_.map((state) => keep2(state.clone())); + }); + } + computeSingleOutputShape(inputShape) { + const { dataFormat, filters, kernelSize, padding: padding2, strides, dilationRate } = this.cell; + const isChannelsFirst = dataFormat === "channelsFirst"; + const h = inputShape[isChannelsFirst ? 3 : 2]; + const w = inputShape[isChannelsFirst ? 4 : 3]; + const hOut = convOutputLength2(h, kernelSize[0], padding2, strides[0], dilationRate[0]); + const wOut = convOutputLength2(w, kernelSize[1], padding2, strides[1], dilationRate[1]); + const outShape = [ + ...inputShape.slice(0, 2), + ...isChannelsFirst ? [filters, hOut, wOut] : [hOut, wOut, filters] + ]; + return outShape; + } +}; +ConvRNN2D2.className = "ConvRNN2D"; +var ConvLSTM2DCell2 = class extends LSTMCell2 { + constructor(args) { + const { filters, kernelSize, strides, padding: padding2, dataFormat, dilationRate } = args; + super(Object.assign({}, args, { units: filters })); + this.filters = filters; + assertPositiveInteger2(this.filters, "filters"); + this.kernelSize = normalizeArray2(kernelSize, 2, "kernelSize"); + this.kernelSize.forEach((size2) => assertPositiveInteger2(size2, "kernelSize")); + this.strides = normalizeArray2(strides || 1, 2, "strides"); + this.strides.forEach((stride) => assertPositiveInteger2(stride, "strides")); + this.padding = padding2 || "valid"; + checkPaddingMode2(this.padding); + this.dataFormat = dataFormat || "channelsLast"; + checkDataFormat2(this.dataFormat); + this.dilationRate = normalizeArray2(dilationRate || 1, 2, "dilationRate"); + this.dilationRate.forEach((rate) => assertPositiveInteger2(rate, "dilationRate")); + } + build(inputShape) { + var _a; + inputShape = getExactlyOneShape2(inputShape); + const channelAxis = this.dataFormat === "channelsFirst" ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError2(`The channel dimension of the input should be defined. Found ${inputShape[channelAxis]}`); + } + const inputDim = inputShape[channelAxis]; + const numOfKernels = 4; + const kernelShape = this.kernelSize.concat([inputDim, this.filters * numOfKernels]); + this.kernel = this.addWeight("kernel", kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + const recurrentKernelShape = this.kernelSize.concat([this.filters, this.filters * numOfKernels]); + this.recurrentKernel = this.addWeight("recurrent_kernel", recurrentKernelShape, null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + let biasInitializer; + if (this.unitForgetBias) { + const init2 = this.biasInitializer; + const filters = this.filters; + biasInitializer = new (_a = class CustomInit extends Initializer2 { + apply(shape, dtype) { + const biasI = init2.apply([filters]); + const biasF = ones5([filters]); + const biasCAndO = init2.apply([filters * 2]); + return concatenate3([biasI, biasF, biasCAndO]); + } + }, _a.className = "CustomInit", _a)(); + } else { + biasInitializer = this.biasInitializer; + } + this.bias = this.addWeight("bias", [this.filters * numOfKernels], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + if (inputs.length !== 3) { + throw new ValueError2(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${inputs.length}.`); + } + const training = kwargs["training"] || false; + const x = inputs[0]; + const hTMinus1 = inputs[1]; + const cTMinus1 = inputs[2]; + const numOfKernels = 4; + if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) { + this.dropoutMask = generateDropoutMask2({ + ones: () => onesLike5(x), + rate: this.dropout, + training, + count: numOfKernels + }); + } + const dropoutMask = this.dropoutMask; + const applyDropout = (x2, mask, index) => { + if (!mask || !mask[index]) { + return x2; + } + return mul2(mask[index], x2); + }; + let xI = applyDropout(x, dropoutMask, 0); + let xF = applyDropout(x, dropoutMask, 1); + let xC = applyDropout(x, dropoutMask, 2); + let xO = applyDropout(x, dropoutMask, 3); + if (0 < this.recurrentDropout && this.recurrentDropout < 1 && this.recurrentDropoutMask == null) { + this.recurrentDropoutMask = generateDropoutMask2({ + ones: () => onesLike5(hTMinus1), + rate: this.recurrentDropout, + training, + count: numOfKernels + }); + } + const recDropoutMask = this.recurrentDropoutMask; + let hI = applyDropout(hTMinus1, recDropoutMask, 0); + let hF = applyDropout(hTMinus1, recDropoutMask, 1); + let hC = applyDropout(hTMinus1, recDropoutMask, 2); + let hO = applyDropout(hTMinus1, recDropoutMask, 3); + const kernelChannelAxis = 3; + const [kernelI, kernelF, kernelC, kernelO] = split4(this.kernel.read(), numOfKernels, kernelChannelAxis); + const [biasI, biasF, biasC, biasO] = this.useBias ? split4(this.bias.read(), numOfKernels) : [null, null, null, null]; + xI = this.inputConv(xI, kernelI, biasI, this.padding); + xF = this.inputConv(xF, kernelF, biasF, this.padding); + xC = this.inputConv(xC, kernelC, biasC, this.padding); + xO = this.inputConv(xO, kernelO, biasO, this.padding); + const [recKernelI, recKernelF, recKernelC, recKernelO] = split4(this.recurrentKernel.read(), numOfKernels, kernelChannelAxis); + hI = this.recurrentConv(hI, recKernelI); + hF = this.recurrentConv(hF, recKernelF); + hC = this.recurrentConv(hC, recKernelC); + hO = this.recurrentConv(hO, recKernelO); + const i = this.recurrentActivation.apply(add6(xI, hI)); + const f = this.recurrentActivation.apply(add6(xF, hF)); + const c = add6(mul2(f, cTMinus1), mul2(i, this.activation.apply(add6(xC, hC)))); + const h = mul2(this.recurrentActivation.apply(add6(xO, hO)), this.activation.apply(c)); + return [h, h, c]; + }); + } + getConfig() { + const _a = super.getConfig(), { "units": _ } = _a, baseConfig = __rest2(_a, ["units"]); + const config3 = { + filters: this.filters, + kernelSize: this.kernelSize, + padding: this.padding, + dataFormat: this.dataFormat, + dilationRate: this.dilationRate, + strides: this.strides + }; + return Object.assign({}, baseConfig, config3); + } + inputConv(x, w, b, padding2) { + const out = conv2d6(x, w, this.strides, padding2 || "valid", this.dataFormat === "channelsFirst" ? "NCHW" : "NHWC", this.dilationRate); + if (b) { + return biasAdd2(out, b, this.dataFormat); + } + return out; + } + recurrentConv(x, w) { + const strides = 1; + return conv2d6(x, w, strides, "same", this.dataFormat === "channelsFirst" ? "NCHW" : "NHWC"); + } +}; +ConvLSTM2DCell2.className = "ConvLSTM2DCell"; +serialization_exports2.registerClass(ConvLSTM2DCell2); +var ConvLSTM2D2 = class extends ConvRNN2D2 { + constructor(args) { + const cell = new ConvLSTM2DCell2(args); + super(Object.assign({}, args, { cell })); + } + static fromConfig(cls, config3) { + return new cls(config3); + } +}; +ConvLSTM2D2.className = "ConvLSTM2D"; +serialization_exports2.registerClass(ConvLSTM2D2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js +var Dropout2 = class extends Layer2 { + constructor(args) { + super(args); + this.rate = Math.max(Math.min(args.rate, 1), 0); + this.noiseShape = args.noiseShape; + this.seed = args.seed; + this.supportsMasking = true; + } + getNoiseShape(input3) { + if (this.noiseShape == null) { + return this.noiseShape; + } + const inputShape = input3.shape; + const noiseShape = []; + for (let i = 0; i < this.noiseShape.length; ++i) { + noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); + } + return noiseShape; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + if (0 < this.rate && this.rate < 1) { + const training = kwargs["training"] == null ? false : kwargs["training"]; + const noiseShape = this.getNoiseShape(input3); + const output = inTrainPhase2(() => dropout5(input3, this.rate, noiseShape, this.seed), () => input3, training); + return output; + } + return inputs; + }); + } + getConfig() { + const config3 = { + rate: this.rate, + noiseShape: this.noiseShape, + seed: this.seed + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } + dispose() { + return super.dispose(); + } +}; +Dropout2.className = "Dropout"; +serialization_exports2.registerClass(Dropout2); +var SpatialDropout1D2 = class extends Dropout2 { + constructor(args) { + super(args); + this.inputSpec = [{ ndim: 3 }]; + } + getNoiseShape(input3) { + const inputShape = input3.shape; + return [inputShape[0], 1, inputShape[2]]; + } +}; +SpatialDropout1D2.className = "SpatialDropout1D"; +serialization_exports2.registerClass(SpatialDropout1D2); +var Dense2 = class extends Layer2 { + constructor(args) { + super(args); + this.activation = null; + this.useBias = true; + this.kernel = null; + this.bias = null; + this.DEFAULT_KERNEL_INITIALIZER = "glorotNormal"; + this.DEFAULT_BIAS_INITIALIZER = "zeros"; + if (args.batchInputShape == null && args.inputShape == null && args.inputDim != null) { + let batchSize = null; + if (args.batchSize != null) { + batchSize = args.batchSize; + } + this.batchInputShape = [batchSize, args.inputDim]; + } + this.units = args.units; + assertPositiveInteger2(this.units, "units"); + this.activation = getActivation2(args.activation); + if (args.useBias != null) { + this.useBias = args.useBias; + } + this.kernelInitializer = getInitializer2(args.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER); + this.biasInitializer = getInitializer2(args.biasInitializer || this.DEFAULT_BIAS_INITIALIZER); + this.kernelConstraint = getConstraint2(args.kernelConstraint); + this.biasConstraint = getConstraint2(args.biasConstraint); + this.kernelRegularizer = getRegularizer2(args.kernelRegularizer); + this.biasRegularizer = getRegularizer2(args.biasRegularizer); + this.activityRegularizer = getRegularizer2(args.activityRegularizer); + this.supportsMasking = true; + this.inputSpec = [{ minNDim: 2 }]; + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const inputLastDim = inputShape[inputShape.length - 1]; + if (this.kernel == null) { + this.kernel = this.addWeight("kernel", [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight("bias", [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + } + this.inputSpec = [{ minNDim: 2, axes: { [-1]: inputLastDim } }]; + this.built = true; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const outputShape = inputShape.slice(); + outputShape[outputShape.length - 1] = this.units; + return outputShape; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + const fusedActivationName = mapActivationToFusedKernel2(this.activation.getClassName()); + let output; + if (fusedActivationName != null) { + output = dot7(input3, this.kernel.read(), fusedActivationName, this.bias ? this.bias.read() : null); + } else { + output = dot7(input3, this.kernel.read()); + if (this.bias != null) { + output = biasAdd2(output, this.bias.read()); + } + if (this.activation != null) { + output = this.activation.apply(output); + } + } + return output; + }); + } + getConfig() { + const config3 = { + units: this.units, + activation: serializeActivation2(this.activation), + useBias: this.useBias, + kernelInitializer: serializeInitializer2(this.kernelInitializer), + biasInitializer: serializeInitializer2(this.biasInitializer), + kernelRegularizer: serializeRegularizer2(this.kernelRegularizer), + biasRegularizer: serializeRegularizer2(this.biasRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + kernelConstraint: serializeConstraint2(this.kernelConstraint), + biasConstraint: serializeConstraint2(this.biasConstraint) + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Dense2.className = "Dense"; +serialization_exports2.registerClass(Dense2); +var Flatten2 = class extends Layer2 { + constructor(args) { + args = args || {}; + super(args); + this.inputSpec = [{ minNDim: 3 }]; + this.dataFormat = args.dataFormat; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + for (const dim of inputShape.slice(1)) { + if (dim == null) { + throw new ValueError2(`The shape of the input to "Flatten" is not fully defined (got ${inputShape.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`); + } + } + return [inputShape[0], arrayProd2(inputShape, 1)]; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + let input3 = getExactlyOneTensor2(inputs); + if (this.dataFormat === "channelsFirst" && input3.rank > 1) { + const permutation = [0]; + for (let i = 2; i < input3.rank; ++i) { + permutation.push(i); + } + permutation.push(1); + input3 = transpose5(input3, permutation); + } + return batchFlatten2(input3); + }); + } + getConfig() { + const config3 = {}; + if (this.dataFormat != null) { + config3["dataFormat"] = this.dataFormat; + } + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Flatten2.className = "Flatten"; +serialization_exports2.registerClass(Flatten2); +var Activation4 = class extends Layer2 { + constructor(args) { + super(args); + this.supportsMasking = true; + this.activation = getActivation2(args.activation); + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + return this.activation.apply(input3); + }); + } + getConfig() { + const config3 = { activation: serializeActivation2(this.activation) }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Activation4.className = "Activation"; +serialization_exports2.registerClass(Activation4); +var RepeatVector2 = class extends Layer2 { + constructor(args) { + super(args); + this.n = args.n; + this.inputSpec = [{ ndim: 2 }]; + } + computeOutputShape(inputShape) { + return [inputShape[0], this.n, inputShape[1]]; + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + return repeat2(inputs, this.n); + }); + } + getConfig() { + const config3 = { + n: this.n + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +RepeatVector2.className = "RepeatVector"; +serialization_exports2.registerClass(RepeatVector2); +var Reshape4 = class extends Layer2 { + constructor(args) { + super(args); + this.targetShape = args.targetShape; + for (let i = 0; i < this.targetShape.length; ++i) { + if (this.isUnknown(this.targetShape[i])) { + this.targetShape[i] = null; + } + } + } + isUnknown(dim) { + return dim < 0 || dim == null; + } + fixUnknownDimension(inputShape, outputShape) { + const errorMsg = "Total size of new array must be unchanged."; + const finalShape = outputShape.slice(); + let known = 1; + let unknown = null; + for (let i = 0; i < finalShape.length; ++i) { + const dim = finalShape[i]; + if (this.isUnknown(dim)) { + if (unknown === null) { + unknown = i; + } else { + throw new ValueError2("Can only specifiy one unknown dimension."); + } + } else { + known *= dim; + } + } + const originalSize = arrayProd2(inputShape); + if (unknown !== null) { + if (known === 0 || originalSize % known !== 0) { + throw new ValueError2(errorMsg); + } + finalShape[unknown] = originalSize / known; + } else if (originalSize !== known) { + throw new ValueError2(errorMsg); + } + return finalShape; + } + computeOutputShape(inputShape) { + let anyUnknownDims = false; + for (let i = 0; i < inputShape.length; ++i) { + if (this.isUnknown(inputShape[i])) { + anyUnknownDims = true; + break; + } + } + if (anyUnknownDims) { + return inputShape.slice(0, 1).concat(this.targetShape); + } else { + return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); + } + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + const inputShape = input3.shape; + const outputShape = inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); + return reshape6(input3, outputShape); + }); + } + getConfig() { + const config3 = { + targetShape: this.targetShape + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Reshape4.className = "Reshape"; +serialization_exports2.registerClass(Reshape4); +var Permute2 = class extends Layer2 { + constructor(args) { + super(args); + if (args.dims == null) { + throw new Error("Required configuration field `dims` is missing during Permute constructor call."); + } + if (!Array.isArray(args.dims)) { + throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${args.dims} instead.`); + } + const expectedSortedIndices = range7(1, args.dims.length + 1); + if (!util_exports2.arraysEqual(args.dims.slice().sort(), expectedSortedIndices)) { + throw new Error("Invalid permutation `dims`: " + JSON.stringify(args.dims) + " `dims` must contain consecutive integers starting from 1."); + } + this.dims = args.dims; + this.dimsIncludingBatch = [0].concat(this.dims); + this.inputSpec = [new InputSpec2({ ndim: this.dims.length + 1 })]; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const outputShape = inputShape.slice(); + this.dims.forEach((dim, i) => { + outputShape[i + 1] = inputShape[dim]; + }); + return outputShape; + } + call(inputs, kwargs) { + return transpose5(getExactlyOneTensor2(inputs), this.dimsIncludingBatch); + } + getConfig() { + const config3 = { + dims: this.dims + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Permute2.className = "Permute"; +serialization_exports2.registerClass(Permute2); +var Masking2 = class extends Layer2 { + constructor(args) { + super(args == null ? {} : args); + this.supportsMasking = true; + if (args != null) { + this.maskValue = args.maskValue == null ? 0 : args.maskValue; + } else { + this.maskValue = 0; + } + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { maskValue: this.maskValue }; + Object.assign(config3, baseConfig); + return config3; + } + computeMask(inputs, mask) { + const input3 = getExactlyOneTensor2(inputs); + const axis = -1; + return any5(notEqual4(input3, this.maskValue), axis); + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + const axis = -1; + const keepDims = true; + const booleanMask = any5(notEqual4(input3, this.maskValue), axis, keepDims); + const output = mul2(input3, cast6(booleanMask, input3.dtype)); + return output; + }); + } +}; +Masking2.className = "Masking"; +serialization_exports2.registerClass(Masking2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js +var Embedding2 = class extends Layer2 { + constructor(args) { + super(args); + this.embeddings = null; + this.DEFAULT_EMBEDDINGS_INITIALIZER = "randomUniform"; + if (args.batchInputShape == null && args.inputShape == null) { + let batchSize = null; + if (args.batchSize != null) { + batchSize = args.batchSize; + } + if (args.inputLength == null) { + this.batchInputShape = [batchSize, null]; + } else { + this.batchInputShape = [batchSize].concat(toList2(args.inputLength)); + } + } + this.inputDim = args.inputDim; + assertPositiveInteger2(this.inputDim, "inputDim"); + this.outputDim = args.outputDim; + assertPositiveInteger2(this.outputDim, "outputDim"); + this.embeddingsInitializer = getInitializer2(args.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER); + this.embeddingsRegularizer = getRegularizer2(args.embeddingsRegularizer); + this.activityRegularizer = getRegularizer2(args.activityRegularizer); + this.embeddingsConstraint = getConstraint2(args.embeddingsConstraint); + this.maskZero = args.maskZero; + this.supportsMasking = args.maskZero; + this.inputLength = args.inputLength; + } + build(inputShape) { + this.embeddings = this.addWeight("embeddings", [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); + this.built = true; + } + warnOnIncompatibleInputShape(inputShape) { + } + computeMask(inputs, mask) { + return tidy2(() => { + if (!this.maskZero) { + return null; + } else { + inputs = getExactlyOneTensor2(inputs); + return notEqual4(inputs, zerosLike5(inputs)); + } + }); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (this.inputLength == null) { + return [...inputShape, this.outputDim]; + } + const inLens = toList2(this.inputLength); + if (inLens.length !== inputShape.length - 1) { + throw new ValueError2(`"inputLength" is ${this.inputLength}, but received input shape has shape ${inputShape}`); + } else { + let i = 0; + for (let k = 0; k < inLens.length; ++k) { + const s1 = inLens[k]; + const s2 = inputShape[k + 1]; + if (s1 != null && s2 != null && s1 !== s2) { + throw new ValueError2(`"inputLength" is ${this.inputLength}, but received input shape has shape ${inputShape}`); + } else if (s1 == null) { + inLens[i] = s2; + } + i++; + } + } + return [inputShape[0], ...inLens, this.outputDim]; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + let input3 = getExactlyOneTensor2(inputs); + if (input3.dtype !== "int32") { + input3 = cast7(input3, "int32"); + } + const output = gather4(this.embeddings.read(), reshape6(input3, [input3.size])); + return reshape6(output, getExactlyOneShape2(this.computeOutputShape(input3.shape))); + }); + } + getConfig() { + const config3 = { + inputDim: this.inputDim, + outputDim: this.outputDim, + embeddingsInitializer: serializeInitializer2(this.embeddingsInitializer), + embeddingsRegularizer: serializeRegularizer2(this.embeddingsRegularizer), + activityRegularizer: serializeRegularizer2(this.activityRegularizer), + embeddingsConstraint: serializeConstraint2(this.embeddingsConstraint), + maskZero: this.maskZero, + inputLength: this.inputLength + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Embedding2.className = "Embedding"; +serialization_exports2.registerClass(Embedding2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js +var Merge2 = class extends Layer2 { + constructor(args) { + super(args || {}); + this.supportsMasking = true; + } + mergeFunction(inputs) { + throw new NotImplementedError2(); + } + computeElementwiseOpOutputShape(shape1, shape2) { + if (shape1 == null || shape2 == null) { + return null; + } else if (shape1.length < shape2.length) { + return this.computeElementwiseOpOutputShape(shape2, shape1); + } else if (shape2.length === 0) { + return shape1; + } + const outputShape = shape1.slice(0, shape1.length - shape2.length); + for (let k = 0; k < shape2.length; ++k) { + const i = shape1[shape1.length - shape2.length + k]; + const j = shape2[k]; + if (i == null || j == null || i < 0 || j < 0) { + outputShape.push(null); + } else if (i === 1) { + outputShape.push(j); + } else if (j === 1) { + outputShape.push(i); + } else { + if (i !== j) { + throw new ValueError2("Operands could not be broadcast together with shapes " + JSON.stringify(shape1) + " " + JSON.stringify(shape2)); + } + outputShape.push(i); + } + } + return outputShape; + } + build(inputShape) { + if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { + inputShape = [getExactlyOneShape2(inputShape)]; + } + inputShape = inputShape; + if (inputShape.length < 2) { + throw new ValueError2(`A merge layer should be called on an Array of at least 2 inputs. Got ${inputShape.length} input(s).`); + } + let batchSizes = []; + for (const shape of inputShape) { + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = unique6(batchSizes); + if (batchSizes.length > 1) { + throw new ValueError2(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(inputShape)}.`); + } + let outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); + for (let i = 1; i < inputShape.length; ++i) { + const shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + const allRanks = inputShape.map((shape) => shape.length); + if (inputShape.indexOf(null) === -1 && unique6(allRanks).length === 1) { + this.reshapeRequired = false; + } else { + this.reshapeRequired = true; + } + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = inputs; + if (this.reshapeRequired) { + const reshapedInputs = []; + const inputDims = inputs.map((input3) => input3.rank); + if (inputDims.indexOf(null) === -1) { + const maxNDim = max7(inputDims); + for (let x of inputs) { + const xNDim = x.rank; + for (let k = 0; k < maxNDim - xNDim; ++k) { + x = expandDims7(x, 1); + } + reshapedInputs.push(x); + } + return this.mergeFunction(reshapedInputs); + } else { + let transposed = false; + for (const x of inputs) { + const xNDim = x.rank; + if (xNDim == null) { + const xShape = x.shape; + const batchSize = xShape[0]; + const newShape = xShape.slice(1).concat([batchSize]); + let xTransposed = reshape6(x, [batchSize].concat(arrayProd2(xShape.slice(1)))); + xTransposed = transpose5(xTransposed, [1, 0]); + xTransposed = reshape6(xTransposed, newShape); + reshapedInputs.push(xTransposed); + transposed = true; + } else if (xNDim > 1) { + const dims = range7(1, xNDim).concat([0]); + reshapedInputs.push(transpose5(x, dims)); + transposed = true; + } else { + reshapedInputs.push(x); + } + } + let y = this.mergeFunction(reshapedInputs); + const yNDim = y.rank; + if (transposed) { + if (yNDim == null) { + const yShape = y.shape; + const yNDim2 = yShape.length; + const batchSize = yShape[yNDim2 - 1]; + const newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); + y = reshape6(transpose5(reshape6(y, [-1, batchSize]), [1, 0]), newShape); + } else if (yNDim > 1) { + const dims = [yNDim - 1].concat(range7(0, yNDim - 1)); + y = transpose5(y, dims); + } + } + return y; + } + } else { + return this.mergeFunction(inputs); + } + }); + } + computeOutputShape(inputShape) { + inputShape = inputShape; + let outputShape; + if (inputShape[0] == null) { + outputShape = null; + } else { + outputShape = inputShape[0].slice(1); + } + for (let i = 1; i < inputShape.length; ++i) { + const shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + let batchSizes = []; + for (const shape of inputShape) { + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = unique6(batchSizes); + if (batchSizes.length === 1) { + outputShape = batchSizes.concat(outputShape); + } else { + outputShape = [null].concat(outputShape); + } + return outputShape; + } + computeMask(inputs, mask) { + return tidy2(() => { + if (mask == null) { + return null; + } + if (!Array.isArray(mask)) { + throw new ValueError2("`mask` should be an Array"); + } + if (!Array.isArray(inputs)) { + throw new ValueError2("`inputs` should be an Array"); + } + if (mask.length !== inputs.length) { + throw new ValueError2(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${inputs.length} vs ${mask.length})`); + } + if (mask.every((m) => m == null)) { + return null; + } + mask = mask.map((m) => m == null ? m : expandDims6(m, 0)); + let output = mask[0]; + for (let i = 1; i < mask.length - 1; ++i) { + output = logicalAnd4(output, mask[i]); + } + return output; + }); + } +}; +var Add4 = class extends Merge2 { + constructor(args) { + super(args); + } + mergeFunction(inputs) { + return tidy2(() => { + let output = inputs[0].clone(); + for (let i = 1; i < inputs.length; ++i) { + output = add6(output, inputs[i]); + } + return output; + }); + } +}; +Add4.className = "Add"; +serialization_exports2.registerClass(Add4); +var Multiply4 = class extends Merge2 { + constructor(args) { + super(args); + } + mergeFunction(inputs) { + return tidy2(() => { + let output = inputs[0].clone(); + for (let i = 1; i < inputs.length; ++i) { + output = mul2(output, inputs[i]); + } + return output; + }); + } +}; +Multiply4.className = "Multiply"; +serialization_exports2.registerClass(Multiply4); +var Average2 = class extends Merge2 { + constructor(args) { + super(args); + } + mergeFunction(inputs) { + return tidy2(() => { + let output = inputs[0].clone(); + for (let i = 1; i < inputs.length; ++i) { + output = add6(output, inputs[i]); + } + return mul2(1 / inputs.length, output); + }); + } +}; +Average2.className = "Average"; +serialization_exports2.registerClass(Average2); +var Maximum4 = class extends Merge2 { + constructor(args) { + super(args); + } + mergeFunction(inputs) { + return tidy2(() => { + let output = inputs[0]; + for (let i = 1; i < inputs.length; ++i) { + output = maximum5(output, inputs[i]); + } + return output; + }); + } +}; +Maximum4.className = "Maximum"; +serialization_exports2.registerClass(Maximum4); +var Minimum4 = class extends Merge2 { + constructor(args) { + super(args); + } + mergeFunction(inputs) { + return tidy2(() => { + let output = inputs[0]; + for (let i = 1; i < inputs.length; ++i) { + output = minimum5(output, inputs[i]); + } + return output; + }); + } +}; +Minimum4.className = "Minimum"; +serialization_exports2.registerClass(Minimum4); +var Concatenate2 = class extends Merge2 { + constructor(args) { + super(args); + this.DEFAULT_AXIS = -1; + if (args == null) { + args = {}; + } + this.axis = args.axis == null ? this.DEFAULT_AXIS : args.axis; + this.supportsMasking = true; + this.reshapeRequired = false; + } + build(inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || inputShape.length === 1) { + throw new ValueError2("A `Concatenate` layer should be called on a list of at least 2 inputs"); + } + inputShape = inputShape; + let allNoneShape = true; + for (const shape of inputShape) { + if (shape != null) { + allNoneShape = false; + break; + } + } + if (allNoneShape) { + return; + } + const shapeSet = []; + for (let i = 0; i < inputShape.length; ++i) { + const shapeWithoutConcatAxis = inputShape[i].slice(); + shapeWithoutConcatAxis.splice(this.axis, 1); + let exists = false; + for (const shape of shapeSet) { + if (util_exports2.arraysEqual(shape, shapeWithoutConcatAxis)) { + exists = true; + break; + } + } + if (!exists) { + shapeSet.push(shapeWithoutConcatAxis); + } + } + if (shapeSet.length > 1) { + throw new ValueError2("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: " + JSON.stringify(inputShape)); + } + } + mergeFunction(inputs) { + return tidy2(() => { + return concatenate3(inputs, this.axis); + }); + } + computeOutputShape(inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { + throw new ValueError2("A `Concatenate` layer should be called on a list of inputs."); + } + const inputShapes = inputShape; + const outputShape = inputShapes[0].slice(); + const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; + for (const shape of inputShapes.slice(1)) { + if (outputShape[axis] == null || shape[axis] == null) { + outputShape[axis] = null; + break; + } + outputShape[axis] += shape[axis]; + } + return outputShape; + } + computeMask(inputs, mask) { + if (mask == null) { + return null; + } + if (!Array.isArray(mask)) { + throw new ValueError2("`mask` should be an array for Concatenate"); + } + if (!Array.isArray(inputs)) { + throw new ValueError2("`inputs` should be an array for Concatenate"); + } + if (mask.length !== inputs.length) { + throw new ValueError2(`Mismatch in the length of mask (${mask.length}) and the legnth of inputs (${inputs.length})`); + } + return tidy2(() => { + let allNullMasks = true; + mask.forEach((m) => { + if (m != null) { + allNullMasks = false; + return; + } + }); + if (allNullMasks) { + return null; + } + const outputMasks = []; + for (let i = 0; i < inputs.length; ++i) { + if (mask[i] == null) { + outputMasks.push(cast6(onesLike5(inputs[i]), "bool")); + } else if (mask[i].rank < inputs[i].rank) { + outputMasks.push(expandDims6(mask[i], -1)); + } else { + outputMasks.push(mask[i]); + } + } + const concatenatedMasks = concat5(outputMasks, this.axis); + return all5(concatenatedMasks, -1, false); + }); + } + getConfig() { + const config3 = { + "axis": this.axis + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Concatenate2.className = "Concatenate"; +serialization_exports2.registerClass(Concatenate2); +function interpretAxis2(axis, dim) { + while (axis < 0) { + axis += dim; + } + return axis; +} +function batchDot2(x, y, axes) { + if (x.shape.length > 3 || y.shape.length > 3) { + throw new NotImplementedError2("batchDot is not implemented for tensors of 4D or higher rank yet"); + } + util_exports2.assert(x.shape.length >= 2, () => `batchDot requires the rank of x to be >= 2, but got ${x.shape.length}`); + util_exports2.assert(x.shape.length >= 2, () => `batchDot requires the rank of y to be >= 2, but got ${y.shape.length}`); + if (typeof axes === "number") { + axes = [axes, axes]; + } + if (x.dtype === "complex64" || y.dtype === "complex64") { + throw new NotImplementedError2("batchDot is not implemented for complex64-type Tensors yet."); + } + const xNDim = x.shape.length; + const yNDim = y.shape.length; + if (axes == null) { + axes = [xNDim - 1, yNDim - 2]; + } + const axesArray = axes; + return tidy2(() => { + let diff; + if (xNDim > yNDim) { + diff = xNDim - yNDim; + const diffShape = []; + for (let i = 0; i < diff; ++i) { + diffShape.push(1); + } + y = reshape6(y, y.shape.concat(diffShape)); + } else if (yNDim > xNDim) { + diff = yNDim - xNDim; + const diffShape = []; + for (let i = 0; i < diff; ++i) { + diffShape.push(1); + } + x = reshape6(x, x.shape.concat(diffShape)); + } else { + diff = 0; + } + let out; + if (x.shape.length === 2 && y.shape.length === 2) { + if (axesArray[0] === axesArray[1]) { + out = sum7(mul2(x, y), axesArray[0]); + } else { + out = sum7(mul2(transpose5(x, [1, 0]), y), axesArray[1]); + } + } else { + const adjX = axesArray[0] !== x.shape.length - 1; + const adjY = axesArray[1] === y.shape.length - 1; + out = matMul3(x, y, adjX, adjY); + } + if (diff > 0) { + let idx; + if (xNDim > yNDim) { + idx = xNDim + yNDim - 3; + } else { + idx = xNDim - 1; + } + const squeezeAxes = []; + for (let i = idx; i < idx + diff; ++i) { + squeezeAxes.push(i); + } + out = squeeze2(out, squeezeAxes); + } + if (out.shape.length === 1) { + out = expandDims6(out, 1); + } + return out; + }); +} +var Dot2 = class extends Merge2 { + constructor(args) { + super(args); + this.axes = args.axes; + this.normalize = args.normalize == null ? false : args.normalize; + this.supportsMasking = true; + this.reshapeRequired = false; + } + build(inputShape) { + util_exports2.assert(Array.isArray(inputShape) && inputShape.length === 2 && Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => "A `Dot` layer should be called on a list of exactly 2 inputs."); + const shape1 = inputShape[0]; + const shape2 = inputShape[1]; + if (shape1.length > 3 || shape2.length > 3) { + throw new NotImplementedError2("Dot layer does not support tensors of 4D or higher rank yet."); + } + const axes = this.interpretAxes(shape1, shape2); + if (shape1[axes[0]] !== shape2[axes[1]]) { + throw new ValueError2(`Dimension incompatibility: ${shape1[axes[0]]} !== ${shape2[axes[1]]}`); + } + } + mergeFunction(inputs) { + if (inputs.length !== 2) { + throw new ValueError2(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${inputs.length} input(s).`); + } + let x1 = inputs[0]; + let x2 = inputs[1]; + let axes; + if (!Array.isArray(this.axes)) { + axes = [ + interpretAxis2(this.axes, x1.shape.length), + interpretAxis2(this.axes, x2.shape.length) + ]; + } else { + axes = this.axes.map((axis, i) => interpretAxis2(axis, inputs[i].shape.length)); + } + if (this.normalize) { + x1 = l2Normalize2(x1, axes[0]); + x2 = l2Normalize2(x2, axes[1]); + } + return batchDot2(x1, x2, axes); + } + interpretAxes(shape1, shape2) { + let axes; + if (!Array.isArray(this.axes)) { + axes = [ + interpretAxis2(this.axes, shape1.length), + interpretAxis2(this.axes, shape2.length) + ]; + } else { + axes = this.axes; + } + return axes; + } + computeOutputShape(inputShape) { + util_exports2.assert(Array.isArray(inputShape) && inputShape.length === 2 && Array.isArray(inputShape[0]) && Array.isArray(inputShape[1]), () => "A `Dot` layer should be called on a list of exactly 2 inputs."); + const shape1 = inputShape[0].slice(); + const shape2 = inputShape[1].slice(); + if (shape1.length > 3 || shape2.length > 3) { + throw new NotImplementedError2("Dot layer does not support tensors of 4D or higher rank yet."); + } + const axes = this.interpretAxes(shape1, shape2); + shape1.splice(axes[0], 1); + shape2.splice(axes[1], 1); + shape2.splice(0, 1); + const outputShape = shape1.concat(shape2); + if (outputShape.length === 1) { + outputShape.push(1); + } + return outputShape; + } + computeMask(inputs, mask) { + return null; + } + getConfig() { + const config3 = { + "axes": this.axes, + "normalize": this.normalize + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +Dot2.className = "Dot"; +serialization_exports2.registerClass(Dot2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/noise.js +var GaussianNoise2 = class extends Layer2 { + constructor(args) { + super(args); + this.supportsMasking = true; + this.stddev = args.stddev; + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { stddev: this.stddev }; + Object.assign(config3, baseConfig); + return config3; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + const noised = () => add6(randomNormal5(input3.shape, 0, this.stddev), input3); + const output = inTrainPhase2(noised, () => input3, kwargs["training"] || false); + return output; + }); + } +}; +GaussianNoise2.className = "GaussianNoise"; +serialization_exports2.registerClass(GaussianNoise2); +var GaussianDropout2 = class extends Layer2 { + constructor(args) { + super(args); + this.supportsMasking = true; + this.rate = args.rate; + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { rate: this.rate }; + Object.assign(config3, baseConfig); + return config3; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + const input3 = getExactlyOneTensor2(inputs); + if (this.rate > 0 && this.rate < 1) { + const noised = () => { + const stddev = Math.sqrt(this.rate / (1 - this.rate)); + return mul2(input3, randomNormal5(input3.shape, 1, stddev)); + }; + return inTrainPhase2(noised, () => input3, kwargs["training"] || false); + } + return input3; + }); + } +}; +GaussianDropout2.className = "GaussianDropout"; +serialization_exports2.registerClass(GaussianDropout2); +var AlphaDropout2 = class extends Layer2 { + constructor(args) { + super(args); + this.supportsMasking = true; + this.rate = args.rate; + this.noiseShape = args.noiseShape; + } + _getNoiseShape(inputs) { + return this.noiseShape || getExactlyOneTensor2(inputs).shape; + } + computeOutputShape(inputShape) { + return inputShape; + } + getConfig() { + const baseConfig = super.getConfig(); + const config3 = { rate: this.rate }; + Object.assign(config3, baseConfig); + return config3; + } + call(inputs, kwargs) { + return tidy2(() => { + if (this.rate < 1 && this.rate > 0) { + const noiseShape = this._getNoiseShape(inputs); + const droppedInputs = () => { + const input3 = getExactlyOneTensor2(inputs); + const alpha = 1.6732632423543772; + const scale4 = 1.0507009873554805; + const alphaP = -alpha * scale4; + let keptIdx = greaterEqual4(randomUniform3(noiseShape), this.rate); + keptIdx = cast7(keptIdx, "float32"); + const a = ((1 - this.rate) * (1 + this.rate * alphaP ** 2)) ** -0.5; + const b = -a * alphaP * this.rate; + const x = add6(mul2(input3, keptIdx), mul2(add6(keptIdx, -1), alphaP)); + return add6(mul2(x, a), b); + }; + return inTrainPhase2(droppedInputs, () => getExactlyOneTensor2(inputs), kwargs["training"] || false); + } + return inputs; + }); + } +}; +AlphaDropout2.className = "AlphaDropout"; +serialization_exports2.registerClass(AlphaDropout2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js +function batchNormalization3(x, mean6, variance, beta, gamma, epsilon5 = 1e-3) { + let out; + if (x.rank === 2) { + out = batchNorm2d2(x, mean6, variance, beta, gamma, epsilon5); + } else if (x.rank === 3) { + out = batchNorm3d2(x, mean6, variance, beta, gamma, epsilon5); + } else if (x.rank === 4) { + out = batchNorm4d2(x, mean6, variance, beta, gamma, epsilon5); + } else { + throw new NotImplementedError2(`batchNormalization is not implemented for array of rank ${x.rank} yet`); + } + return out; +} +function regularNormalizeBatchInTraining2(x, gamma, beta, reductionAxes, epsilon5 = 1e-3) { + return tidy2(() => { + const meanAndVariance = moments2(x, reductionAxes); + const mean6 = meanAndVariance.mean; + const variance = meanAndVariance.variance; + const normed = batchNormalization3(x, mean6, variance, beta, gamma, epsilon5); + return [normed, mean6, variance]; + }); +} +function broadcastNormalizeBatchInTraining2(x, gamma, beta, reductionAxes, epsilon5 = 1e-3) { + return tidy2(() => { + const meanAndVariance = moments2(x, reductionAxes); + const mean6 = meanAndVariance.mean; + const variance = meanAndVariance.variance; + const targetShape = []; + for (const axis of range7(0, x.rank)) { + if (reductionAxes.indexOf(axis) !== -1) { + targetShape.push(1); + } else { + targetShape.push(x.shape[axis]); + } + } + const broadcastMean = reshape6(mean6, targetShape); + const broadcastVariance = reshape6(variance, targetShape); + const broadcastGamma = gamma == null ? null : reshape6(gamma, targetShape); + const broadcastBeta = beta == null ? null : reshape6(beta, targetShape); + const normed = batchNormalization3(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon5); + return [normed, mean6, variance]; + }); +} +function normalizeBatchInTraining2(x, gamma, beta, reductionAxes, epsilon5 = 1e-3) { + if (util_exports2.arraysEqual(reductionAxes.slice().sort(), range7(0, x.rank - 1))) { + return regularNormalizeBatchInTraining2(x, gamma, beta, reductionAxes, epsilon5); + } else { + return broadcastNormalizeBatchInTraining2(x, gamma, beta, reductionAxes, epsilon5); + } +} +var BatchNormalization2 = class extends Layer2 { + constructor(args) { + if (args == null) { + args = {}; + } + super(args); + this.supportsMasking = true; + this.axis = args.axis == null ? -1 : args.axis; + this.momentum = args.momentum == null ? 0.99 : args.momentum; + this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; + this.center = args.center == null ? true : args.center; + this.scale = args.scale == null ? true : args.scale; + this.betaInitializer = getInitializer2(args.betaInitializer || "zeros"); + this.gammaInitializer = getInitializer2(args.gammaInitializer || "ones"); + this.movingMeanInitializer = getInitializer2(args.movingMeanInitializer || "zeros"); + this.movingVarianceInitializer = getInitializer2(args.movingVarianceInitializer || "ones"); + this.betaConstraint = getConstraint2(args.betaConstraint); + this.gammaConstraint = getConstraint2(args.gammaConstraint); + this.betaRegularizer = getRegularizer2(args.betaRegularizer); + this.gammaRegularizer = getRegularizer2(args.gammaRegularizer); + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const axis = this.axis >= 0 ? this.axis : this.axis + inputShape.length; + const dim = inputShape[axis]; + if (dim == null) { + throw new ValueError2(`Axis ${axis} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(inputShape)}.`); + } + this.inputSpec = [new InputSpec2({ ndim: inputShape.length, axes: { [axis]: dim } })]; + const shape = [dim]; + if (this.scale) { + this.gamma = this.addWeight("gamma", shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); + } + if (this.center) { + this.beta = this.addWeight("beta", shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); + } + this.movingMean = this.addWeight("moving_mean", shape, null, this.movingMeanInitializer, null, false); + this.movingVariance = this.addWeight("moving_variance", shape, null, this.movingVarianceInitializer, null, false); + this.built = true; + } + call(inputs, kwargs) { + return tidy2(() => { + const training = kwargs["training"] == null ? false : kwargs["training"]; + const input3 = getExactlyOneTensor2(inputs); + const inputShape = input3.shape; + const ndim = inputShape.length; + const reductionAxes = range7(0, ndim); + const axis = this.axis >= 0 ? this.axis : this.axis + ndim; + reductionAxes.splice(axis, 1); + const broadcastShape = pyListRepeat2(1, ndim); + broadcastShape[axis] = inputShape[axis]; + const sortedReductionAxes = reductionAxes.slice(); + sortedReductionAxes.sort(); + const needsBroadcasting = !util_exports2.arraysEqual(sortedReductionAxes, range7(0, ndim).slice(0, ndim - 1)); + const normalizeInference = () => { + if (needsBroadcasting) { + const broadcastMovingMean = reshape6(this.movingMean.read(), broadcastShape); + const broadcastMovingVariance = reshape6(this.movingVariance.read(), broadcastShape); + const broadcastBeta = this.center ? reshape6(this.beta.read(), broadcastShape) : null; + const broadcastGamma = this.scale ? reshape6(this.gamma.read(), broadcastShape) : null; + return batchNormalization3(input3, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, this.epsilon); + } else { + return batchNormalization3(input3, this.movingMean.read(), this.movingVariance.read(), this.beta == null ? null : this.beta.read(), this.gamma == null ? null : this.gamma.read(), this.epsilon); + } + }; + if (!training) { + return normalizeInference(); + } + const [normedTraining, mean6, variance] = normalizeBatchInTraining2(input3, this.gamma.read(), this.beta.read(), reductionAxes, this.epsilon); + const doMovingAverage = (variable3, value, momentum) => { + tidy2(() => { + const decay = 1 - momentum; + const origValue = variable3.read(); + const updateDelta = mul2(sub4(origValue, value), decay); + variable3.write(sub4(origValue, updateDelta)); + }); + }; + const updateMovingMeanAndVariance = () => { + doMovingAverage(this.movingMean, mean6, this.momentum); + doMovingAverage(this.movingVariance, variance, this.momentum); + }; + updateMovingMeanAndVariance(); + return normedTraining; + }); + } + getConfig() { + const config3 = { + axis: this.axis, + momentum: this.momentum, + epsilon: this.epsilon, + center: this.center, + scale: this.scale, + betaInitializer: serializeInitializer2(this.betaInitializer), + gammaInitializer: serializeInitializer2(this.gammaInitializer), + movingMeanInitializer: serializeInitializer2(this.movingMeanInitializer), + movingVarianceInitializer: serializeInitializer2(this.movingVarianceInitializer), + betaRegularizer: serializeRegularizer2(this.betaRegularizer), + gammaRegularizer: serializeRegularizer2(this.gammaRegularizer), + betaConstraint: serializeConstraint2(this.betaConstraint), + gammaConstraint: serializeConstraint2(this.gammaConstraint) + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +BatchNormalization2.className = "BatchNormalization"; +serialization_exports2.registerClass(BatchNormalization2); +var LayerNormalization2 = class extends Layer2 { + constructor(args) { + if (args == null) { + args = {}; + } + super(args); + this.axis = args.axis == null ? -1 : args.axis; + if (typeof this.axis === "number") { + if (!Number.isInteger(this.axis)) { + throw new Error(`Expected axis to be an integer, but received ${this.axis}`); + } + } else if (Array.isArray(this.axis)) { + for (const axis of this.axis) { + if (!Number.isInteger(axis)) { + throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`); + } + } + } else { + throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`); + } + this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon; + this.center = args.center == null ? true : args.center; + this.scale = args.scale == null ? true : args.scale; + this.betaInitializer = getInitializer2(args.betaInitializer || "zeros"); + this.gammaInitializer = getInitializer2(args.gammaInitializer || "ones"); + this.betaRegularizer = getRegularizer2(args.betaRegularizer); + this.gammaRegularizer = getRegularizer2(args.gammaRegularizer); + this.supportsMasking = true; + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const nDims = inputShape.length; + if (typeof this.axis === "number") { + this.axis = [this.axis]; + } + for (let i = 0; i < this.axis.length; ++i) { + if (this.axis[i] < 0) { + this.axis[i] += nDims; + } + } + for (const axis of this.axis) { + if (axis < 0 || axis >= nDims) { + throw new Error(`Invalid axis: ${axis}`); + } + } + if (this.axis.length !== unique6(this.axis).length) { + throw new Error(`Found duplicate axes in: ${this.axis}`); + } + const paramShape = this.axis.map((axis) => inputShape[axis]); + const trainable = true; + if (this.scale) { + this.gamma = this.addWeight("gamma", paramShape, "float32", this.gammaInitializer, this.gammaRegularizer, trainable); + } else { + this.gamma = null; + } + if (this.center) { + this.beta = this.addWeight("beta", paramShape, "float32", this.betaInitializer, this.betaRegularizer, trainable); + } else { + this.beta = null; + } + this.built = true; + } + call(inputs, kwargs) { + const input3 = getExactlyOneTensor2(inputs); + const inputShape = input3.shape; + const nDims = inputShape.length; + return tidy2(() => { + const keepDims = true; + let { mean: mean6, variance } = moments2(input3, this.axis, keepDims); + const broadcastShape = pyListRepeat2(1, nDims); + for (const dim of this.axis) { + broadcastShape[dim] = inputShape[dim]; + } + const broadcast = (v) => { + if (v != null && v.shape.length !== nDims && this.axis !== [nDims - 1]) { + return reshape6(v, broadcastShape); + } else { + return v; + } + }; + let scale4 = broadcast(this.gamma.read()); + let offset = broadcast(this.beta.read()); + const momentsTiling = []; + const scaleOffsetTiling = []; + for (let i = 0; i < nDims; ++i) { + if (this.axis.indexOf(i) !== -1) { + momentsTiling.push(inputShape[i]); + scaleOffsetTiling.push(1); + } else { + momentsTiling.push(1); + scaleOffsetTiling.push(inputShape[i]); + } + } + mean6 = tile6(mean6, momentsTiling); + variance = tile6(variance, momentsTiling); + scale4 = tile6(scale4, scaleOffsetTiling); + offset = tile6(offset, scaleOffsetTiling); + return batchNormalization3(input3, mean6, variance, offset, scale4, this.epsilon); + }); + } + getConfig() { + const config3 = { + axis: this.axis, + epsilon: this.epsilon, + center: this.center, + scale: this.scale, + betaInitializer: serializeInitializer2(this.betaInitializer), + gammaInitializer: serializeInitializer2(this.gammaInitializer), + betaRegularizer: serializeRegularizer2(this.betaRegularizer), + gammaRegularizer: serializeRegularizer2(this.gammaRegularizer) + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +LayerNormalization2.className = "LayerNormalization"; +serialization_exports2.registerClass(LayerNormalization2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js +function spatial2dPadding2(x, padding2, dataFormat) { + return tidy2(() => { + if (x.rank !== 4) { + throw new ValueError2(`temporalPadding expects input tensor to be 4-D, but received a ${x.rank}-D tensor.`); + } + if (padding2 == null) { + padding2 = [[1, 1], [1, 1]]; + } + if (padding2.length !== 2 || padding2[0].length !== 2 || padding2[1].length !== 2) { + throw new ValueError2("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers."); + } + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + if (dataFormat !== "channelsLast" && dataFormat !== "channelsFirst") { + throw new ValueError2(`Unknown data format: ${dataFormat}. Supported data formats are 'channelsLast' and 'channelsFirst.`); + } + let pattern; + if (dataFormat === "channelsFirst") { + pattern = [[0, 0], [0, 0], padding2[0], padding2[1]]; + } else { + pattern = [[0, 0], padding2[0], padding2[1], [0, 0]]; + } + return pad3(x, pattern); + }); +} +var ZeroPadding2D2 = class extends Layer2 { + constructor(args) { + if (args == null) { + args = {}; + } + super(args); + this.dataFormat = args.dataFormat == null ? imageDataFormat2() : args.dataFormat; + if (args.padding == null) { + this.padding = [[1, 1], [1, 1]]; + } else if (typeof args.padding === "number") { + this.padding = [[args.padding, args.padding], [args.padding, args.padding]]; + } else { + args.padding = args.padding; + if (args.padding.length !== 2) { + throw new ValueError2(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${args.padding.length} array.`); + } + let heightPadding; + let widthPadding; + if (typeof args.padding[0] === "number") { + heightPadding = [args.padding[0], args.padding[0]]; + widthPadding = [args.padding[1], args.padding[1]]; + } else { + args.padding = args.padding; + if (args.padding[0].length !== 2) { + throw new ValueError2(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${args.padding[0].length} array.`); + } + heightPadding = args.padding[0]; + if (args.padding[1].length !== 2) { + throw new ValueError2(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${args.padding[1].length} array.`); + } + widthPadding = args.padding[1]; + } + this.padding = [heightPadding, widthPadding]; + } + this.inputSpec = [new InputSpec2({ ndim: 4 })]; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + let rows; + let cols; + if (this.dataFormat === "channelsFirst") { + if (inputShape[2] != null && inputShape[2] >= 0) { + rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; + } else { + rows = null; + } + if (inputShape[3] != null && inputShape[3] >= 0) { + cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; + } else { + cols = null; + } + return [inputShape[0], inputShape[1], rows, cols]; + } else { + if (inputShape[1] != null && inputShape[1] >= 0) { + rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; + } else { + rows = null; + } + if (inputShape[2] != null && inputShape[2] >= 0) { + cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; + } else { + cols = null; + } + return [inputShape[0], rows, cols, inputShape[3]]; + } + } + call(inputs, kwargs) { + return tidy2(() => spatial2dPadding2(getExactlyOneTensor2(inputs), this.padding, this.dataFormat)); + } + getConfig() { + const config3 = { + padding: this.padding, + dataFormat: this.dataFormat + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +ZeroPadding2D2.className = "ZeroPadding2D"; +serialization_exports2.registerClass(ZeroPadding2D2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js +function pool2d2(x, poolSize, strides, padding2, dataFormat, poolMode) { + return tidy2(() => { + checkDataFormat2(dataFormat); + checkPoolMode2(poolMode); + checkPaddingMode2(padding2); + if (strides == null) { + strides = [1, 1]; + } + if (padding2 == null) { + padding2 = "valid"; + } + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + if (poolMode == null) { + poolMode = "max"; + } + x = preprocessConv2DInput2(x, dataFormat); + let y; + const paddingString = padding2 === "same" ? "same" : "valid"; + if (poolMode === "max") { + y = maxPool5(x, poolSize, strides, paddingString); + } else { + y = avgPool5(x, poolSize, strides, paddingString); + } + if (dataFormat === "channelsFirst") { + y = transpose5(y, [0, 3, 1, 2]); + } + return y; + }); +} +function pool3d3(x, poolSize, strides, padding2, dataFormat, poolMode) { + return tidy2(() => { + checkDataFormat2(dataFormat); + checkPoolMode2(poolMode); + checkPaddingMode2(padding2); + if (strides == null) { + strides = [1, 1, 1]; + } + if (padding2 == null) { + padding2 = "valid"; + } + if (dataFormat == null) { + dataFormat = imageDataFormat2(); + } + if (poolMode == null) { + poolMode = "max"; + } + x = preprocessConv3DInput2(x, dataFormat); + let y; + const paddingString = padding2 === "same" ? "same" : "valid"; + if (poolMode === "max") { + y = maxPool3d3(x, poolSize, strides, paddingString); + } else { + y = avgPool3d3(x, poolSize, strides, paddingString); + } + if (dataFormat === "channelsFirst") { + y = transpose5(y, [0, 4, 1, 2, 3]); + } + return y; + }); +} +var Pooling1D2 = class extends Layer2 { + constructor(args) { + if (args.poolSize == null) { + args.poolSize = 2; + } + super(args); + if (typeof args.poolSize === "number") { + this.poolSize = [args.poolSize]; + } else if (Array.isArray(args.poolSize) && args.poolSize.length === 1 && typeof args.poolSize[0] === "number") { + this.poolSize = args.poolSize; + } else { + throw new ValueError2(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(args.poolSize)}`); + } + assertPositiveInteger2(this.poolSize, "poolSize"); + if (args.strides == null) { + this.strides = this.poolSize; + } else { + if (typeof args.strides === "number") { + this.strides = [args.strides]; + } else if (Array.isArray(args.strides) && args.strides.length === 1 && typeof args.strides[0] === "number") { + this.strides = args.strides; + } else { + throw new ValueError2(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(args.strides)}`); + } + } + assertPositiveInteger2(this.strides, "strides"); + this.padding = args.padding == null ? "valid" : args.padding; + checkPaddingMode2(this.padding); + this.inputSpec = [new InputSpec2({ ndim: 3 })]; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const length = convOutputLength2(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); + return [inputShape[0], length, inputShape[2]]; + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + inputs = expandDims7(getExactlyOneTensor2(inputs), 2); + const output = this.poolingFunction(getExactlyOneTensor2(inputs), [this.poolSize[0], 1], [this.strides[0], 1], this.padding, "channelsLast"); + return squeeze2(output, [2]); + }); + } + getConfig() { + const config3 = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +var MaxPooling1D2 = class extends Pooling1D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool2d2(inputs, poolSize, strides, padding2, dataFormat, "max"); + } +}; +MaxPooling1D2.className = "MaxPooling1D"; +serialization_exports2.registerClass(MaxPooling1D2); +var AveragePooling1D2 = class extends Pooling1D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool2d2(inputs, poolSize, strides, padding2, dataFormat, "avg"); + } +}; +AveragePooling1D2.className = "AveragePooling1D"; +serialization_exports2.registerClass(AveragePooling1D2); +var Pooling2D2 = class extends Layer2 { + constructor(args) { + if (args.poolSize == null) { + args.poolSize = [2, 2]; + } + super(args); + this.poolSize = Array.isArray(args.poolSize) ? args.poolSize : [args.poolSize, args.poolSize]; + if (args.strides == null) { + this.strides = this.poolSize; + } else if (Array.isArray(args.strides)) { + if (args.strides.length !== 2) { + throw new ValueError2(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${args.strides.length}.`); + } + this.strides = args.strides; + } else { + this.strides = [args.strides, args.strides]; + } + assertPositiveInteger2(this.poolSize, "poolSize"); + assertPositiveInteger2(this.strides, "strides"); + this.padding = args.padding == null ? "valid" : args.padding; + this.dataFormat = args.dataFormat == null ? "channelsLast" : args.dataFormat; + checkDataFormat2(this.dataFormat); + checkPaddingMode2(this.padding); + this.inputSpec = [new InputSpec2({ ndim: 4 })]; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + let rows = this.dataFormat === "channelsFirst" ? inputShape[2] : inputShape[1]; + let cols = this.dataFormat === "channelsFirst" ? inputShape[3] : inputShape[2]; + rows = convOutputLength2(rows, this.poolSize[0], this.padding, this.strides[0]); + cols = convOutputLength2(cols, this.poolSize[1], this.padding, this.strides[1]); + if (this.dataFormat === "channelsFirst") { + return [inputShape[0], inputShape[1], rows, cols]; + } else { + return [inputShape[0], rows, cols, inputShape[3]]; + } + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + return this.poolingFunction(getExactlyOneTensor2(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); + }); + } + getConfig() { + const config3 = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + dataFormat: this.dataFormat + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +var MaxPooling2D2 = class extends Pooling2D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool2d2(inputs, poolSize, strides, padding2, dataFormat, "max"); + } +}; +MaxPooling2D2.className = "MaxPooling2D"; +serialization_exports2.registerClass(MaxPooling2D2); +var AveragePooling2D2 = class extends Pooling2D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool2d2(inputs, poolSize, strides, padding2, dataFormat, "avg"); + } +}; +AveragePooling2D2.className = "AveragePooling2D"; +serialization_exports2.registerClass(AveragePooling2D2); +var Pooling3D2 = class extends Layer2 { + constructor(args) { + if (args.poolSize == null) { + args.poolSize = [2, 2, 2]; + } + super(args); + this.poolSize = Array.isArray(args.poolSize) ? args.poolSize : [args.poolSize, args.poolSize, args.poolSize]; + if (args.strides == null) { + this.strides = this.poolSize; + } else if (Array.isArray(args.strides)) { + if (args.strides.length !== 3) { + throw new ValueError2(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${args.strides.length}.`); + } + this.strides = args.strides; + } else { + this.strides = [args.strides, args.strides, args.strides]; + } + assertPositiveInteger2(this.poolSize, "poolSize"); + assertPositiveInteger2(this.strides, "strides"); + this.padding = args.padding == null ? "valid" : args.padding; + this.dataFormat = args.dataFormat == null ? "channelsLast" : args.dataFormat; + checkDataFormat2(this.dataFormat); + checkPaddingMode2(this.padding); + this.inputSpec = [new InputSpec2({ ndim: 5 })]; + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + let depths = this.dataFormat === "channelsFirst" ? inputShape[2] : inputShape[1]; + let rows = this.dataFormat === "channelsFirst" ? inputShape[3] : inputShape[2]; + let cols = this.dataFormat === "channelsFirst" ? inputShape[4] : inputShape[3]; + depths = convOutputLength2(depths, this.poolSize[0], this.padding, this.strides[0]); + rows = convOutputLength2(rows, this.poolSize[1], this.padding, this.strides[1]); + cols = convOutputLength2(cols, this.poolSize[2], this.padding, this.strides[2]); + if (this.dataFormat === "channelsFirst") { + return [inputShape[0], inputShape[1], depths, rows, cols]; + } else { + return [inputShape[0], depths, rows, cols, inputShape[4]]; + } + } + call(inputs, kwargs) { + return tidy2(() => { + this.invokeCallHook(inputs, kwargs); + return this.poolingFunction(getExactlyOneTensor2(inputs), this.poolSize, this.strides, this.padding, this.dataFormat); + }); + } + getConfig() { + const config3 = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + dataFormat: this.dataFormat + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +var MaxPooling3D2 = class extends Pooling3D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool3d3(inputs, poolSize, strides, padding2, dataFormat, "max"); + } +}; +MaxPooling3D2.className = "MaxPooling3D"; +serialization_exports2.registerClass(MaxPooling3D2); +var AveragePooling3D2 = class extends Pooling3D2 { + constructor(args) { + super(args); + } + poolingFunction(inputs, poolSize, strides, padding2, dataFormat) { + checkDataFormat2(dataFormat); + checkPaddingMode2(padding2); + return pool3d3(inputs, poolSize, strides, padding2, dataFormat, "avg"); + } +}; +AveragePooling3D2.className = "AveragePooling3D"; +serialization_exports2.registerClass(AveragePooling3D2); +var GlobalPooling1D2 = class extends Layer2 { + constructor(args) { + super(args); + this.inputSpec = [new InputSpec2({ ndim: 3 })]; + } + computeOutputShape(inputShape) { + return [inputShape[0], inputShape[2]]; + } + call(inputs, kwargs) { + throw new NotImplementedError2(); + } +}; +var GlobalAveragePooling1D2 = class extends GlobalPooling1D2 { + constructor(args) { + super(args || {}); + } + call(inputs, kwargs) { + return tidy2(() => { + const input3 = getExactlyOneTensor2(inputs); + return mean4(input3, 1); + }); + } +}; +GlobalAveragePooling1D2.className = "GlobalAveragePooling1D"; +serialization_exports2.registerClass(GlobalAveragePooling1D2); +var GlobalMaxPooling1D2 = class extends GlobalPooling1D2 { + constructor(args) { + super(args || {}); + } + call(inputs, kwargs) { + return tidy2(() => { + const input3 = getExactlyOneTensor2(inputs); + return max6(input3, 1); + }); + } +}; +GlobalMaxPooling1D2.className = "GlobalMaxPooling1D"; +serialization_exports2.registerClass(GlobalMaxPooling1D2); +var GlobalPooling2D2 = class extends Layer2 { + constructor(args) { + super(args); + this.dataFormat = args.dataFormat == null ? "channelsLast" : args.dataFormat; + checkDataFormat2(this.dataFormat); + this.inputSpec = [new InputSpec2({ ndim: 4 })]; + } + computeOutputShape(inputShape) { + inputShape = inputShape; + if (this.dataFormat === "channelsLast") { + return [inputShape[0], inputShape[3]]; + } else { + return [inputShape[0], inputShape[1]]; + } + } + call(inputs, kwargs) { + throw new NotImplementedError2(); + } + getConfig() { + const config3 = { dataFormat: this.dataFormat }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } +}; +var GlobalAveragePooling2D2 = class extends GlobalPooling2D2 { + call(inputs, kwargs) { + return tidy2(() => { + const input3 = getExactlyOneTensor2(inputs); + if (this.dataFormat === "channelsLast") { + return mean4(input3, [1, 2]); + } else { + return mean4(input3, [2, 3]); + } + }); + } +}; +GlobalAveragePooling2D2.className = "GlobalAveragePooling2D"; +serialization_exports2.registerClass(GlobalAveragePooling2D2); +var GlobalMaxPooling2D2 = class extends GlobalPooling2D2 { + call(inputs, kwargs) { + return tidy2(() => { + const input3 = getExactlyOneTensor2(inputs); + if (this.dataFormat === "channelsLast") { + return max6(input3, [1, 2]); + } else { + return max6(input3, [2, 3]); + } + }); + } +}; +GlobalMaxPooling2D2.className = "GlobalMaxPooling2D"; +serialization_exports2.registerClass(GlobalMaxPooling2D2); + +// node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js +var Wrapper2 = class extends Layer2 { + constructor(args) { + super(args); + this.layer = args.layer; + } + build(inputShape) { + this.built = true; + } + get trainable() { + if (this.layer != null) { + return this.layer.trainable; + } else { + return false; + } + } + set trainable(value) { + if (this.layer != null) { + this.layer.trainable = value; + } + } + get trainableWeights() { + return this.layer.trainableWeights; + } + get nonTrainableWeights() { + return this.layer.nonTrainableWeights; + } + get updates() { + return this.layer._updates; + } + get losses() { + return this.layer.losses; + } + getWeights() { + return this.layer.getWeights(); + } + setWeights(weights) { + this.layer.setWeights(weights); + } + getConfig() { + const config3 = { + "layer": { + "className": this.layer.getClassName(), + "config": this.layer.getConfig() + } + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } + setFastWeightInitDuringBuild(value) { + super.setFastWeightInitDuringBuild(value); + if (this.layer != null) { + this.layer.setFastWeightInitDuringBuild(value); + } + } + static fromConfig(cls, config3, customObjects = {}) { + const layerConfig = config3["layer"]; + const layer = deserialize2(layerConfig, customObjects); + delete config3["layer"]; + const newConfig = { layer }; + Object.assign(newConfig, config3); + return new cls(newConfig); + } +}; +var TimeDistributed2 = class extends Wrapper2 { + constructor(args) { + super(args); + this.supportsMasking = true; + } + build(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + if (inputShape.length < 3) { + throw new ValueError2(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(inputShape)}`); + } + this.inputSpec = [{ shape: inputShape }]; + const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (!this.layer.built) { + this.layer.build(childInputShape); + this.layer.built = true; + } + super.build(inputShape); + } + computeOutputShape(inputShape) { + inputShape = getExactlyOneShape2(inputShape); + const childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + const childOutputShape = this.layer.computeOutputShape(childInputShape); + const timesteps = inputShape[1]; + return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); + } + call(inputs, kwargs) { + return tidy2(() => { + inputs = getExactlyOneTensor2(inputs); + const step8 = (inputs2, states) => { + const output = getExactlyOneTensor2(this.layer.call(inputs2, kwargs)); + return [output, []]; + }; + const rnnOutputs = rnn3(step8, inputs, [], false, null, null, false, true); + const y = rnnOutputs[1]; + return y; + }); + } +}; +TimeDistributed2.className = "TimeDistributed"; +serialization_exports2.registerClass(TimeDistributed2); +function checkBidirectionalMergeMode2(value) { + checkStringTypeUnionValue2(VALID_BIDIRECTIONAL_MERGE_MODES2, "BidirectionalMergeMode", value); +} +var DEFAULT_BIDIRECTIONAL_MERGE_MODE2 = "concat"; +var Bidirectional2 = class extends Wrapper2 { + constructor(args) { + super(args); + const layerConfig = args.layer.getConfig(); + const forwDict = {}; + forwDict["className"] = args.layer.getClassName(); + forwDict["config"] = layerConfig; + this.forwardLayer = deserialize2(forwDict); + layerConfig["goBackwards"] = layerConfig["goBackwards"] === true ? false : true; + const backDict = {}; + backDict["className"] = args.layer.getClassName(); + backDict["config"] = layerConfig; + this.backwardLayer = deserialize2(backDict); + this.forwardLayer.name = "forward_" + this.forwardLayer.name; + this.backwardLayer.name = "backward_" + this.backwardLayer.name; + this.mergeMode = args.mergeMode === void 0 ? DEFAULT_BIDIRECTIONAL_MERGE_MODE2 : args.mergeMode; + checkBidirectionalMergeMode2(this.mergeMode); + if (args.weights) { + throw new NotImplementedError2("weights support is not implemented for Bidirectional layer yet."); + } + this._stateful = args.layer.stateful; + this.returnSequences = args.layer.returnSequences; + this.returnState = args.layer.returnState; + this.supportsMasking = true; + this._trainable = true; + this.inputSpec = args.layer.inputSpec; + this.numConstants = null; + } + get trainable() { + return this._trainable; + } + set trainable(value) { + this._trainable = value; + if (this.forwardLayer != null) { + this.forwardLayer.trainable = value; + } + if (this.backwardLayer != null) { + this.backwardLayer.trainable = value; + } + } + getWeights() { + return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); + } + setWeights(weights) { + const numWeights = weights.length; + const numeightsOver2 = Math.floor(numWeights / 2); + this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); + this.backwardLayer.setWeights(weights.slice(numeightsOver2)); + } + computeOutputShape(inputShape) { + let layerShapes = this.forwardLayer.computeOutputShape(inputShape); + if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { + layerShapes = [layerShapes]; + } + layerShapes = layerShapes; + let outputShape; + let outputShapes; + let stateShape; + if (this.returnState) { + stateShape = layerShapes.slice(1); + outputShape = layerShapes[0]; + } else { + outputShape = layerShapes[0]; + } + outputShape = outputShape; + if (this.mergeMode === "concat") { + outputShape[outputShape.length - 1] *= 2; + outputShapes = [outputShape]; + } else if (this.mergeMode == null) { + outputShapes = [outputShape, outputShape.slice()]; + } else { + outputShapes = [outputShape]; + } + if (this.returnState) { + if (this.mergeMode == null) { + return outputShapes.concat(stateShape).concat(stateShape.slice()); + } + return [outputShape].concat(stateShape).concat(stateShape.slice()); + } + return singletonOrArray2(outputShapes); + } + apply(inputs, kwargs) { + let initialState = kwargs == null ? null : kwargs["initialState"]; + let constants = kwargs == null ? null : kwargs["constants"]; + if (kwargs == null) { + kwargs = {}; + } + const standardized = standardizeArgs2(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + if (Array.isArray(inputs)) { + initialState = inputs.slice(1); + inputs = inputs[0]; + } + if ((initialState == null || initialState.length === 0) && constants == null) { + return super.apply(inputs, kwargs); + } + const additionalInputs = []; + const additionalSpecs = []; + if (initialState != null) { + const numStates = initialState.length; + if (numStates % 2 > 0) { + throw new ValueError2("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs."); + } + kwargs["initialState"] = initialState; + additionalInputs.push(...initialState); + const stateSpecs = initialState.map((state) => new InputSpec2({ shape: state.shape })); + this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); + this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); + additionalSpecs.push(...stateSpecs); + } + if (constants != null) { + throw new NotImplementedError2("Support for constants in Bidirectional layers is not implemented yet."); + } + const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor2; + for (const tensor3 of additionalInputs) { + if (tensor3 instanceof SymbolicTensor2 !== isSymbolicTensor) { + throw new ValueError2("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors"); + } + } + if (isSymbolicTensor) { + const fullInput = [inputs].concat(additionalInputs); + const fullInputSpec = this.inputSpec.concat(additionalSpecs); + const originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + const output = super.apply(fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } else { + return super.apply(inputs, kwargs); + } + } + call(inputs, kwargs) { + return tidy2(() => { + const initialState = kwargs["initialState"]; + let y; + let yRev; + if (initialState == null) { + y = this.forwardLayer.call(inputs, kwargs); + yRev = this.backwardLayer.call(inputs, kwargs); + } else { + const forwardState = initialState.slice(0, initialState.length / 2); + const backwardState = initialState.slice(initialState.length / 2); + y = this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); + yRev = this.backwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); + } + let states; + if (this.returnState) { + if (Array.isArray(y)) { + states = y.slice(1).concat(yRev.slice(1)); + } else { + } + y = y[0]; + yRev = yRev[0]; + } + if (this.returnSequences) { + yRev = reverse5(yRev, 1); + } + let output; + if (this.mergeMode === "concat") { + output = concatenate3([y, yRev]); + } else if (this.mergeMode === "sum") { + output = add6(y, yRev); + } else if (this.mergeMode === "ave") { + output = mul2(0.5, add6(y, yRev)); + } else if (this.mergeMode === "mul") { + output = mul2(y, yRev); + } else if (this.mergeMode == null) { + output = [y, yRev]; + } + if (this.returnState) { + if (this.mergeMode == null) { + return output.concat(states); + } + return [output].concat(states); + } + return output; + }); + } + resetStates(states) { + this.forwardLayer.resetStates(); + this.backwardLayer.resetStates(); + } + build(inputShape) { + nameScope2(this.forwardLayer.name, () => { + this.forwardLayer.build(inputShape); + }); + nameScope2(this.backwardLayer.name, () => { + this.backwardLayer.build(inputShape); + }); + this.built = true; + } + computeMask(inputs, mask) { + if (Array.isArray(mask)) { + mask = mask[0]; + } + let outputMask; + if (this.returnSequences) { + if (this.mergeMode == null) { + outputMask = [mask, mask]; + } else { + outputMask = mask; + } + } else { + if (this.mergeMode == null) { + outputMask = [null, null]; + } else { + outputMask = null; + } + } + if (this.returnState) { + const states = this.forwardLayer.states; + const stateMask = states.map((state) => null); + if (Array.isArray(outputMask)) { + return outputMask.concat(stateMask).concat(stateMask); + } else { + return [outputMask].concat(stateMask).concat(stateMask); + } + } else { + return outputMask; + } + } + get trainableWeights() { + return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); + } + get nonTrainableWeights() { + return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); + } + setFastWeightInitDuringBuild(value) { + super.setFastWeightInitDuringBuild(value); + if (this.forwardLayer != null) { + this.forwardLayer.setFastWeightInitDuringBuild(value); + } + if (this.backwardLayer != null) { + this.backwardLayer.setFastWeightInitDuringBuild(value); + } + } + getConfig() { + const config3 = { + "mergeMode": this.mergeMode + }; + const baseConfig = super.getConfig(); + Object.assign(config3, baseConfig); + return config3; + } + static fromConfig(cls, config3) { + const rnnLayer = deserialize2(config3["layer"]); + delete config3["layer"]; + if (config3["numConstants"] != null) { + throw new NotImplementedError2(`Deserialization of a Bidirectional layer with numConstants present is not supported yet.`); + } + const newConfig = config3; + newConfig["layer"] = rnnLayer; + return new cls(newConfig); + } +}; +Bidirectional2.className = "Bidirectional"; +serialization_exports2.registerClass(Bidirectional2); + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.js +var DataType2; +(function(DataType3) { + DataType3[DataType3["DT_INVALID"] = 0] = "DT_INVALID"; + DataType3[DataType3["DT_FLOAT"] = 1] = "DT_FLOAT"; + DataType3[DataType3["DT_DOUBLE"] = 2] = "DT_DOUBLE"; + DataType3[DataType3["DT_INT32"] = 3] = "DT_INT32"; + DataType3[DataType3["DT_UINT8"] = 4] = "DT_UINT8"; + DataType3[DataType3["DT_INT16"] = 5] = "DT_INT16"; + DataType3[DataType3["DT_INT8"] = 6] = "DT_INT8"; + DataType3[DataType3["DT_STRING"] = 7] = "DT_STRING"; + DataType3[DataType3["DT_COMPLEX64"] = 8] = "DT_COMPLEX64"; + DataType3[DataType3["DT_INT64"] = 9] = "DT_INT64"; + DataType3[DataType3["DT_BOOL"] = 10] = "DT_BOOL"; + DataType3[DataType3["DT_QINT8"] = 11] = "DT_QINT8"; + DataType3[DataType3["DT_QUINT8"] = 12] = "DT_QUINT8"; + DataType3[DataType3["DT_QINT32"] = 13] = "DT_QINT32"; + DataType3[DataType3["DT_BFLOAT16"] = 14] = "DT_BFLOAT16"; + DataType3[DataType3["DT_FLOAT_REF"] = 101] = "DT_FLOAT_REF"; + DataType3[DataType3["DT_DOUBLE_REF"] = 102] = "DT_DOUBLE_REF"; + DataType3[DataType3["DT_INT32_REF"] = 103] = "DT_INT32_REF"; + DataType3[DataType3["DT_UINT8_REF"] = 104] = "DT_UINT8_REF"; + DataType3[DataType3["DT_INT16_REF"] = 105] = "DT_INT16_REF"; + DataType3[DataType3["DT_INT8_REF"] = 106] = "DT_INT8_REF"; + DataType3[DataType3["DT_STRING_REF"] = 107] = "DT_STRING_REF"; + DataType3[DataType3["DT_COMPLEX64_REF"] = 108] = "DT_COMPLEX64_REF"; + DataType3[DataType3["DT_INT64_REF"] = 109] = "DT_INT64_REF"; + DataType3[DataType3["DT_BOOL_REF"] = 110] = "DT_BOOL_REF"; + DataType3[DataType3["DT_QINT8_REF"] = 111] = "DT_QINT8_REF"; + DataType3[DataType3["DT_QUINT8_REF"] = 112] = "DT_QUINT8_REF"; + DataType3[DataType3["DT_QINT32_REF"] = 113] = "DT_QINT32_REF"; + DataType3[DataType3["DT_BFLOAT16_REF"] = 114] = "DT_BFLOAT16_REF"; +})(DataType2 || (DataType2 = {})); +var SaverDef2; +(function(SaverDef3) { + let CheckpointFormatVersion; + (function(CheckpointFormatVersion2) { + CheckpointFormatVersion2[CheckpointFormatVersion2["LEGACY"] = 0] = "LEGACY"; + CheckpointFormatVersion2[CheckpointFormatVersion2["V1"] = 1] = "V1"; + CheckpointFormatVersion2[CheckpointFormatVersion2["V2"] = 2] = "V2"; + })(CheckpointFormatVersion = SaverDef3.CheckpointFormatVersion || (SaverDef3.CheckpointFormatVersion = {})); +})(SaverDef2 || (SaverDef2 = {})); + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/custom_op/register.js +var CUSTOM_OPS2 = {}; +function getRegisteredOp2(name) { + return CUSTOM_OPS2[name]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.js +function getParamValue2(paramName, node2, tensorMap, context, resourceManager) { + const inputParam = node2.inputParams[paramName]; + if (inputParam && inputParam.inputIndexStart !== void 0) { + const start = inputParam.inputIndexStart; + const end = inputParam.inputIndexEnd === 0 ? void 0 : inputParam.inputIndexEnd === void 0 ? start + 1 : inputParam.inputIndexEnd; + if (inputParam.type === "tensor") { + return getTensor2(node2.inputNames[inputParam.inputIndexStart], tensorMap, context, resourceManager); + } + if (inputParam.type === "tensors") { + const inputs = node2.inputNames.slice(start, end); + return inputs.map((name) => getTensor2(name, tensorMap, context, resourceManager)); + } + const tensor3 = getTensor2(node2.inputNames.slice(start)[0], tensorMap, context, resourceManager); + const data = tensor3.dataSync(); + return inputParam.type === "number" ? data[0] : util_exports2.toNestedArray(tensor3.shape, data); + } + const attrParam = node2.attrParams[paramName]; + return attrParam && attrParam.value; +} +function getTensor2(name, tensorsMap, context, resourceManager) { + const [nodeName, index] = parseNodeName2(name); + if (resourceManager != null) { + const tensor3 = resourceManager.getHashTableHandleByName(nodeName); + if (tensor3 != null) { + return tensor3; + } + } + const contextId = context.currentContextIds.find((contextId2) => { + return !!tensorsMap[getNodeNameWithContextId2(nodeName, contextId2)]; + }); + return contextId !== void 0 ? tensorsMap[getNodeNameWithContextId2(nodeName, contextId)][index] : void 0; +} +function getTensorsForCurrentContenxt2(name, tensorsMap, context) { + return tensorsMap[getNodeNameWithContextId2(name, context.currentContextId)]; +} +function getNodeNameAndIndex2(inputName, context) { + const [nodeName, index, outputName] = parseNodeName2(inputName); + return [ + getNodeNameWithContextId2(nodeName, context && context.currentContextId), + index, + outputName + ]; +} +function getNodeNameWithContextId2(name, contextId) { + return !!contextId ? `${name}-${contextId}` : name; +} +function parseNodeName2(name) { + const parts = name.split(":"); + if (parts.length === 1) { + return [name, 0, void 0]; + } + const nodeName = parts[0]; + const outputName = parts.length === 3 ? parts[1] : void 0; + const index = Number(parts[parts.length - 1]); + return [nodeName, index, outputName]; +} +function getPadding2(node2, tensorMap, context) { + let pad4 = getParamValue2("pad", node2, tensorMap, context); + if (pad4 === "explicit") { + pad4 = getParamValue2("explicitPaddings", node2, tensorMap, context); + const explicitPadding = [[0, 0], [0, 0], [0, 0], [0, 0]]; + for (let i = 0; i < 4; i++) { + explicitPadding[i][0] = pad4[i * 2]; + explicitPadding[i][1] = pad4[i * 2 + 1]; + } + return explicitPadding; + } + return pad4; +} +function cloneTensor2(tensor3) { + return tensor3.kept ? tensor3 : clone2(tensor3); +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/arithmetic.js +var arithmetic_exports2 = {}; +__export(arithmetic_exports2, { + json: () => json20 +}); +var json20 = [ + { + "tfOpName": "Add", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "AddV2", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "AddN", + "category": "arithmetic", + "inputs": [{ "start": 0, "end": 0, "name": "tensors", "type": "tensors" }] + }, + { + "tfOpName": "BiasAdd", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sub", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "RealDiv", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Div", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "DivNoNan", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "FloorDiv", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Mul", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Maximum", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Minimum", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Pow", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "SquaredDifference", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Mod", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "FloorMod", + "category": "arithmetic", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [{ + "tfName": "T", + "name": "dtype", + "type": "dtype", + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/basic_math.js +var basic_math_exports2 = {}; +__export(basic_math_exports2, { + json: () => json21 +}); +var json21 = [ + { + "tfOpName": "Abs", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Acos", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Asin", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Atan", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Atan2", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "y", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Ceil", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "ClipByValue", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "clipValueMin", "type": "number" }, + { "start": 2, "name": "clipValueMax", "type": "number" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Complex", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "real", "type": "tensor" }, + { "start": 1, "name": "imag", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "ComplexAbs", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Cos", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Cosh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Elu", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Exp", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Floor", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Log", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Imag", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "outputType", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Neg", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Real", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "outputType", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Prelu", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "alpha", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Relu", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Relu6", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Selu", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Sigmoid", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Sin", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Sinh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Sqrt", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Rsqrt", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Square", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Tan", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Tanh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Sign", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Round", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Expm1", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Log1p", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Reciprocal", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Softplus", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Asinh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Acosh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Atanh", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Erf", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Prod", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axes", "type": "number[]" } + ], + "attrs": [ + { + "tfName": "keep_dims", + "name": "keepDims", + "type": "bool", + "notSupported": true + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "LeakyRelu", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "alpha", + "name": "alpha", + "type": "number", + "defaultValue": 0.2 + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "IsNan", + "category": "basic_math", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [{ + "tfName": "T", + "name": "dtype", + "type": "dtype", + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/control.js +var control_exports2 = {}; +__export(control_exports2, { + json: () => json22 +}); +var json22 = [ + { + "tfOpName": "EmptyTensorList", + "category": "control", + "inputs": [ + { "start": 0, "name": "elementShape", "type": "shape" }, + { "start": 1, "name": "maxNumElements", "type": "number" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "LoopCond", + "category": "control", + "inputs": [{ "start": 0, "name": "pred", "type": "tensor" }] + }, + { + "tfOpName": "Switch", + "category": "control", + "inputs": [ + { "start": 0, "name": "data", "type": "tensor" }, + { "start": 1, "name": "pred", "type": "tensor" } + ] + }, + { + "tfOpName": "Merge", + "category": "control", + "inputs": [{ "start": 0, "end": 0, "name": "tensors", "type": "tensors" }] + }, + { + "tfOpName": "Enter", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { "tfName": "frame_name", "name": "frameName", "type": "string" }, + { "tfName": "is_constant", "name": "isConstant", "type": "bool" } + ] + }, + { + "tfOpName": "Exit", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "NextIteration", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "TensorArrayV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "size", "type": "number" } + ], + "attrs": [ + { "tfName": "dtype", "name": "dtype", "type": "dtype" }, + { "tfName": "element_shape", "name": "elementShape", "type": "shape" }, + { "tfName": "dynamic_size", "name": "dynamicSize", "type": "bool" }, + { "tfName": "clear_after_read", "name": "clearAfterRead", "type": "bool" }, + { + "tfName": "identical_element_shapes", + "name": "identicalElementShapes", + "type": "bool" + }, + { "tfName": "tensor_array_name", "name": "name", "type": "string" } + ] + }, + { + "tfOpName": "TensorArrayWriteV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "index", "type": "number" }, + { "start": 2, "name": "tensor", "type": "tensor" }, + { "start": 3, "name": "flowIn", "type": "number" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "TensorArrayReadV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "index", "type": "number" }, + { "start": 2, "name": "flowIn", "type": "number" } + ], + "attrs": [{ + "tfName": "dtype", + "name": "dtype", + "type": "dtype", + "notSupported": true + }] + }, + { + "tfOpName": "TensorArrayGatherV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "number[]" }, + { "start": 2, "name": "flowIn", "type": "number" } + ], + "attrs": [ + { "tfName": "dtype", "name": "dtype", "type": "dtype" }, + { "tfName": "element_shape", "name": "elementShape", "type": "shape" } + ] + }, + { + "tfOpName": "TensorArrayScatterV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "number[]" }, + { "start": 2, "name": "tensor", "type": "tensor" }, + { "start": 3, "name": "flowIn", "type": "number" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "TensorArrayConcatV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "flowIn", "type": "number" } + ], + "attrs": [ + { "tfName": "dtype", "name": "dtype", "type": "dtype" }, + { + "tfName": "element_shape_except0", + "name": "elementShapeExcept0", + "type": "shape", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArraySplitV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "tensor", "type": "tensor" }, + { "start": 2, "name": "lengths", "type": "number[]" }, + { "start": 3, "name": "flowIn", "type": "number" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "TensorArraySizeV3", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorArrayId", "type": "tensor" }, + { "start": 1, "name": "flowIn", "type": "number" } + ] + }, + { + "tfOpName": "TensorArrayCloseV3", + "category": "control", + "inputs": [{ "start": 0, "name": "tensorArrayId", "type": "tensor" }] + }, + { + "tfOpName": "StatelessIf", + "category": "control", + "inputs": [ + { "start": 0, "name": "cond", "type": "tensor" }, + { "start": 1, "end": 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "then_branch", "name": "thenBranch", "type": "func" }, + { "tfName": "else_branch", "name": "elseBranch", "type": "func" } + ] + }, + { + "tfOpName": "If", + "category": "control", + "inputs": [ + { "start": 0, "name": "cond", "type": "tensor" }, + { "start": 1, "end": 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "then_branch", "name": "thenBranch", "type": "func" }, + { "tfName": "else_branch", "name": "elseBranch", "type": "func" } + ] + }, + { + "tfOpName": "StatelessWhile", + "category": "control", + "inputs": [ + { "start": 0, "end": 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "cond", "name": "cond", "type": "func" }, + { "tfName": "body", "name": "body", "type": "func" } + ] + }, + { + "tfOpName": "While", + "category": "control", + "inputs": [ + { "start": 0, "end": 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "cond", "name": "cond", "type": "func" }, + { "tfName": "body", "name": "body", "type": "func" } + ] + }, + { + "tfOpName": "TensorListScatter", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "number[]" }, + { "start": 2, "name": "elementShape", "type": "shape" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListScatterV2", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "number[]" }, + { "start": 2, "name": "elementShape", "type": "shape" }, + { "start": 3, "name": "numElements", "type": "number" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListGather", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "number[]" }, + { "start": 2, "name": "elementShape", "type": "shape" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListGetItem", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "index", "type": "number" }, + { "start": 2, "name": "elementShape", "type": "shape" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListSetItem", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "index", "type": "number" }, + { "start": 2, "name": "tensor", "type": "tensor" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListReserve", + "category": "control", + "inputs": [ + { "start": 0, "name": "elementShape", "type": "shape" }, + { "start": 1, "name": "numElements", "type": "number" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListFromTensor", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" }, + { "start": 1, "name": "elementShape", "type": "shape" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListStack", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "elementShape", "type": "shape" } + ], + "attrs": [ + { "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }, + { "tfName": "num_elements", "name": "numElements", "type": "dtype" } + ] + }, + { + "tfOpName": "TensorListSplit", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" }, + { "start": 1, "name": "elementShape", "type": "shape" }, + { "start": 2, "name": "lengths", "type": "number[]" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListConcat", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" } + ], + "attrs": [ + { "tfName": "element_shape", "name": "elementShape", "type": "shape" }, + { "tfName": "element_dtype", "name": "elementDType", "type": "dtype" } + ] + }, + { + "tfOpName": "TensorListPopBack", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "elementShape", "type": "shape" } + ], + "attrs": [{ "tfName": "element_dtype", "name": "elementDType", "type": "dtype" }] + }, + { + "tfOpName": "TensorListPushBack", + "category": "control", + "inputs": [ + { "start": 0, "name": "tensorListId", "type": "tensor" }, + { "start": 1, "name": "tensor", "type": "tensor" } + ], + "attrs": [ + { "tfName": "element_dtype", "name": "elementDType", "type": "dtype" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/convolution.js +var convolution_exports2 = {}; +__export(convolution_exports2, { + json: () => json23 +}); +var json23 = [ + { + "tfOpName": "AvgPool", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + }, + { "tfName": "ksize", "name": "kernelSize", "type": "number[]" }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "MaxPool", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + }, + { "tfName": "ksize", "name": "kernelSize", "type": "number[]" }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [], + "notSupported": true + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "MaxPoolWithArgmax", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { "tfName": "ksize", "name": "kernelSize", "type": "number[]" }, + { + "tfName": "include_batch_in_index", + "name": "includeBatchInIndex", + "type": "bool" + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "AvgPool3D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + }, + { "tfName": "ksize", "name": "kernelSize", "type": "number[]" }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "MaxPool3D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + }, + { "tfName": "ksize", "name": "kernelSize", "type": "number[]" }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Conv1D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "stride", "name": "stride", "type": "number" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NWC" + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { + "tfName": "dilation", + "name": "dilation", + "type": "number", + "defaultValue": 1 + } + ] + }, + { + "tfOpName": "Conv2D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { "tfName": "useCudnnOnGpu", "name": "useCudnnOnGpu", "type": "bool" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + }, + { "tfName": "dilations", "name": "dilations", "type": "number[]" } + ] + }, + { + "tfOpName": "_FusedConv2D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" }, + { "start": 2, end: 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "num_args", "name": "numArgs", "type": "number" }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + }, + { + "tfName": "use_cudnn_on_gpu", + "name": "useCudnnOnGpu", + "type": "bool", + "defaultValue": true + }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfName": "dilations", + "name": "dilations", + "type": "number[]", + "defaultValue": [1, 1, 1, 1] + }, + { + "tfName": "fused_ops", + "name": "fusedOps", + "type": "string[]", + "defaultValue": [] + }, + { + "tfName": "epsilon", + "name": "epsilon", + "type": "number", + "defaultValue": 1e-4 + }, + { + "tfName": "leakyrelu_alpha", + "name": "leakyreluAlpha", + "type": "number" + } + ] + }, + { + "tfOpName": "Conv2DBackpropInput", + "category": "convolution", + "inputs": [ + { "start": 2, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" }, + { "start": 0, "name": "outputShape", "type": "number[]" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + }, + { + "tfName": "dilations", + "name": "dilations", + "type": "number[]", + "notSupported": true + } + ] + }, + { + "tfOpName": "DepthwiseConv2d", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "input", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + }, + { "tfName": "dilations", "name": "dilations", "type": "number[]" } + ] + }, + { + "tfOpName": "DepthwiseConv2dNative", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "input", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + }, + { "tfName": "dilations", "name": "dilations", "type": "number[]" } + ] + }, + { + "tfOpName": "FusedDepthwiseConv2dNative", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" }, + { "start": 2, end: 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "num_args", "name": "numArgs", "type": "number" }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfName": "dilations", + "name": "dilations", + "type": "number[]", + "defaultValue": [1, 1, 1, 1] + }, + { + "tfName": "fused_ops", + "name": "fusedOps", + "type": "string[]", + "defaultValue": [] + }, + { + "tfName": "explicit_paddings", + "name": "explicitPaddings", + "type": "number[]", + "defaultValue": [] + } + ] + }, + { + "tfOpName": "Conv3D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { "tfName": "dilations", "name": "dilations", "type": "number[]" } + ] + }, + { + "tfOpName": "Dilation2D", + "category": "convolution", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "filter", "type": "tensor" } + ], + "attrs": [ + { "tfName": "strides", "name": "strides", "type": "number[]" }, + { "tfName": "rates", "name": "dilations", "type": "number[]" }, + { "tfName": "padding", "name": "pad", "type": "string" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/creation.js +var creation_exports2 = {}; +__export(creation_exports2, { + json: () => json24 +}); +var json24 = [ + { + "tfOpName": "Fill", + "category": "creation", + "inputs": [ + { "start": 0, "name": "shape", "type": "number[]" }, + { "start": 1, "name": "value", "type": "number" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "LinSpace", + "category": "creation", + "inputs": [ + { "start": 0, "name": "start", "type": "number" }, + { "start": 1, "name": "stop", "type": "number" }, + { "start": 2, "name": "num", "type": "number" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "OneHot", + "category": "creation", + "inputs": [ + { "start": 0, "name": "indices", "type": "tensor" }, + { "start": 1, "name": "depth", "type": "number" }, + { "start": 2, "name": "onValue", "type": "number", "defaultValue": 1 }, + { "start": 3, "name": "offValue", "type": "number", "defaultValue": 0 } + ], + "attrs": [ + { + "tfName": "axis", + "name": "axis", + "type": "number", + "notSupported": true + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Ones", + "category": "creation", + "inputs": [ + { "start": 0, "name": "shape", "type": "number[]" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "OnesLike", + "category": "creation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [{ "tfName": "dtype", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "RandomUniform", + "category": "creation", + "inputs": [ + { "start": 0, "name": "shape", "type": "number[]" } + ], + "attrs": [ + { + "tfName": "minval", + "name": "minval", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "maxval", + "name": "maxval", + "type": "number", + "defaultValue": 1 + }, + { "tfName": "dtype", "name": "dtype", "type": "dtype" }, + { "tfName": "seed", "name": "seed", "type": "number", "defaultValue": 0 }, + { + "tfName": "seed2", + "name": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { "tfName": "T", "name": "T", "type": "number", "notSupported": true } + ] + }, + { + "tfOpName": "Range", + "category": "creation", + "inputs": [ + { "start": 0, "name": "start", "type": "number" }, + { "start": 1, "name": "stop", "type": "number" }, + { "start": 2, "name": "step", "type": "number", "defaultValue": 0 } + ], + "attrs": [{ "tfName": "Tidx", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "TruncatedNormal", + "category": "creation", + "inputs": [ + { "start": 0, "name": "shape", "type": "number[]" } + ], + "attrs": [ + { + "tfName": "means", + "name": "mean", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "stddev", + "name": "stdDev", + "type": "number", + "defaultValue": 1 + }, + { "tfName": "seed", "name": "seed", "type": "number" }, + { + "tfName": "seed2", + "name": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { "tfName": "dtype", "name": "dtype", "type": "dtype" }, + { "tfName": "T", "name": "T", "type": "number", "notSupported": true } + ] + }, + { + "tfOpName": "Zeros", + "category": "creation", + "inputs": [ + { "start": 0, "name": "shape", "type": "number[]" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "ZerosLike", + "category": "creation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [{ "tfName": "T", "name": "dtype", "type": "dtype" }] + }, + { + "tfOpName": "Multinomial", + "category": "creation", + "inputs": [ + { "start": 0, "name": "logits", "type": "tensor" }, + { "start": 1, "name": "numSamples", "type": "number" } + ], + "attrs": [ + { "tfName": "seed", "name": "seed", "type": "number" }, + { "tfName": "seed2", "name": "seed2", "type": "number" }, + { "tfName": "T", "name": "dtype", "type": "dtype" }, + { "tfName": "output_dtype", "name": "output_dtype", "type": "dtype" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/dynamic.js +var dynamic_exports2 = {}; +__export(dynamic_exports2, { + json: () => json25 +}); +var json25 = [ + { + "tfOpName": "NonMaxSuppressionV2", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "boxes", "type": "tensor" }, + { "start": 1, "name": "scores", "type": "tensor" }, + { "start": 2, "name": "maxOutputSize", "type": "number" }, + { "start": 3, "name": "iouThreshold", "type": "number" } + ] + }, + { + "tfOpName": "NonMaxSuppressionV3", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "boxes", "type": "tensor" }, + { "start": 1, "name": "scores", "type": "tensor" }, + { "start": 2, "name": "maxOutputSize", "type": "number" }, + { "start": 3, "name": "iouThreshold", "type": "number" }, + { "start": 4, "name": "scoreThreshold", "type": "number" } + ] + }, + { + "tfOpName": "NonMaxSuppressionV4", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "boxes", "type": "tensor" }, + { "start": 1, "name": "scores", "type": "tensor" }, + { "start": 2, "name": "maxOutputSize", "type": "number" }, + { "start": 3, "name": "iouThreshold", "type": "number" }, + { "start": 4, "name": "scoreThreshold", "type": "number" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true }, + { + "tfName": "T_threshold", + "name": "threshold", + "type": "dtype", + "notSupported": true + }, + { + "tfName": "pad_to_max_output_size", + "name": "padToMaxOutputSize", + "type": "bool" + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV5", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "boxes", "type": "tensor" }, + { "start": 1, "name": "scores", "type": "tensor" }, + { "start": 2, "name": "maxOutputSize", "type": "number" }, + { "start": 3, "name": "iouThreshold", "type": "number" }, + { "start": 4, "name": "scoreThreshold", "type": "number" }, + { "start": 5, "name": "softNmsSigma", "type": "number" } + ] + }, + { + "tfOpName": "Where", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "condition", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "ListDiff", + "category": "dynamic", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "y", "type": "tensor" } + ], + "attrs": [{ + "tfName": "T", + "name": "dtype", + "type": "dtype", + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/evaluation.js +var evaluation_exports2 = {}; +__export(evaluation_exports2, { + json: () => json26 +}); +var json26 = [ + { + "tfOpName": "TopKV2", + "category": "evaluation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "k", "type": "number" } + ], + "attrs": [{ "tfName": "sorted", "name": "sorted", "type": "bool" }] + }, + { + "tfOpName": "Unique", + "category": "evaluation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ] + }, + { + "tfOpName": "UniqueV2", + "category": "evaluation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/graph.js +var graph_exports2 = {}; +__export(graph_exports2, { + json: () => json27 +}); +var json27 = [ + { + "tfOpName": "PlaceholderWithDefault", + "category": "graph", + "inputs": [ + { "start": 0, "name": "default", "type": "tensor" } + ], + "attrs": [ + { "tfName": "shape", "name": "shape", "type": "shape" }, + { "tfName": "dtype", "name": "dtype", "type": "dtype" } + ] + }, + { + "tfOpName": "Placeholder", + "category": "graph", + "attrs": [ + { "tfName": "shape", "name": "shape", "type": "shape" }, + { "tfName": "dtype", "name": "dtype", "type": "dtype" } + ] + }, + { "tfOpName": "Const", "category": "graph" }, + { + "tfOpName": "Identity", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "IdentityN", + "category": "graph", + "inputs": [{ "start": 0, "end": 0, "name": "x", "type": "tensors" }] + }, + { + "tfOpName": "Snapshot", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "Rank", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "Size", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "Shape", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "ShapeN", + "category": "graph", + "inputs": [{ "start": 0, "end": 0, "name": "x", "type": "tensors" }] + }, + { + "tfOpName": "Print", + "category": "graph", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "data", "type": "tensors" } + ], + "attrs": [ + { "tfName": "message", "name": "message", "type": "string" }, + { + "tfName": "first_n", + "name": "firstN", + "type": "number", + "notSupported": true + }, + { + "tfName": "summarize", + "name": "summarize", + "type": "number", + "defaultValue": 3 + } + ] + }, + { "tfOpName": "NoOp", "category": "graph", "inputs": [] }, + { + "tfOpName": "StopGradient", + "category": "graph", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "FakeQuantWithMinMaxVars", + "category": "graph", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "min", "name": "min", "type": "number" }, + { "tfName": "max", "name": "max", "type": "number" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/hash_table.js +var hash_table_exports2 = {}; +__export(hash_table_exports2, { + json: () => json28 +}); +var json28 = [ + { + "tfOpName": "HashTable", + "category": "hash_table", + "inputs": [], + "attrs": [ + { "tfName": "shared_name", "name": "sharedName", "type": "string" }, + { + "tfName": "use_node_name_sharing", + "name": "useNodeNameSharing", + "type": "bool" + }, + { "tfName": "key_dtype", "name": "keyDType", "type": "dtype" }, + { "tfName": "value_dtype", "name": "valueDType", "type": "dtype" } + ] + }, + { + "tfOpName": "HashTableV2", + "category": "hash_table", + "inputs": [], + "attrs": [ + { "tfName": "shared_name", "name": "sharedName", "type": "string" }, + { + "tfName": "use_node_name_sharing", + "name": "useNodeNameSharing", + "type": "bool" + }, + { "tfName": "key_dtype", "name": "keyDType", "type": "dtype" }, + { "tfName": "value_dtype", "name": "valueDType", "type": "dtype" } + ] + }, + { + "tfOpName": "LookupTableImport", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" }, + { "start": 1, "name": "keys", "type": "tensor" }, + { "start": 2, "name": "values", "type": "tensor" } + ], + "attrs": [ + { "tfName": "Tin", "name": "tIn", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "tOut", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LookupTableImportV2", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" }, + { "start": 1, "name": "keys", "type": "tensor" }, + { "start": 2, "name": "values", "type": "tensor" } + ], + "attrs": [ + { "tfName": "Tin", "name": "tIn", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "tOut", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LookupTableFind", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" }, + { "start": 1, "name": "keys", "type": "tensor" }, + { "start": 2, "name": "defaultValue", "type": "tensor" } + ], + "attrs": [ + { "tfName": "Tin", "name": "tIn", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "tOut", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LookupTableFindV2", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" }, + { "start": 1, "name": "keys", "type": "tensor" }, + { "start": 2, "name": "defaultValue", "type": "tensor" } + ], + "attrs": [ + { "tfName": "Tin", "name": "tIn", "type": "dtype", "notSupported": true }, + { + "tfName": "Tout", + "name": "tOut", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LookupTableSize", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" } + ] + }, + { + "tfOpName": "LookupTableSizeV2", + "category": "hash_table", + "inputs": [ + { "start": 0, "name": "tableHandle", "type": "tensor" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/image.js +var image_exports2 = {}; +__export(image_exports2, { + json: () => json29 +}); +var json29 = [ + { + "tfOpName": "ResizeBilinear", + "category": "image", + "inputs": [ + { "start": 0, "name": "images", "type": "tensor" }, + { "start": 1, "name": "size", "type": "number[]" } + ], + "attrs": [ + { "tfName": "align_corners", "name": "alignCorners", "type": "bool" }, + { + "tfName": "half_pixel_centers", + "name": "halfPixelCenters", + "type": "bool" + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "ResizeNearestNeighbor", + "category": "image", + "inputs": [ + { "start": 0, "name": "images", "type": "tensor" }, + { "start": 1, "name": "size", "type": "number[]" } + ], + "attrs": [ + { "tfName": "align_corners", "name": "alignCorners", "type": "bool" }, + { + "tfName": "half_pixel_centers", + "name": "halfPixelCenters", + "type": "bool" + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "CropAndResize", + "category": "image", + "inputs": [ + { "start": 0, "name": "image", "type": "tensor" }, + { "start": 1, "name": "boxes", "type": "tensor" }, + { "start": 2, "name": "boxInd", "type": "tensor" }, + { "start": 3, "name": "cropSize", "type": "number[]" } + ], + "attrs": [ + { "tfName": "method", "name": "method", "type": "string" }, + { + "tfName": "extrapolation_value", + "name": "extrapolationValue", + "type": "number" + } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/logical.js +var logical_exports2 = {}; +__export(logical_exports2, { + json: () => json30 +}); +var json30 = [ + { + "tfOpName": "Equal", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "NotEqual", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Greater", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "GreaterEqual", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Less", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "LessEqual", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "LogicalAnd", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "LogicalNot", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "LogicalOr", + "category": "logical", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Select", + "category": "logical", + "inputs": [ + { "start": 0, "name": "condition", "type": "tensor" }, + { "start": 1, "name": "a", "type": "tensor" }, + { "start": 2, "name": "b", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "SelectV2", + "category": "logical", + "inputs": [ + { "start": 0, "name": "condition", "type": "tensor" }, + { "start": 1, "name": "a", "type": "tensor" }, + { "start": 2, "name": "b", "type": "tensor" } + ], + "attrs": [{ + "tfName": "T", + "name": "dtype", + "type": "dtype", + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/matrices.js +var matrices_exports2 = {}; +__export(matrices_exports2, { + json: () => json31 +}); +var json31 = [ + { + "tfOpName": "_FusedMatMul", + "category": "matrices", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" }, + { "start": 2, end: 0, "name": "args", "type": "tensors" } + ], + "attrs": [ + { "tfName": "num_args", "name": "numArgs", "type": "number" }, + { + "tfName": "fused_ops", + "name": "fusedOps", + "type": "string[]", + "defaultValue": [] + }, + { + "tfName": "epsilon", + "name": "epsilon", + "type": "number", + "defaultValue": 1e-4 + }, + { + "tfName": "transpose_a", + "name": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfName": "transpose_b", + "name": "transposeB", + "type": "bool", + "defaultValue": false + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "MatMul", + "category": "matrices", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "transpose_a", + "name": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfName": "transpose_b", + "name": "transposeB", + "type": "bool", + "defaultValue": false + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "BatchMatMul", + "category": "matrices", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "adj_x", + "name": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfName": "adj_y", + "name": "transposeB", + "type": "bool", + "defaultValue": false + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "BatchMatMulV2", + "category": "matrices", + "inputs": [ + { "start": 0, "name": "a", "type": "tensor" }, + { "start": 1, "name": "b", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "adj_x", + "name": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfName": "adj_y", + "name": "transposeB", + "type": "bool", + "defaultValue": false + }, + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Transpose", + "category": "matrices", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "perm", "type": "number[]" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "Einsum", + "category": "matrices", + "inputs": [{ "start": 0, "end": 0, "name": "tensors", "type": "tensors" }], + "attrs": [ + { "tfName": "equation", "name": "equation", "type": "string" }, + { "tfName": "N", "name": "n", "type": "number", "defaultValue": 2 }, + { "tfName": "T", "name": "dtype", "type": "dtype" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/normalization.js +var normalization_exports2 = {}; +__export(normalization_exports2, { + json: () => json32 +}); +var json32 = [ + { + "tfOpName": "FusedBatchNorm", + "category": "normalization", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "scale", "type": "tensor" }, + { "start": 2, "name": "offset", "type": "tensor" }, + { "start": 3, "name": "mean", "type": "tensor" }, + { "start": 4, "name": "variance", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "epsilon", + "name": "epsilon", + "type": "number", + "defaultValue": 1e-3 + }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "FusedBatchNormV2", + "category": "normalization", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "scale", "type": "tensor" }, + { "start": 2, "name": "offset", "type": "tensor" }, + { "start": 3, "name": "mean", "type": "tensor" }, + { "start": 4, "name": "variance", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "epsilon", + "name": "epsilon", + "type": "number", + "defaultValue": 1e-3 + }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "FusedBatchNormV3", + "category": "normalization", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "scale", "type": "tensor" }, + { "start": 2, "name": "offset", "type": "tensor" }, + { "start": 3, "name": "mean", "type": "tensor" }, + { "start": 4, "name": "variance", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "epsilon", + "name": "epsilon", + "type": "number", + "defaultValue": 1e-3 + }, + { + "tfName": "data_format", + "name": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "LRN", + "category": "normalization", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "depth_radius", + "name": "radius", + "type": "number", + "defaultValue": 5 + }, + { "tfName": "bias", "name": "bias", "type": "number", "defaultValue": 1 }, + { + "tfName": "alpha", + "name": "alpha", + "type": "number", + "defaultValue": 1 + }, + { + "tfName": "beta", + "name": "beta", + "type": "number", + "defaultValue": 0.5 + } + ] + }, + { + "tfOpName": "Softmax", + "category": "normalization", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "LogSoftmax", + "category": "normalization", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "SparseToDense", + "category": "normalization", + "inputs": [ + { "start": 0, "name": "sparseIndices", "type": "tensor" }, + { "start": 1, "name": "outputShape", "type": "number[]" }, + { "start": 2, "name": "sparseValues", "type": "tensor" }, + { "start": 3, "name": "defaultValue", "type": "tensor" } + ], + "attrs": [{ + "tfName": "validate_indices", + "name": "validateIndices", + "type": "bool", + "defaultValue": true, + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/reduction.js +var reduction_exports2 = {}; +__export(reduction_exports2, { + json: () => json33 +}); +var json33 = [ + { + "tfOpName": "Bincount", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "size", "type": "number" }, + { "start": 2, "name": "weights", "type": "tensor" } + ] + }, + { + "tfOpName": "DenseBincount", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "size", "type": "number" }, + { "start": 2, "name": "weights", "type": "tensor" } + ], + "attrs": [{ "tfName": "binary_output", "name": "binaryOutput", "type": "bool" }] + }, + { + "tfOpName": "Max", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "Mean", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "Min", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "Sum", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "All", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "Any", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "ArgMax", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number" } + ] + }, + { + "tfOpName": "ArgMin", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number" } + ] + }, + { + "tfOpName": "Prod", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ], + "attrs": [{ "tfName": "keep_dims", "name": "keepDims", "type": "bool" }] + }, + { + "tfOpName": "Cumsum", + "category": "reduction", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number" } + ], + "attrs": [ + { "tfName": "exclusive", "name": "exclusive", "type": "bool" }, + { "tfName": "reverse", "name": "reverse", "type": "bool" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/slice_join.js +var slice_join_exports2 = {}; +__export(slice_join_exports2, { + json: () => json34 +}); +var json34 = [ + { + "tfOpName": "ConcatV2", + "category": "slice_join", + "inputs": [ + { "start": 0, "end": -1, "name": "tensors", "type": "tensors" }, + { "start": -1, "name": "axis", "type": "number" } + ], + "attrs": [{ "tfName": "N", "name": "n", "type": "number", "defaultValue": 2 }] + }, + { + "tfOpName": "Concat", + "category": "slice_join", + "inputs": [ + { "start": 1, "end": 0, "name": "tensors", "type": "tensors" }, + { "start": 0, "name": "axis", "type": "number" } + ], + "attrs": [{ "tfName": "N", "name": "n", "type": "number", "defaultValue": 2 }] + }, + { + "tfOpName": "GatherV2", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "tensor" }, + { "start": 2, "name": "axis", "type": "number", "defaultValue": 0 } + ], + "attrs": [{ + "tfName": "batch_dims", + "name": "batchDims", + "type": "number", + "defaultValue": 0 + }] + }, + { + "tfOpName": "Gather", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "tensor" } + ], + "attrs": [{ + "tfName": "validate_indices", + "name": "validateIndices", + "type": "bool", + "notSupported": true + }] + }, + { + "tfOpName": "Reverse", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "dims", "type": "bool[]" } + ] + }, + { + "tfOpName": "ReverseV2", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number[]" } + ] + }, + { + "tfOpName": "Slice", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "begin", "type": "number[]" }, + { "start": 2, "name": "size", "type": "number[]" } + ] + }, + { + "tfOpName": "StridedSlice", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "begin", "type": "number[]" }, + { "start": 2, "name": "end", "type": "number[]" }, + { "start": 3, "name": "strides", "type": "number[]" } + ], + "attrs": [ + { + "tfName": "begin_mask", + "name": "beginMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "end_mask", + "name": "endMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "new_axis_mask", + "name": "newAxisMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "ellipsis_mask", + "name": "ellipsisMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfName": "shrink_axis_mask", + "name": "shrinkAxisMask", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Pack", + "category": "slice_join", + "inputs": [ + { "start": 0, "end": 0, "name": "tensors", "type": "tensors" } + ], + "attrs": [ + { "tfName": "axis", "name": "axis", "type": "number", "defaultValue": 0 } + ] + }, + { + "tfOpName": "Unpack", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "tensor", "type": "tensor" } + ], + "attrs": [ + { "tfName": "axis", "name": "axis", "type": "number", "defaultValue": 0 }, + { + "tfName": "num", + "name": "num", + "type": "number", + "defaultValue": 0, + "notSupported": true + } + ] + }, + { + "tfOpName": "Tile", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "reps", "type": "number[]" } + ] + }, + { + "tfOpName": "Split", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "axis", "type": "number", "defaultValue": 0 }, + { "start": 1, "name": "x", "type": "tensor" } + ], + "attrs": [{ + "tfName": "num_split", + "name": "numOrSizeSplits", + "type": "number", + "defaultValue": 1 + }] + }, + { + "tfOpName": "SplitV", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "numOrSizeSplits", "type": "number[]" }, + { "start": 2, "name": "axis", "type": "number", "defaultValue": 0 } + ] + }, + { + "tfOpName": "ScatterNd", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "indices", "type": "tensor" }, + { "start": 1, "name": "values", "type": "tensor" }, + { "start": 2, "name": "shape", "type": "number[]" } + ] + }, + { + "tfOpName": "GatherNd", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "tensor" } + ] + }, + { + "tfOpName": "SparseToDense", + "category": "slice_join", + "inputs": [ + { "start": 0, "name": "sparseIndices", "type": "tensor" }, + { "start": 1, "name": "outputShape", "type": "number[]" }, + { "start": 2, "name": "sparseValues", "type": "tensor" }, + { "start": 3, "name": "defaultValue", "type": "tensor" } + ], + "attrs": [{ + "tfName": "validate_indices", + "name": "validateIndices", + "type": "bool", + "defaultValue": false, + "notSupported": true + }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/sparse.js +var sparse_exports2 = {}; +__export(sparse_exports2, { + json: () => json35 +}); +var json35 = [ + { + "tfOpName": "SparseFillEmptyRows", + "category": "sparse", + "inputs": [ + { "start": 0, "name": "indices", "type": "tensor" }, + { "start": 1, "name": "values", "type": "tensor" }, + { "start": 2, "name": "denseShape", "type": "tensor" }, + { "start": 3, "name": "defaultValue", "type": "tensor" } + ] + }, + { + "tfOpName": "SparseReshape", + "category": "sparse", + "inputs": [ + { "start": 0, "name": "inputIndices", "type": "tensor" }, + { "start": 1, "name": "inputShape", "type": "tensor" }, + { "start": 2, "name": "newShape", "type": "tensor" } + ], + "attrs": [ + { "tfName": "T", "name": "dtype", "type": "dtype", "notSupported": true } + ] + }, + { + "tfOpName": "SparseSegmentMean", + "category": "sparse", + "inputs": [ + { "start": 0, "name": "data", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "tensor" }, + { "start": 2, "name": "segmentIds", "type": "tensor" } + ] + }, + { + "tfOpName": "SparseSegmentSum", + "category": "sparse", + "inputs": [ + { "start": 0, "name": "data", "type": "tensor" }, + { "start": 1, "name": "indices", "type": "tensor" }, + { "start": 2, "name": "segmentIds", "type": "tensor" } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/spectral.js +var spectral_exports2 = {}; +__export(spectral_exports2, { + json: () => json36 +}); +var json36 = [ + { + "tfOpName": "FFT", + "category": "spectral", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "IFFT", + "category": "spectral", + "inputs": [{ "start": 0, "name": "x", "type": "tensor" }] + }, + { + "tfOpName": "RFFT", + "category": "spectral", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { + "start": 1, + "name": "fft_length", + "type": "number", + "notSupported": true + } + ] + }, + { + "tfOpName": "IRFFT", + "category": "spectral", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { + "start": 1, + "name": "fft_length", + "type": "number", + "notSupported": true + } + ] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/string.js +var string_exports2 = {}; +__export(string_exports2, { + json: () => json37 +}); +var json37 = [ + { + "tfOpName": "StringNGrams", + "category": "string", + "inputs": [ + { "start": 0, "name": "data", "type": "tensor" }, + { "start": 1, "name": "dataSplits", "type": "tensor" } + ], + "attrs": [ + { "tfName": "separator", "name": "separator", "type": "string" }, + { "tfName": "ngram_widths", "name": "nGramWidths", "type": "number[]" }, + { "tfName": "left_pad", "name": "leftPad", "type": "string" }, + { "tfName": "right_pad", "name": "rightPad", "type": "string" }, + { "tfName": "pad_width", "name": "padWidth", "type": "number" }, + { + "tfName": "preserve_short_sequences", + "name": "preserveShortSequences", + "type": "bool" + } + ], + "outputs": ["ngrams", "ngrams_splits"] + }, + { + "tfOpName": "StringSplit", + "category": "string", + "inputs": [ + { "start": 0, "name": "input", "type": "tensor" }, + { "start": 1, "name": "delimiter", "type": "tensor" } + ], + "attrs": [{ "tfName": "skip_empty", "name": "skipEmpty", "type": "bool" }], + "outputs": ["indices", "values", "shape"] + }, + { + "tfOpName": "StringToHashBucketFast", + "category": "string", + "inputs": [ + { "start": 0, "name": "input", "type": "tensor" } + ], + "attrs": [{ "tfName": "num_buckets", "name": "numBuckets", "type": "number" }] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/transformation.js +var transformation_exports2 = {}; +__export(transformation_exports2, { + json: () => json38 +}); +var json38 = [ + { + "tfOpName": "Cast", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { + "tfName": "SrcT", + "name": "sdtype", + "type": "dtype", + "notSupported": true + }, + { "tfName": "DstT", "name": "dtype", "type": "dtype" } + ] + }, + { + "tfOpName": "ExpandDims", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "axis", "type": "number" } + ] + }, + { + "tfOpName": "MirrorPad", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "padding", "type": "number[]" } + ], + "attrs": [{ "tfName": "mode", "name": "mode", "type": "string" }] + }, + { + "tfOpName": "Pad", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "padding", "type": "number[]" } + ], + "attrs": [{ + "tfName": "constant_value", + "name": "constantValue", + "type": "number", + "defaultValue": 0 + }] + }, + { + "tfOpName": "PadV2", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "padding", "type": "number[]" }, + { + "start": 2, + "name": "constantValue", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Reshape", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "shape", "type": "number[]" } + ] + }, + { + "tfOpName": "Squeeze", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [{ + "tfName": "axis", + "tfDeprecatedName": "squeeze_dims", + "name": "axis", + "type": "number[]" + }] + }, + { + "tfOpName": "SpaceToBatchND", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "blockShape", "type": "number[]" }, + { "start": 2, "name": "paddings", "type": "number[]" } + ] + }, + { + "tfOpName": "BatchToSpaceND", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "blockShape", "type": "number[]" }, + { "start": 2, "name": "crops", "type": "number[]" } + ] + }, + { + "tfOpName": "DepthToSpace", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" } + ], + "attrs": [ + { "tfName": "block_size", "name": "blockSize", "type": "number" }, + { "tfName": "data_format", "name": "dataFormat", "type": "string" } + ] + }, + { + "tfOpName": "BroadcastTo", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "x", "type": "tensor" }, + { "start": 1, "name": "shape", "type": "number[]" } + ], + "attrs": [] + }, + { + "tfOpName": "BroadcastArgs", + "category": "transformation", + "inputs": [ + { "start": 0, "name": "s0", "type": "tensor" }, + { "start": 1, "name": "s1", "type": "tensor" } + ], + "attrs": [] + } +]; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.js +var OperationMapper2 = class { + static get Instance() { + return this._instance || (this._instance = new this()); + } + constructor() { + const ops = [ + arithmetic_exports2, + basic_math_exports2, + control_exports2, + convolution_exports2, + creation_exports2, + dynamic_exports2, + evaluation_exports2, + graph_exports2, + hash_table_exports2, + image_exports2, + logical_exports2, + matrices_exports2, + normalization_exports2, + reduction_exports2, + slice_join_exports2, + sparse_exports2, + spectral_exports2, + string_exports2, + transformation_exports2 + ]; + const mappersJson = [].concat(...ops.map((op3) => op3.json)); + this.opMappers = mappersJson.reduce((map, mapper) => { + map[mapper.tfOpName] = mapper; + return map; + }, {}); + } + transformGraph(graph2, signature = {}) { + const tfNodes = graph2.node; + const placeholders = []; + const weights = []; + const initNodes = []; + const nodes = tfNodes.reduce((map, node2) => { + map[node2.name] = this.mapNode(node2); + if (node2.op.startsWith("Placeholder")) { + placeholders.push(map[node2.name]); + } else if (node2.op === "Const") { + weights.push(map[node2.name]); + } else if (node2.input == null || node2.input.length === 0) { + initNodes.push(map[node2.name]); + } + return map; + }, {}); + let inputs = []; + const outputs = []; + let inputNodeNameToKey = {}; + let outputNodeNameToKey = {}; + if (signature != null) { + inputNodeNameToKey = this.mapSignatureEntries(signature.inputs); + outputNodeNameToKey = this.mapSignatureEntries(signature.outputs); + } + const allNodes = Object.keys(nodes); + allNodes.forEach((key) => { + const node2 = nodes[key]; + node2.inputNames.forEach((name, index) => { + const [nodeName, , outputName] = getNodeNameAndIndex2(name); + const inputNode = nodes[nodeName]; + if (inputNode.outputs != null) { + const outputIndex = inputNode.outputs.indexOf(outputName); + if (outputIndex !== -1) { + const inputName = `${nodeName}:${outputIndex}`; + node2.inputNames[index] = inputName; + } + } + node2.inputs.push(inputNode); + inputNode.children.push(node2); + }); + }); + if (Object.keys(outputNodeNameToKey).length === 0) { + allNodes.forEach((key) => { + const node2 = nodes[key]; + if (node2.children.length === 0) { + outputs.push(node2); + } + }); + } else { + Object.keys(outputNodeNameToKey).forEach((name) => { + const [nodeName] = getNodeNameAndIndex2(name); + const node2 = nodes[nodeName]; + if (node2 != null) { + node2.signatureKey = outputNodeNameToKey[name]; + outputs.push(node2); + } + }); + } + if (Object.keys(inputNodeNameToKey).length > 0) { + Object.keys(inputNodeNameToKey).forEach((name) => { + const [nodeName] = getNodeNameAndIndex2(name); + const node2 = nodes[nodeName]; + if (node2) { + node2.signatureKey = inputNodeNameToKey[name]; + inputs.push(node2); + } + }); + } else { + inputs = placeholders; + } + let functions = {}; + if (graph2.library != null && graph2.library.function != null) { + functions = graph2.library.function.reduce((functions2, func3) => { + functions2[func3.signature.name] = this.mapFunction(func3); + return functions2; + }, {}); + } + const result = { nodes, inputs, outputs, weights, placeholders, signature, functions }; + if (initNodes.length > 0) { + result.initNodes = initNodes; + } + return result; + } + mapSignatureEntries(entries) { + return Object.keys(entries || {}).reduce((prev, curr) => { + prev[entries[curr].name] = curr; + return prev; + }, {}); + } + mapNode(node2) { + const mapper = getRegisteredOp2(node2.op) || this.opMappers[node2.op] || {}; + if (node2.attr == null) { + node2.attr = {}; + } + const newNode = { + name: node2.name, + op: node2.op, + category: mapper.category, + inputNames: (node2.input || []).map((input3) => input3.startsWith("^") ? input3.substr(1) : input3), + inputs: [], + children: [], + inputParams: {}, + attrParams: {}, + rawAttrs: node2.attr, + outputs: mapper.outputs + }; + if (mapper.inputs != null) { + newNode.inputParams = mapper.inputs.reduce((map, param) => { + map[param.name] = { + type: param.type, + inputIndexStart: param.start, + inputIndexEnd: param.end + }; + return map; + }, {}); + } + if (mapper.attrs != null) { + newNode.attrParams = mapper.attrs.reduce((map, param) => { + const type = param.type; + let value = void 0; + switch (param.type) { + case "string": + value = getStringParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getStringParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "string[]": + value = getStringArrayParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getStringArrayParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "number": + value = getNumberParam2(node2.attr, param.tfName, param.defaultValue || 0); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getNumberParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "number[]": + value = getNumericArrayParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getNumericArrayParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "bool": + value = getBoolParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getBoolParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "bool[]": + value = getBoolArrayParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getBoolArrayParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "shape": + value = getTensorShapeParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getTensorShapeParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "shape[]": + value = getTensorShapeArrayParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getTensorShapeArrayParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "dtype": + value = getDtypeParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getDtypeParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "dtype[]": + value = getDtypeArrayParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getDtypeArrayParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "func": + value = getFuncParam2(node2.attr, param.tfName, param.defaultValue); + if (value === void 0 && !!param.tfDeprecatedName) { + value = getFuncParam2(node2.attr, param.tfDeprecatedName, param.defaultValue); + } + break; + case "tensor": + case "tensors": + break; + default: + throw new Error(`Unsupported param type: ${param.type} for op: ${node2.op}`); + } + map[param.name] = { value, type }; + return map; + }, {}); + } + return newNode; + } + mapFunction(functionDef) { + const tfNodes = functionDef.nodeDef; + const placeholders = []; + const weights = []; + let nodes = {}; + if (tfNodes != null) { + nodes = tfNodes.reduce((map, node2) => { + map[node2.name] = this.mapNode(node2); + if (node2.op === "Const") { + weights.push(map[node2.name]); + } + return map; + }, {}); + } + const inputs = []; + const outputs = []; + functionDef.signature.inputArg.forEach((arg) => { + const [nodeName] = getNodeNameAndIndex2(arg.name); + const node2 = { + name: nodeName, + op: "Placeholder", + inputs: [], + inputNames: [], + category: "graph", + inputParams: {}, + attrParams: { dtype: { value: parseDtypeParam2(arg.type), type: "dtype" } }, + children: [] + }; + node2.signatureKey = arg.name; + inputs.push(node2); + nodes[nodeName] = node2; + }); + const allNodes = Object.keys(nodes); + allNodes.forEach((key) => { + const node2 = nodes[key]; + node2.inputNames.forEach((name, index) => { + const [nodeName, , outputName] = getNodeNameAndIndex2(name); + const inputNode = nodes[nodeName]; + if (inputNode.outputs != null) { + const outputIndex = inputNode.outputs.indexOf(outputName); + if (outputIndex !== -1) { + const inputName = `${nodeName}:${outputIndex}`; + node2.inputNames[index] = inputName; + } + } + node2.inputs.push(inputNode); + inputNode.children.push(node2); + }); + }); + const returnNodeMap = functionDef.ret; + functionDef.signature.outputArg.forEach((output) => { + const [nodeName, index] = getNodeNameAndIndex2(returnNodeMap[output.name]); + const node2 = nodes[nodeName]; + if (node2 != null) { + node2.defaultOutput = index; + outputs.push(node2); + } + }); + const signature = this.mapArgsToSignature(functionDef); + return { nodes, inputs, outputs, weights, placeholders, signature }; + } + mapArgsToSignature(functionDef) { + return { + methodName: functionDef.signature.name, + inputs: functionDef.signature.inputArg.reduce((map, arg) => { + map[arg.name] = this.mapArgToTensorInfo(arg); + return map; + }, {}), + outputs: functionDef.signature.outputArg.reduce((map, arg) => { + map[arg.name] = this.mapArgToTensorInfo(arg, functionDef.ret); + return map; + }, {}) + }; + } + mapArgToTensorInfo(arg, nameMap3) { + let name = arg.name; + if (nameMap3 != null) { + name = nameMap3[name]; + } + return { name, dtype: arg.type }; + } +}; +function decodeBase642(text) { + const global2 = env3().global; + if (typeof global2.atob !== "undefined") { + return global2.atob(text); + } else if (typeof Buffer !== "undefined") { + return new Buffer(text, "base64").toString(); + } else { + throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()"); + } +} +function parseStringParam2(s, keepCase) { + const value = Array.isArray(s) ? String.fromCharCode.apply(null, s) : decodeBase642(s); + return keepCase ? value : value.toLowerCase(); +} +function getStringParam2(attrs, name, def, keepCase = false) { + const param = attrs[name]; + if (param != null) { + return parseStringParam2(param.s, keepCase); + } + return def; +} +function getBoolParam2(attrs, name, def) { + const param = attrs[name]; + return param ? param.b : def; +} +function getNumberParam2(attrs, name, def) { + const param = attrs[name] || {}; + const value = param["i"] != null ? param["i"] : param["f"] != null ? param["f"] : def; + return typeof value === "number" ? value : parseInt(value, 10); +} +function parseDtypeParam2(value) { + if (typeof value === "string") { + value = DataType2[value]; + } + switch (value) { + case DataType2.DT_FLOAT: + return "float32"; + case DataType2.DT_INT32: + case DataType2.DT_INT64: + case DataType2.DT_INT8: + case DataType2.DT_UINT8: + return "int32"; + case DataType2.DT_BOOL: + return "bool"; + case DataType2.DT_DOUBLE: + return "float32"; + case DataType2.DT_STRING: + return "string"; + default: + return null; + } +} +function getFuncParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.func) { + return param.func.name; + } + return def; +} +function getDtypeParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.type) { + return parseDtypeParam2(param.type); + } + return def; +} +function getDtypeArrayParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.list && param.list.type) { + return param.list.type.map((v) => parseDtypeParam2(v)); + } + return def; +} +function parseTensorShapeParam2(shape) { + if (shape.unknownRank) { + return void 0; + } + if (shape.dim != null) { + return shape.dim.map((dim) => typeof dim.size === "number" ? dim.size : parseInt(dim.size, 10)); + } + return []; +} +function getTensorShapeParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.shape) { + return parseTensorShapeParam2(param.shape); + } + return def; +} +function getNumericArrayParam2(attrs, name, def) { + const param = attrs[name]; + if (param) { + return ((param.list.f && param.list.f.length ? param.list.f : param.list.i) || []).map((v) => typeof v === "number" ? v : parseInt(v, 10)); + } + return def; +} +function getStringArrayParam2(attrs, name, def, keepCase = false) { + const param = attrs[name]; + if (param && param.list && param.list.s) { + return param.list.s.map((v) => { + return parseStringParam2(v, keepCase); + }); + } + return def; +} +function getTensorShapeArrayParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.list && param.list.shape) { + return param.list.shape.map((v) => { + return parseTensorShapeParam2(v); + }); + } + return def; +} +function getBoolArrayParam2(attrs, name, def) { + const param = attrs[name]; + if (param && param.list && param.list.b) { + return param.list.b; + } + return def; +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/custom_op/node_value_impl.js +var NodeValueImpl2 = class { + constructor(node2, tensorMap, context) { + this.node = node2; + this.tensorMap = tensorMap; + this.context = context; + this.inputs = []; + this.attrs = {}; + this.inputs = node2.inputNames.map((name) => this.getInput(name)); + if (node2.rawAttrs != null) { + this.attrs = Object.keys(node2.rawAttrs).reduce((attrs, key) => { + attrs[key] = this.getAttr(key); + return attrs; + }, {}); + } + } + getInput(name) { + return getTensor2(name, this.tensorMap, this.context); + } + getAttr(name, defaultValue) { + const value = this.node.rawAttrs[name]; + if (value.tensor != null) { + return getTensor2(name, this.tensorMap, this.context); + } + if (value.i != null || value.f != null) { + return getNumberParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.s != null) { + return getStringParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.b != null) { + return getBoolParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.shape != null) { + return getTensorShapeParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.type != null) { + return getDtypeParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.list != null) { + if (value.list.i != null || value.list.f != null) { + return getNumericArrayParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.list.s != null) { + return getStringArrayParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.list.shape != null) { + return getTensorShapeArrayParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.list.b != null) { + return getBoolArrayParam2(this.node.rawAttrs, name, defaultValue); + } + if (value.list.type != null) { + return getDtypeArrayParam2(this.node.rawAttrs, name, defaultValue); + } + } + return defaultValue; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.js +var executeOp21 = (node2, tensorMap, context) => { + switch (node2.op) { + case "BiasAdd": + case "AddV2": + case "Add": { + return [add6(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "AddN": { + return [addN4(getParamValue2("tensors", node2, tensorMap, context))]; + } + case "FloorMod": + case "Mod": + return [mod4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + case "Mul": + return [mul2(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + case "RealDiv": + case "Div": { + return [div3(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "DivNoNan": { + return [divNoNan2(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "FloorDiv": { + return [floorDiv4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Sub": { + return [sub4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Minimum": { + return [minimum5(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Maximum": { + return [maximum5(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Pow": { + return [pow4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "SquaredDifference": { + return [squaredDifference4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.js +var executeOp22 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Abs": + case "ComplexAbs": + return [abs4(getParamValue2("x", node2, tensorMap, context))]; + case "Acos": + return [acos4(getParamValue2("x", node2, tensorMap, context))]; + case "Acosh": + return [acosh4(getParamValue2("x", node2, tensorMap, context))]; + case "Asin": + return [asin4(getParamValue2("x", node2, tensorMap, context))]; + case "Asinh": + return [asinh4(getParamValue2("x", node2, tensorMap, context))]; + case "Atan": + return [atan5(getParamValue2("x", node2, tensorMap, context))]; + case "Atan2": + return [atan24(getParamValue2("x", node2, tensorMap, context), getParamValue2("y", node2, tensorMap, context))]; + case "Atanh": + return [atanh4(getParamValue2("x", node2, tensorMap, context))]; + case "Ceil": + return [ceil4(getParamValue2("x", node2, tensorMap, context))]; + case "Complex": + return [complex4(getParamValue2("real", node2, tensorMap, context), getParamValue2("imag", node2, tensorMap, context))]; + case "Cos": + return [cos4(getParamValue2("x", node2, tensorMap, context))]; + case "Cosh": + return [cosh4(getParamValue2("x", node2, tensorMap, context))]; + case "Elu": + return [elu6(getParamValue2("x", node2, tensorMap, context))]; + case "Erf": + return [erf4(getParamValue2("x", node2, tensorMap, context))]; + case "Exp": + return [exp4(getParamValue2("x", node2, tensorMap, context))]; + case "Expm1": { + return [expm14(getParamValue2("x", node2, tensorMap, context))]; + } + case "Floor": + return [floor4(getParamValue2("x", node2, tensorMap, context))]; + case "Log": + return [log10(getParamValue2("x", node2, tensorMap, context))]; + case "Log1p": { + return [log1p4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Imag": + return [imag4(getParamValue2("x", node2, tensorMap, context))]; + case "Neg": + return [neg4(getParamValue2("x", node2, tensorMap, context))]; + case "Reciprocal": { + return [reciprocal4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Real": + return [real4(getParamValue2("x", node2, tensorMap, context))]; + case "Relu": + return [relu4(getParamValue2("x", node2, tensorMap, context))]; + case "Round": { + return [round6(getParamValue2("x", node2, tensorMap, context))]; + } + case "Selu": + return [selu4(getParamValue2("x", node2, tensorMap, context))]; + case "Sigmoid": + return [sigmoid5(getParamValue2("x", node2, tensorMap, context))]; + case "Sin": + return [sin4(getParamValue2("x", node2, tensorMap, context))]; + case "Sign": { + return [sign4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Sinh": { + return [sinh4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Softplus": { + return [softplus4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Sqrt": { + return [sqrt4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Square": { + return [square4(getParamValue2("x", node2, tensorMap, context))]; + } + case "Tanh": { + return [tanh6(getParamValue2("x", node2, tensorMap, context))]; + } + case "Tan": + return [tan4(getParamValue2("x", node2, tensorMap, context))]; + case "ClipByValue": + return [clipByValue3(getParamValue2("x", node2, tensorMap, context), getParamValue2("clipValueMin", node2, tensorMap, context), getParamValue2("clipValueMax", node2, tensorMap, context))]; + case "Relu6": + return [relu64(getParamValue2("x", node2, tensorMap, context))]; + case "Rsqrt": + return [rsqrt4(getTensor2(node2.inputNames[0], tensorMap, context))]; + case "Prod": + return [prod5(getParamValue2("x", node2, tensorMap, context), getParamValue2("axes", node2, tensorMap, context))]; + case "LeakyRelu": + return [leakyRelu5(getParamValue2("x", node2, tensorMap, context), getParamValue2("alpha", node2, tensorMap, context))]; + case "Prelu": + return [prelu6(getParamValue2("x", node2, tensorMap, context), getParamValue2("alpha", node2, tensorMap, context))]; + case "IsNan": + return [isNaN5(getTensor2(node2.inputNames[0], tensorMap, context))]; + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_utils.js +function assertShapesMatchAllowUndefinedSize2(shapeA, shapeB, errorMessagePrefix = "") { + if (typeof shapeA === "number" || typeof shapeB === "number") { + return; + } + util_exports2.assert(shapeA.length === shapeB.length, () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); + for (let i = 0; i < shapeA.length; i++) { + const dim0 = shapeA[i]; + const dim1 = shapeB[i]; + util_exports2.assert(dim0 < 0 || dim1 < 0 || dim0 === dim1, () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); + } +} +function fullDefinedShape2(elementShape) { + if (typeof elementShape === "number" || elementShape.some((dim) => dim < 0)) { + return false; + } + return true; +} +function inferElementShape2(listElementShape, tensors, elementShape) { + let partialShape = mergeElementShape2(listElementShape, elementShape); + const notfullDefinedShape = !fullDefinedShape2(partialShape); + if (notfullDefinedShape && tensors.length === 0) { + throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${partialShape}`); + } + if (notfullDefinedShape) { + tensors.forEach((tensor3) => { + partialShape = mergeElementShape2(tensor3.shape, partialShape); + }); + } + if (!fullDefinedShape2(partialShape)) { + throw new Error(`Non-fully-defined elementShape: ${partialShape}`); + } + return partialShape; +} +function mergeElementShape2(elementShapeA, elementShapeB) { + if (typeof elementShapeA === "number") { + return elementShapeB; + } + if (typeof elementShapeB === "number") { + return elementShapeA; + } + if (elementShapeA.length !== elementShapeB.length) { + throw new Error(`Incompatible ranks during merge: ${elementShapeA} vs. ${elementShapeB}`); + } + const result = []; + for (let i = 0; i < elementShapeA.length; ++i) { + const dim0 = elementShapeA[i]; + const dim1 = elementShapeB[i]; + if (dim0 >= 0 && dim1 >= 0 && dim0 !== dim1) { + throw new Error(`Incompatible shape during merge: ${elementShapeA} vs. ${elementShapeB}`); + } + result[i] = dim0 >= 0 ? dim0 : dim1; + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.js +var TensorArray2 = class { + constructor(name, dtype, maxSize2, elementShape, identicalElementShapes, dynamicSize, clearAfterRead) { + this.name = name; + this.dtype = dtype; + this.maxSize = maxSize2; + this.elementShape = elementShape; + this.identicalElementShapes = identicalElementShapes; + this.dynamicSize = dynamicSize; + this.clearAfterRead = clearAfterRead; + this.tensors = []; + this.closed_ = false; + this.idTensor = scalar2(0); + keep2(this.idTensor); + } + get id() { + return this.idTensor.id; + } + get closed() { + return this.closed_; + } + clearAndClose(keepIds) { + this.tensors.forEach((tensor3) => { + if (keepIds == null || !keepIds.has(tensor3.tensor.id)) { + tensor3.tensor.dispose(); + } + }); + this.tensors = []; + this.closed_ = true; + this.idTensor.dispose(); + } + size() { + return this.tensors.length; + } + read(index) { + if (this.closed_) { + throw new Error(`TensorArray ${this.name} has already been closed.`); + } + if (index < 0 || index >= this.size()) { + throw new Error(`Tried to read from index ${index}, but array size is: ${this.size()}`); + } + const tensorWithState = this.tensors[index]; + if (tensorWithState.cleared) { + throw new Error(`TensorArray ${this.name}: Could not read index ${index} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`); + } + if (this.clearAfterRead) { + tensorWithState.cleared = true; + } + tensorWithState.read = true; + return tensorWithState.tensor; + } + readMany(indices) { + return indices.map((index) => this.read(index)); + } + write(index, tensor3) { + if (this.closed_) { + throw new Error(`TensorArray ${this.name} has already been closed.`); + } + if (index < 0 || !this.dynamicSize && index >= this.maxSize) { + throw new Error(`Tried to write to index ${index}, but array is not resizeable and size is: ${this.maxSize}`); + } + const t = this.tensors[index] || {}; + if (tensor3.dtype !== this.dtype) { + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, + because the value dtype is ${tensor3.dtype}, but TensorArray dtype is ${this.dtype}.`); + } + if (this.size() === 0 && (this.elementShape == null || this.elementShape.length === 0)) { + this.elementShape = tensor3.shape; + } + assertShapesMatchAllowUndefinedSize2(this.elementShape, tensor3.shape, `TensorArray ${this.name}: Could not write to TensorArray index ${index}.`); + if (t.read) { + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, because it has already been read.`); + } + if (t.written) { + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${index}, because it has already been written.`); + } + t.tensor = tensor3; + keep2(tensor3); + t.written = true; + this.tensors[index] = t; + } + writeMany(indices, tensors) { + if (indices.length !== tensors.length) { + throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${indices.length} is not the same as tensors size: ${tensors.length}.`); + } + indices.forEach((i, index) => this.write(i, tensors[index])); + } + gather(indices, dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${dtype}`); + } + if (!indices) { + indices = []; + for (let i = 0; i < this.size(); i++) { + indices.push(i); + } + } else { + indices = indices.slice(0, this.size()); + } + if (indices.length === 0) { + return tensor2([], [0].concat(this.elementShape)); + } + const tensors = this.readMany(indices); + assertShapesMatchAllowUndefinedSize2(this.elementShape, tensors[0].shape, "TensorArray shape mismatch: "); + return stack2(tensors, 0); + } + concat(dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${dtype}`); + } + if (this.size() === 0) { + return tensor2([], [0].concat(this.elementShape)); + } + const indices = []; + for (let i = 0; i < this.size(); i++) { + indices.push(i); + } + const tensors = this.readMany(indices); + assertShapesMatchAllowUndefinedSize2(this.elementShape, tensors[0].shape, `TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${tensors[0].shape})`); + return concat5(tensors, 0); + } + scatter(indices, tensor3) { + if (tensor3.dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor3.dtype}`); + } + if (indices.length !== tensor3.shape[0]) { + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor3.shape[0]}`); + } + const maxIndex = Math.max(...indices); + if (!this.dynamicSize && maxIndex >= this.maxSize) { + throw new Error(`Max index must be < array size (${maxIndex} vs. ${this.maxSize})`); + } + this.writeMany(indices, unstack2(tensor3, 0)); + } + split(length, tensor3) { + if (tensor3.dtype !== this.dtype) { + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${tensor3.dtype}`); + } + let totalLength = 0; + const cumulativeLengths = length.map((len) => { + totalLength += len; + return totalLength; + }); + if (totalLength !== tensor3.shape[0]) { + throw new Error(`Expected sum of lengths to be equal to + tensor.shape[0], but sum of lengths is + ${totalLength}, and tensor's shape is: ${tensor3.shape}`); + } + if (!this.dynamicSize && length.length !== this.maxSize) { + throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${length.length}), and the TensorArray is not marked as dynamically resizeable`); + } + const elementPerRow = totalLength === 0 ? 0 : tensor3.size / totalLength; + const tensors = []; + tidy2(() => { + tensor3 = reshape6(tensor3, [1, totalLength, elementPerRow]); + for (let i = 0; i < length.length; ++i) { + const previousLength = i === 0 ? 0 : cumulativeLengths[i - 1]; + const indices2 = [0, previousLength, 0]; + const sizes = [1, length[i], elementPerRow]; + tensors[i] = reshape6(slice5(tensor3, indices2, sizes), this.elementShape); + } + return tensors; + }); + const indices = []; + for (let i = 0; i < length.length; i++) { + indices[i] = i; + } + this.writeMany(indices, tensors); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_list.js +var TensorList2 = class { + constructor(tensors, elementShape, elementDtype, maxNumElements = -1) { + this.tensors = tensors; + this.elementShape = elementShape; + this.elementDtype = elementDtype; + if (tensors != null) { + tensors.forEach((tensor3) => { + if (elementDtype !== tensor3.dtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${tensor3.dtype}`); + } + assertShapesMatchAllowUndefinedSize2(elementShape, tensor3.shape, "TensorList shape mismatch: "); + keep2(tensor3); + }); + } + this.idTensor = scalar2(0); + this.maxNumElements = maxNumElements; + keep2(this.idTensor); + } + get id() { + return this.idTensor.id; + } + copy() { + return new TensorList2([...this.tensors], this.elementShape, this.elementDtype); + } + clearAndClose(keepIds) { + this.tensors.forEach((tensor3) => { + if (keepIds == null || !keepIds.has(tensor3.id)) { + tensor3.dispose(); + } + }); + this.tensors.length = 0; + this.idTensor.dispose(); + } + size() { + return this.tensors.length; + } + stack(elementShape, elementDtype, numElements = -1) { + if (elementDtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`); + } + if (numElements !== -1 && this.tensors.length !== numElements) { + throw new Error(`Operation expected a list with ${numElements} elements but got a list with ${this.tensors.length} elements.`); + } + assertShapesMatchAllowUndefinedSize2(elementShape, this.elementShape, "TensorList shape mismatch: "); + const outputElementShape = inferElementShape2(this.elementShape, this.tensors, elementShape); + return tidy2(() => { + const reshapedTensors = this.tensors.map((tensor3) => reshape6(tensor3, outputElementShape)); + return stack2(reshapedTensors, 0); + }); + } + popBack(elementShape, elementDtype) { + if (elementDtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`); + } + if (this.size() === 0) { + throw new Error("Trying to pop from an empty list."); + } + const outputElementShape = inferElementShape2(this.elementShape, this.tensors, elementShape); + const tensor3 = this.tensors.pop(); + assertShapesMatchAllowUndefinedSize2(tensor3.shape, elementShape, "TensorList shape mismatch: "); + return reshape6(tensor3, outputElementShape); + } + pushBack(tensor3) { + if (tensor3.dtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor3.dtype}, but list elements ${this.elementDtype}`); + } + assertShapesMatchAllowUndefinedSize2(tensor3.shape, this.elementShape, "TensorList shape mismatch: "); + if (this.maxNumElements === this.size()) { + throw new Error(`Trying to push element into a full list.`); + } + keep2(tensor3); + this.tensors.push(tensor3); + } + resize(size2) { + if (size2 < 0) { + throw new Error(`TensorListResize expects size to be non-negative. Got: ${size2}`); + } + if (this.maxNumElements !== -1 && size2 > this.maxNumElements) { + throw new Error(`TensorListResize input size ${size2} is greater maxNumElement ${this.maxNumElements}.`); + } + this.tensors.length = size2; + } + getItem(elementIndex, elementShape, elementDtype) { + if (elementDtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`); + } + if (elementIndex < 0 || elementIndex > this.tensors.length) { + throw new Error(`Trying to access element ${elementIndex} in a list with ${this.tensors.length} elements.`); + } + if (this.tensors[elementIndex] == null) { + throw new Error(`element at index ${elementIndex} is null.`); + } + assertShapesMatchAllowUndefinedSize2(this.tensors[elementIndex].shape, elementShape, "TensorList shape mismatch: "); + const outputElementShape = inferElementShape2(this.elementShape, this.tensors, elementShape); + return reshape6(this.tensors[elementIndex], outputElementShape); + } + setItem(elementIndex, tensor3) { + if (tensor3.dtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor3.dtype}, but list elements ${this.elementDtype}`); + } + if (elementIndex < 0 || this.maxNumElements !== -1 && elementIndex >= this.maxNumElements) { + throw new Error(`Trying to set element ${elementIndex} in a list with max ${this.maxNumElements} elements.`); + } + assertShapesMatchAllowUndefinedSize2(this.elementShape, tensor3.shape, "TensorList shape mismatch: "); + keep2(tensor3); + this.tensors[elementIndex] = tensor3; + } + gather(indices, elementDtype, elementShape) { + if (elementDtype !== this.elementDtype) { + throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`); + } + assertShapesMatchAllowUndefinedSize2(this.elementShape, elementShape, "TensorList shape mismatch: "); + indices = indices.slice(0, this.size()); + const outputElementShape = inferElementShape2(this.elementShape, this.tensors, elementShape); + if (indices.length === 0) { + return tensor2([], [0].concat(outputElementShape)); + } + return tidy2(() => { + const tensors = indices.map((i) => reshape6(this.tensors[i], outputElementShape)); + return stack2(tensors, 0); + }); + } + concat(elementDtype, elementShape) { + if (!!elementDtype && elementDtype !== this.elementDtype) { + throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${elementDtype}`); + } + assertShapesMatchAllowUndefinedSize2(this.elementShape, elementShape, "TensorList shape mismatch: "); + const outputElementShape = inferElementShape2(this.elementShape, this.tensors, elementShape); + if (this.size() === 0) { + return tensor2([], [0].concat(outputElementShape)); + } + return tidy2(() => { + const tensors = this.tensors.map((t) => reshape6(t, outputElementShape)); + return concat5(tensors, 0); + }); + } +}; +function fromTensor2(tensor3, elementShape, elementDtype) { + const dtype = tensor3.dtype; + if (tensor3.shape.length < 1) { + throw new Error(`Tensor must be at least a vector, but saw shape: ${tensor3.shape}`); + } + if (tensor3.dtype !== elementDtype) { + throw new Error(`Invalid data types; op elements ${tensor3.dtype}, but list elements ${elementDtype}`); + } + const tensorElementShape = tensor3.shape.slice(1); + assertShapesMatchAllowUndefinedSize2(tensorElementShape, elementShape, "TensorList shape mismatch: "); + const tensorList = unstack2(tensor3); + return new TensorList2(tensorList, elementShape, dtype); +} +function reserve2(elementShape, elementDtype, numElements) { + return new TensorList2([], elementShape, elementDtype, numElements); +} +function scatter2(tensor3, indices, elementShape, numElements) { + if (indices.length !== tensor3.shape[0]) { + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${indices.length} vs. ${tensor3.shape[0]}`); + } + const maxIndex = Math.max(...indices); + if (numElements != null && numElements !== -1 && maxIndex >= numElements) { + throw new Error(`Max index must be < array size (${maxIndex} vs. ${numElements})`); + } + const list = new TensorList2([], elementShape, tensor3.dtype, numElements); + const tensors = unstack2(tensor3, 0); + indices.forEach((value, index) => { + list.setItem(value, tensors[index]); + }); + return list; +} +function split5(tensor3, length, elementShape) { + let totalLength = 0; + const cumulativeLengths = length.map((len) => { + totalLength += len; + return totalLength; + }); + if (totalLength !== tensor3.shape[0]) { + throw new Error(`Expected sum of lengths to be equal to + tensor.shape[0], but sum of lengths is + ${totalLength}, and tensor's shape is: ${tensor3.shape}`); + } + const shapeWithoutFirstDim = tensor3.shape.slice(1); + const outputElementShape = mergeElementShape2(shapeWithoutFirstDim, elementShape); + const elementPerRow = totalLength === 0 ? 0 : tensor3.size / totalLength; + const tensors = tidy2(() => { + const tensors2 = []; + tensor3 = reshape6(tensor3, [1, totalLength, elementPerRow]); + for (let i = 0; i < length.length; ++i) { + const previousLength = i === 0 ? 0 : cumulativeLengths[i - 1]; + const indices = [0, previousLength, 0]; + const sizes = [1, length[i], elementPerRow]; + tensors2[i] = reshape6(slice5(tensor3, indices, sizes), outputElementShape); + } + tensor3.dispose(); + return tensors2; + }); + const list = new TensorList2([], elementShape, tensor3.dtype, length.length); + for (let i = 0; i < tensors.length; i++) { + list.setItem(i, tensors[i]); + } + return list; +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.js +var executeOp23 = async (node2, tensorMap, context) => { + switch (node2.op) { + case "If": + case "StatelessIf": { + const thenFunc = getParamValue2("thenBranch", node2, tensorMap, context); + const elseFunc = getParamValue2("elseBranch", node2, tensorMap, context); + const cond = getParamValue2("cond", node2, tensorMap, context); + const args = getParamValue2("args", node2, tensorMap, context); + const condValue = await cond.data(); + if (condValue[0]) { + return context.functionMap[thenFunc].executeFunctionAsync(args, context.tensorArrayMap, context.tensorListMap); + } else { + return context.functionMap[elseFunc].executeFunctionAsync(args, context.tensorArrayMap, context.tensorListMap); + } + } + case "While": + case "StatelessWhile": { + const bodyFunc = getParamValue2("body", node2, tensorMap, context); + const condFunc = getParamValue2("cond", node2, tensorMap, context); + const args = getParamValue2("args", node2, tensorMap, context); + const condResult = await context.functionMap[condFunc].executeFunctionAsync(args, context.tensorArrayMap, context.tensorListMap); + const argIds = args.map((tensor3) => tensor3.id); + let condValue = await condResult[0].data(); + condResult.forEach((tensor3) => { + if (!tensor3.kept && argIds.indexOf(tensor3.id) === -1) { + tensor3.dispose(); + } + }); + let result = args; + while (condValue[0]) { + const origResult = result; + result = await context.functionMap[bodyFunc].executeFunctionAsync(result, context.tensorArrayMap, context.tensorListMap); + const resultIds = result.map((tensor3) => tensor3.id); + origResult.forEach((tensor3) => { + if (!tensor3.kept && argIds.indexOf(tensor3.id) === -1 && resultIds.indexOf(tensor3.id) === -1) { + tensor3.dispose(); + } + }); + const condResult2 = await context.functionMap[condFunc].executeFunctionAsync(result, context.tensorArrayMap, context.tensorListMap); + condValue = await condResult2[0].data(); + condResult2.forEach((tensor3) => { + if (!tensor3.kept && argIds.indexOf(tensor3.id) === -1 && resultIds.indexOf(tensor3.id) === -1) { + tensor3.dispose(); + } + }); + } + return result; + } + case "LoopCond": { + const pred = getParamValue2("pred", node2, tensorMap, context); + return [cloneTensor2(pred)]; + } + case "Switch": { + const pred = getParamValue2("pred", node2, tensorMap, context); + let data = getParamValue2("data", node2, tensorMap, context); + if (!data.kept) { + data = cloneTensor2(data); + } + return (await pred.data())[0] ? [void 0, data] : [data, void 0]; + } + case "Merge": { + const inputName = node2.inputNames.find((name) => getTensor2(name, tensorMap, context) !== void 0); + if (inputName) { + const data = getTensor2(inputName, tensorMap, context); + return [cloneTensor2(data)]; + } + return void 0; + } + case "Enter": { + const frameId = getParamValue2("frameName", node2, tensorMap, context); + const data = getParamValue2("tensor", node2, tensorMap, context); + context.enterFrame(frameId); + return [cloneTensor2(data)]; + } + case "Exit": { + const data = getParamValue2("tensor", node2, tensorMap, context); + context.exitFrame(); + return [cloneTensor2(data)]; + } + case "NextIteration": { + const data = getParamValue2("tensor", node2, tensorMap, context); + context.nextIteration(); + return [cloneTensor2(data)]; + } + case "TensorArrayV3": { + const size2 = getParamValue2("size", node2, tensorMap, context); + const dtype = getParamValue2("dtype", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const dynamicSize = getParamValue2("dynamicSize", node2, tensorMap, context); + const clearAfterRead = getParamValue2("clearAfterRead", node2, tensorMap, context); + const identicalElementShapes = getParamValue2("identicalElementShapes", node2, tensorMap, context); + const name = getParamValue2("name", node2, tensorMap, context); + const tensorArray = new TensorArray2(name, dtype, size2, elementShape, identicalElementShapes, dynamicSize, clearAfterRead); + context.addTensorArray(tensorArray); + return [tensorArray.idTensor, scalar2(1)]; + } + case "TensorArrayWriteV3": { + const id = getParamValue2("tensorArrayId", node2, tensorMap, context); + const index = getParamValue2("index", node2, tensorMap, context); + const writeTensor = getParamValue2("tensor", node2, tensorMap, context); + const writeTensorArray = context.getTensorArray(id.id); + writeTensorArray.write(index, writeTensor); + return [writeTensorArray.idTensor]; + } + case "TensorArrayReadV3": { + const readId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const readIndex = getParamValue2("index", node2, tensorMap, context); + const readTensorArray = context.getTensorArray(readId.id); + return [readTensorArray.read(readIndex)]; + } + case "TensorArrayGatherV3": { + const gatherId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const gatherIndices = getParamValue2("indices", node2, tensorMap, context); + const gatherDtype = getParamValue2("dtype", node2, tensorMap, context); + const gatherTensorArray = context.getTensorArray(gatherId.id); + return [gatherTensorArray.gather(gatherIndices, gatherDtype)]; + } + case "TensorArrayScatterV3": { + const scatterId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const scatterIndices = getParamValue2("indices", node2, tensorMap, context); + const scatterTensor = getParamValue2("tensor", node2, tensorMap, context); + const scatterTensorArray = context.getTensorArray(scatterId.id); + scatterTensorArray.scatter(scatterIndices, scatterTensor); + return [scatterTensorArray.idTensor]; + } + case "TensorArrayConcatV3": { + const concatId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const concatTensorArray = context.getTensorArray(concatId.id); + const concatDtype = getParamValue2("dtype", node2, tensorMap, context); + return [concatTensorArray.concat(concatDtype)]; + } + case "TensorArraySplitV3": { + const splitId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const splitTensor = getParamValue2("tensor", node2, tensorMap, context); + const lengths = getParamValue2("lengths", node2, tensorMap, context); + const splitTensorArray = context.getTensorArray(splitId.id); + splitTensorArray.split(lengths, splitTensor); + return [splitTensorArray.idTensor]; + } + case "TensorArraySizeV3": { + const sizeId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const sizeTensorArray = context.getTensorArray(sizeId.id); + return [scalar2(sizeTensorArray.size(), "int32")]; + } + case "TensorArrayCloseV3": { + const closeId = getParamValue2("tensorArrayId", node2, tensorMap, context); + const closeTensorArray = context.getTensorArray(closeId.id); + closeTensorArray.clearAndClose(); + return [closeTensorArray.idTensor]; + } + case "TensorListSetItem": { + const idTensor = getParamValue2("tensorListId", node2, tensorMap, context); + const index = getParamValue2("index", node2, tensorMap, context); + const writeTensor = getParamValue2("tensor", node2, tensorMap, context); + const tensorList = context.getTensorList(idTensor.id); + tensorList.setItem(index, writeTensor); + return [tensorList.idTensor]; + } + case "TensorListGetItem": { + const idTensor = getParamValue2("tensorListId", node2, tensorMap, context); + const readIndex = getParamValue2("index", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDType = getParamValue2("elementDType", node2, tensorMap, context); + const tensorList = context.getTensorList(idTensor.id); + return [tensorList.getItem(readIndex, elementShape, elementDType)]; + } + case "TensorListScatterV2": + case "TensorListScatter": { + const scatterIndices = getParamValue2("indices", node2, tensorMap, context); + const scatterTensor = getParamValue2("tensor", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const numElements = getParamValue2("numElements", node2, tensorMap, context); + const tensorList = scatter2(scatterTensor, scatterIndices, elementShape, numElements); + context.addTensorList(tensorList); + return [tensorList.idTensor]; + } + case "TensorListReserve": + case "EmptyTensorList": { + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDtype = getParamValue2("elementDType", node2, tensorMap, context); + let numElementsParam; + if (node2.op === "TensorListReserve") { + numElementsParam = "numElements"; + } else { + numElementsParam = "maxNumElements"; + } + const numElements = getParamValue2(numElementsParam, node2, tensorMap, context); + const tensorList = reserve2(elementShape, elementDtype, numElements); + context.addTensorList(tensorList); + return [tensorList.idTensor]; + } + case "TensorListGather": { + const gatherId = getParamValue2("tensorListId", node2, tensorMap, context); + const gatherIndices = getParamValue2("indices", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDtype = getParamValue2("elementDType", node2, tensorMap, context); + const tensorList = context.getTensorList(gatherId.id); + return [tensorList.gather(gatherIndices, elementDtype, elementShape)]; + } + case "TensorListStack": { + const idTensor = getParamValue2("tensorListId", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDtype = getParamValue2("elementDType", node2, tensorMap, context); + const numElements = getParamValue2("numElements", node2, tensorMap, context); + const tensorList = context.getTensorList(idTensor.id); + return [tensorList.stack(elementShape, elementDtype, numElements)]; + } + case "TensorListFromTensor": { + const tensor3 = getParamValue2("tensor", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDtype = getParamValue2("elementDType", node2, tensorMap, context); + const tensorList = fromTensor2(tensor3, elementShape, elementDtype); + context.addTensorList(tensorList); + return [tensorList.idTensor]; + } + case "TensorListConcat": { + const concatId = getParamValue2("tensorListId", node2, tensorMap, context); + const tensorList = context.getTensorList(concatId.id); + const concatDtype = getParamValue2("dtype", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + return [tensorList.concat(concatDtype, elementShape)]; + } + case "TensorListPushBack": { + const idTensor = getParamValue2("tensorListId", node2, tensorMap, context); + const writeTensor = getParamValue2("tensor", node2, tensorMap, context); + const tensorList = context.getTensorList(idTensor.id); + tensorList.pushBack(writeTensor); + return [tensorList.idTensor]; + } + case "TensorListPopBack": { + const idTensor = getParamValue2("tensorListId", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const elementDType = getParamValue2("elementDType", node2, tensorMap, context); + const tensorList = context.getTensorList(idTensor.id); + return [tensorList.popBack(elementShape, elementDType)]; + } + case "TensorListSplit": { + const splitTensor = getParamValue2("tensor", node2, tensorMap, context); + const elementShape = getParamValue2("elementShape", node2, tensorMap, context); + const lengths = getParamValue2("lengths", node2, tensorMap, context); + const tensorList = split5(splitTensor, lengths, elementShape); + context.addTensorList(tensorList); + return [tensorList.idTensor]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.js +function fusedConvAndDepthWiseParams2(node2, tensorMap, context) { + const [extraOp, activationFunc] = getParamValue2("fusedOps", node2, tensorMap, context); + const isBiasAdd = extraOp === "biasadd"; + const noBiasAdd = !isBiasAdd; + const isPrelu = activationFunc === "prelu"; + const isBatchNorm = extraOp === "fusedbatchnorm"; + const numArgs = getParamValue2("numArgs", node2, tensorMap, context); + if (isBiasAdd) { + if (isPrelu && numArgs !== 2) { + throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha."); + } + if (!isPrelu && isBiasAdd && numArgs !== 1) { + throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias."); + } + } + if (isBatchNorm) { + throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported"); + } + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getPadding2(node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + const dilations = getParamValue2("dilations", node2, tensorMap, context); + let [biasArg, preluArg] = getParamValue2("args", node2, tensorMap, context); + if (noBiasAdd) { + preluArg = biasArg; + biasArg = void 0; + } + const leakyreluAlpha = getParamValue2("leakyreluAlpha", node2, tensorMap, context); + return { + stride, + pad: pad4, + dataFormat, + dilations, + biasArg, + preluArg, + activationFunc, + leakyreluAlpha + }; +} +var executeOp24 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Conv1D": { + const stride = getParamValue2("stride", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + const dilation = getParamValue2("dilation", node2, tensorMap, context); + return [conv1d3(getParamValue2("x", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), stride, pad4, dataFormat, dilation)]; + } + case "Conv2D": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getPadding2(node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + const dilations = getParamValue2("dilations", node2, tensorMap, context); + return [conv2d6(getParamValue2("x", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), [stride[1], stride[2]], pad4, dataFormat, [dilations[1], dilations[2]])]; + } + case "_FusedConv2D": { + const { stride, pad: pad4, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams2(node2, tensorMap, context); + return [fused_ops_exports2.conv2d({ + x: getParamValue2("x", node2, tensorMap, context), + filter: getParamValue2("filter", node2, tensorMap, context), + strides: [stride[1], stride[2]], + pad: pad4, + dataFormat, + dilations: [dilations[1], dilations[2]], + bias: biasArg, + activation: activationFunc, + preluActivationWeights: preluArg, + leakyreluAlpha + })]; + } + case "FusedDepthwiseConv2dNative": { + const { stride, pad: pad4, dataFormat, dilations, biasArg, preluArg, activationFunc, leakyreluAlpha } = fusedConvAndDepthWiseParams2(node2, tensorMap, context); + return [fused_ops_exports2.depthwiseConv2d({ + x: getParamValue2("x", node2, tensorMap, context), + filter: getParamValue2("filter", node2, tensorMap, context), + strides: [stride[1], stride[2]], + pad: pad4, + dataFormat, + dilations: [dilations[1], dilations[2]], + bias: biasArg, + activation: activationFunc, + preluActivationWeights: preluArg, + leakyreluAlpha + })]; + } + case "Conv2DBackpropInput": + case "Conv2dTranspose": { + const shape = getParamValue2("outputShape", node2, tensorMap, context); + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getPadding2(node2, tensorMap, context); + return [conv2dTranspose3(getParamValue2("x", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), shape, [stride[1], stride[2]], pad4)]; + } + case "DepthwiseConv2dNative": + case "DepthwiseConv2d": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getPadding2(node2, tensorMap, context); + const dilations = getParamValue2("dilations", node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + return [depthwiseConv2d6(getParamValue2("input", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), [stride[1], stride[2]], pad4, dataFormat, [dilations[1], dilations[2]])]; + } + case "Conv3D": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + const dilations = getParamValue2("dilations", node2, tensorMap, context); + return [conv3d3(getParamValue2("x", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), [stride[1], stride[2], stride[3]], pad4, dataFormat, [dilations[1], dilations[2], dilations[3]])]; + } + case "AvgPool": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const kernelSize = getParamValue2("kernelSize", node2, tensorMap, context); + return [avgPool5(getParamValue2("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad4)]; + } + case "MaxPool": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const kernelSize = getParamValue2("kernelSize", node2, tensorMap, context); + return [maxPool5(getParamValue2("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad4)]; + } + case "MaxPoolWithArgmax": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const kernelSize = getParamValue2("kernelSize", node2, tensorMap, context); + const includeBatchInIndex = getParamValue2("includeBatchInIndex", node2, tensorMap, context); + const { result, indexes } = maxPoolWithArgmax2(getParamValue2("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad4, includeBatchInIndex); + return [result, indexes]; + } + case "AvgPool3D": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const kernelSize = getParamValue2("kernelSize", node2, tensorMap, context); + return [avgPool3d3(getParamValue2("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad4)]; + } + case "MaxPool3D": { + const stride = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const kernelSize = getParamValue2("kernelSize", node2, tensorMap, context); + return [maxPool3d3(getParamValue2("x", node2, tensorMap, context), [kernelSize[1], kernelSize[2], kernelSize[3]], [stride[1], stride[2], stride[3]], pad4)]; + } + case "Dilation2D": { + const strides = getParamValue2("strides", node2, tensorMap, context); + const pad4 = getParamValue2("pad", node2, tensorMap, context); + const dilations = getParamValue2("dilations", node2, tensorMap, context); + const strideHeight = strides[1]; + const strideWidth = strides[2]; + const dilationHeight = dilations[1]; + const dilationWidth = dilations[2]; + return [dilation2d2(getParamValue2("x", node2, tensorMap, context), getParamValue2("filter", node2, tensorMap, context), [strideHeight, strideWidth], pad4, [dilationHeight, dilationWidth], "NHWC")]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.js +var executeOp25 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Fill": { + const shape = getParamValue2("shape", node2, tensorMap, context); + const dtype = getParamValue2("dtype", node2, tensorMap, context); + const value = getParamValue2("value", node2, tensorMap, context); + return [fill5(shape, value, dtype)]; + } + case "LinSpace": { + const start = getParamValue2("start", node2, tensorMap, context); + const stop = getParamValue2("stop", node2, tensorMap, context); + const num = getParamValue2("num", node2, tensorMap, context); + return [linspace2(start, stop, num)]; + } + case "Multinomial": { + const logits = getParamValue2("logits", node2, tensorMap, context); + const numSamples = getParamValue2("numSamples", node2, tensorMap, context); + const seed = getParamValue2("seed", node2, tensorMap, context); + return [multinomial4(logits, numSamples, seed)]; + } + case "OneHot": { + const indices = getParamValue2("indices", node2, tensorMap, context); + const depth = getParamValue2("depth", node2, tensorMap, context); + const onValue = getParamValue2("onValue", node2, tensorMap, context); + const offValue = getParamValue2("offValue", node2, tensorMap, context); + return [oneHot5(indices, depth, onValue, offValue)]; + } + case "Ones": { + return [ones5(getParamValue2("shape", node2, tensorMap, context), getParamValue2("dtype", node2, tensorMap, context))]; + } + case "OnesLike": { + return [onesLike5(getParamValue2("x", node2, tensorMap, context))]; + } + case "RandomUniform": { + return [randomUniform3(getParamValue2("shape", node2, tensorMap, context), getParamValue2("minval", node2, tensorMap, context), getParamValue2("maxval", node2, tensorMap, context), getParamValue2("dtype", node2, tensorMap, context))]; + } + case "Range": { + const start = getParamValue2("start", node2, tensorMap, context); + const stop = getParamValue2("stop", node2, tensorMap, context); + const step8 = getParamValue2("step", node2, tensorMap, context); + return [range6(start, stop, step8, getParamValue2("dtype", node2, tensorMap, context))]; + } + case "TruncatedNormal": { + const shape = getParamValue2("shape", node2, tensorMap, context); + const mean6 = getParamValue2("mean", node2, tensorMap, context); + const stdDev = getParamValue2("stdDev", node2, tensorMap, context); + const seed = getParamValue2("seed", node2, tensorMap, context); + return [truncatedNormal3(shape, mean6, stdDev, getParamValue2("dtype", node2, tensorMap, context), seed)]; + } + case "Zeros": { + return [zeros4(getParamValue2("shape", node2, tensorMap, context), getParamValue2("dtype", node2, tensorMap, context))]; + } + case "ZerosLike": { + return [zerosLike5(getParamValue2("x", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.js +function nmsParams2(node2, tensorMap, context) { + const boxes = getParamValue2("boxes", node2, tensorMap, context); + const scores = getParamValue2("scores", node2, tensorMap, context); + const maxOutputSize = getParamValue2("maxOutputSize", node2, tensorMap, context); + const iouThreshold = getParamValue2("iouThreshold", node2, tensorMap, context); + const scoreThreshold = getParamValue2("scoreThreshold", node2, tensorMap, context); + const softNmsSigma = getParamValue2("softNmsSigma", node2, tensorMap, context); + return { + boxes, + scores, + maxOutputSize, + iouThreshold, + scoreThreshold, + softNmsSigma + }; +} +var executeOp26 = async (node2, tensorMap, context) => { + switch (node2.op) { + case "NonMaxSuppressionV5": { + const { boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma } = nmsParams2(node2, tensorMap, context); + const result = await image3.nonMaxSuppressionWithScoreAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + return [result.selectedIndices, result.selectedScores]; + } + case "NonMaxSuppressionV4": { + const { boxes, scores, maxOutputSize, iouThreshold, scoreThreshold } = nmsParams2(node2, tensorMap, context); + const padToMaxOutputSize = getParamValue2("padToMaxOutputSize", node2, tensorMap, context); + const result = await image3.nonMaxSuppressionPaddedAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize); + return [result.selectedIndices, result.validOutputs]; + } + case "NonMaxSuppressionV3": + case "NonMaxSuppressionV2": { + const { boxes, scores, maxOutputSize, iouThreshold, scoreThreshold } = nmsParams2(node2, tensorMap, context); + return [await image3.nonMaxSuppressionAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold)]; + } + case "Where": { + const condition = cast6(getParamValue2("condition", node2, tensorMap, context), "bool"); + const result = [await whereAsync2(condition)]; + condition.dispose(); + return result; + } + case "ListDiff": { + return setdiff1dAsync2(getParamValue2("x", node2, tensorMap, context), getParamValue2("y", node2, tensorMap, context)); + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.js +var executeOp27 = (node2, tensorMap, context) => { + switch (node2.op) { + case "TopKV2": { + const x = getParamValue2("x", node2, tensorMap, context); + const k = getParamValue2("k", node2, tensorMap, context); + const sorted = getParamValue2("sorted", node2, tensorMap, context); + const result = topk3(x, k, sorted); + return [result.values, result.indices]; + } + case "Unique": { + const x = getParamValue2("x", node2, tensorMap, context); + const result = unique5(x); + return [result.values, result.indices]; + } + case "UniqueV2": { + const x = getParamValue2("x", node2, tensorMap, context); + const axis = getParamValue2("axis", node2, tensorMap, context); + const result = unique5(x, axis); + return [result.values, result.indices]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.js +var executeOp28 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Const": { + return tensorMap[node2.name]; + } + case "PlaceholderWithDefault": + const def = getParamValue2("default", node2, tensorMap, context); + return [getTensor2(node2.name, tensorMap, context) || def]; + case "Placeholder": + return [getTensor2(node2.name, tensorMap, context)]; + case "Identity": + case "StopGradient": + case "FakeQuantWithMinMaxVars": { + const data2 = getParamValue2("x", node2, tensorMap, context); + return [cloneTensor2(data2)]; + } + case "IdentityN": + return getParamValue2("x", node2, tensorMap, context).map((t) => cloneTensor2(t)); + case "Snapshot": + const snapshot = getParamValue2("x", node2, tensorMap, context); + return [cloneTensor2(snapshot)]; + case "Shape": + return [tensor1d2(getParamValue2("x", node2, tensorMap, context).shape, "int32")]; + case "ShapeN": + return getParamValue2("x", node2, tensorMap, context).map((t) => tensor1d2(t.shape)); + case "Size": + return [scalar2(getParamValue2("x", node2, tensorMap, context).size, "int32")]; + case "Rank": + return [scalar2(getParamValue2("x", node2, tensorMap, context).rank, "int32")]; + case "NoOp": + return [scalar2(1)]; + case "Print": + const input3 = getParamValue2("x", node2, tensorMap, context); + const data = getParamValue2("data", node2, tensorMap, context); + const message = getParamValue2("message", node2, tensorMap, context); + const summarize = getParamValue2("summarize", node2, tensorMap, context); + console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."); + console.log(message); + for (let i = 0; i < data.length; i++) { + console.log(Array.prototype.slice.call(data[i].dataSync()).slice(0, summarize)); + } + return [input3]; + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/hash_table.js +var HashTable2 = class { + constructor(keyDType, valueDType) { + this.keyDType = keyDType; + this.valueDType = valueDType; + this.handle = scalar2(0); + this.tensorMap = new Map(); + keep2(this.handle); + } + get id() { + return this.handle.id; + } + clearAndClose() { + this.tensorMap.forEach((value) => value.dispose()); + this.tensorMap.clear(); + this.handle.dispose(); + } + size() { + return this.tensorMap.size; + } + tensorSize() { + return scalar2(this.size(), "int32"); + } + async import(keys, values) { + this.checkKeyAndValueTensor(keys, values); + const $keys = await keys.data(); + this.tensorMap.forEach((value) => value.dispose()); + this.tensorMap.clear(); + return tidy2(() => { + const $values = unstack2(values); + const keysLength = $keys.length; + const valuesLength = $values.length; + util_exports2.assert(keysLength === valuesLength, () => `The number of elements doesn't match, keys has ${keysLength} elements, the values has ${valuesLength} elements.`); + for (let i = 0; i < keysLength; i++) { + const key = $keys[i]; + const value = $values[i]; + keep2(value); + this.tensorMap.set(key, value); + } + return this.handle; + }); + } + async find(keys, defaultValue) { + this.checkKeyAndValueTensor(keys, defaultValue); + const $keys = await keys.data(); + return tidy2(() => { + const result = []; + for (let i = 0; i < $keys.length; i++) { + const key = $keys[i]; + const value = this.findWithDefault(key, defaultValue); + result.push(value); + } + return stack2(result); + }); + } + findWithDefault(key, defaultValue) { + const result = this.tensorMap.get(key); + return result != null ? result : defaultValue; + } + checkKeyAndValueTensor(key, value) { + if (key.dtype !== this.keyDType) { + throw new Error(`Expect key dtype ${this.keyDType}, but got ${key.dtype}`); + } + if (value.dtype !== this.valueDType) { + throw new Error(`Expect value dtype ${this.valueDType}, but got ${value.dtype}`); + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/hash_table_executor.js +var executeOp29 = async (node2, tensorMap, context, resourceManager) => { + switch (node2.op) { + case "HashTable": + case "HashTableV2": { + const keyDType = getParamValue2("keyDType", node2, tensorMap, context); + const valueDType = getParamValue2("valueDType", node2, tensorMap, context); + const hashTable2 = new HashTable2(keyDType, valueDType); + resourceManager.addHashTable(node2.name, hashTable2); + return [hashTable2.handle]; + } + case "LookupTableImport": + case "LookupTableImportV2": { + const handle = getParamValue2("tableHandle", node2, tensorMap, context, resourceManager); + const keys = getParamValue2("keys", node2, tensorMap, context); + const values = getParamValue2("values", node2, tensorMap, context); + const hashTable2 = resourceManager.getHashTableById(handle.id); + return [await hashTable2.import(keys, values)]; + } + case "LookupTableFind": + case "LookupTableFindV2": { + const handle = getParamValue2("tableHandle", node2, tensorMap, context, resourceManager); + const keys = getParamValue2("keys", node2, tensorMap, context); + const defaultValue = getParamValue2("defaultValue", node2, tensorMap, context); + const hashTable2 = resourceManager.getHashTableById(handle.id); + return [await hashTable2.find(keys, defaultValue)]; + } + case "LookupTableSize": + case "LookupTableSizeV2": { + const handle = getParamValue2("tableHandle", node2, tensorMap, context, resourceManager); + const hashTable2 = resourceManager.getHashTableById(handle.id); + return [hashTable2.tensorSize()]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.js +var executeOp30 = (node2, tensorMap, context) => { + switch (node2.op) { + case "ResizeBilinear": { + const images = getParamValue2("images", node2, tensorMap, context); + const size2 = getParamValue2("size", node2, tensorMap, context); + const alignCorners = getParamValue2("alignCorners", node2, tensorMap, context); + const halfPixelCenters = getParamValue2("halfPixelCenters", node2, tensorMap, context); + return [image3.resizeBilinear(images, [size2[0], size2[1]], alignCorners, halfPixelCenters)]; + } + case "ResizeNearestNeighbor": { + const images = getParamValue2("images", node2, tensorMap, context); + const size2 = getParamValue2("size", node2, tensorMap, context); + const alignCorners = getParamValue2("alignCorners", node2, tensorMap, context); + const halfPixelCenters = getParamValue2("halfPixelCenters", node2, tensorMap, context); + return [image3.resizeNearestNeighbor(images, [size2[0], size2[1]], alignCorners, halfPixelCenters)]; + } + case "CropAndResize": { + const image9 = getParamValue2("image", node2, tensorMap, context); + const boxes = getParamValue2("boxes", node2, tensorMap, context); + const boxInd = getParamValue2("boxInd", node2, tensorMap, context); + const cropSize = getParamValue2("cropSize", node2, tensorMap, context); + const method = getParamValue2("method", node2, tensorMap, context); + const extrapolationValue = getParamValue2("extrapolationValue", node2, tensorMap, context); + return [image3.cropAndResize(image9, boxes, boxInd, cropSize, method, extrapolationValue)]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.js +var executeOp31 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Equal": { + return [equal4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "NotEqual": { + return [notEqual4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Greater": { + return [greater5(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "GreaterEqual": { + return [greaterEqual4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Less": { + return [less5(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "LessEqual": { + return [lessEqual4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "LogicalAnd": { + return [logicalAnd4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "LogicalNot": { + return [logicalNot4(getParamValue2("a", node2, tensorMap, context))]; + } + case "LogicalOr": { + return [logicalOr4(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + case "Select": + case "SelectV2": { + return [where2(getParamValue2("condition", node2, tensorMap, context), getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.js +var executeOp32 = (node2, tensorMap, context) => { + switch (node2.op) { + case "BatchMatMul": + case "BatchMatMulV2": + case "MatMul": + return [matMul3(getParamValue2("a", node2, tensorMap, context), getParamValue2("b", node2, tensorMap, context), getParamValue2("transposeA", node2, tensorMap, context), getParamValue2("transposeB", node2, tensorMap, context))]; + case "Einsum": + return [einsum4(getParamValue2("equation", node2, tensorMap, context), ...getParamValue2("tensors", node2, tensorMap, context))]; + case "Transpose": + return [transpose5(getParamValue2("x", node2, tensorMap, context), getParamValue2("perm", node2, tensorMap, context))]; + case "_FusedMatMul": + const [extraOp, activationFunc] = getParamValue2("fusedOps", node2, tensorMap, context); + const isBiasAdd = extraOp === "biasadd"; + const isPrelu = activationFunc === "prelu"; + const numArgs = getParamValue2("numArgs", node2, tensorMap, context); + const leakyreluAlpha = getParamValue2("leakyreluAlpha", node2, tensorMap, context); + if (isBiasAdd) { + if (isPrelu && numArgs !== 2) { + throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha."); + } + if (!isPrelu && numArgs !== 1) { + throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias."); + } + } + const [biasArg, preluArg] = getParamValue2("args", node2, tensorMap, context); + return [fused_ops_exports2.matMul({ + a: getParamValue2("a", node2, tensorMap, context), + b: getParamValue2("b", node2, tensorMap, context), + transposeA: getParamValue2("transposeA", node2, tensorMap, context), + transposeB: getParamValue2("transposeB", node2, tensorMap, context), + bias: biasArg, + activation: activationFunc, + preluActivationWeights: preluArg, + leakyreluAlpha + })]; + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.js +var executeOp33 = (node2, tensorMap, context) => { + switch (node2.op) { + case "FusedBatchNorm": + case "FusedBatchNormV2": { + return [batchNorm4(getParamValue2("x", node2, tensorMap, context), getParamValue2("mean", node2, tensorMap, context), getParamValue2("variance", node2, tensorMap, context), getParamValue2("offset", node2, tensorMap, context), getParamValue2("scale", node2, tensorMap, context), getParamValue2("epsilon", node2, tensorMap, context))]; + } + case "FusedBatchNormV3": { + return [batchNorm4(getParamValue2("x", node2, tensorMap, context), getParamValue2("mean", node2, tensorMap, context), getParamValue2("variance", node2, tensorMap, context), getParamValue2("offset", node2, tensorMap, context), getParamValue2("scale", node2, tensorMap, context), getParamValue2("epsilon", node2, tensorMap, context))]; + } + case "LRN": { + return [localResponseNormalization2(getParamValue2("x", node2, tensorMap, context), getParamValue2("radius", node2, tensorMap, context), getParamValue2("bias", node2, tensorMap, context), getParamValue2("alpha", node2, tensorMap, context), getParamValue2("beta", node2, tensorMap, context))]; + } + case "Softmax": { + return [softmax6(getParamValue2("x", node2, tensorMap, context))]; + } + case "LogSoftmax": { + return [logSoftmax2(getParamValue2("x", node2, tensorMap, context))]; + } + case "SparseToDense": { + return [sparseToDense4(getParamValue2("sparseIndices", node2, tensorMap, context), getParamValue2("outputShape", node2, tensorMap, context), getParamValue2("sparseValues", node2, tensorMap, context), getParamValue2("defaultValue", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.js +var executeOp34 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Max": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [max6(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "Mean": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [mean4(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "Min": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [min6(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "Sum": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [sum7(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "All": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [all5(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "Any": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [any5(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "ArgMax": { + const axis = getParamValue2("axis", node2, tensorMap, context); + return [argMax4(getParamValue2("x", node2, tensorMap, context), axis)]; + } + case "ArgMin": { + const axis = getParamValue2("axis", node2, tensorMap, context); + return [argMin4(getParamValue2("x", node2, tensorMap, context), axis)]; + } + case "Prod": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const keepDims = getParamValue2("keepDims", node2, tensorMap, context); + return [prod5(getParamValue2("x", node2, tensorMap, context), axis, keepDims)]; + } + case "Cumsum": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const exclusive = getParamValue2("exclusive", node2, tensorMap, context); + const reverse8 = getParamValue2("reverse", node2, tensorMap, context); + return [cumsum5(getParamValue2("x", node2, tensorMap, context), axis, exclusive, reverse8)]; + } + case "Bincount": + const x = getParamValue2("x", node2, tensorMap, context); + const weights = getParamValue2("weights", node2, tensorMap, context); + const size2 = getParamValue2("size", node2, tensorMap, context); + return [bincount4(x, weights, size2)]; + case "DenseBincount": { + const x2 = getParamValue2("x", node2, tensorMap, context); + const weights2 = getParamValue2("weights", node2, tensorMap, context); + const size3 = getParamValue2("size", node2, tensorMap, context); + const binaryOutput = getParamValue2("binaryOutput", node2, tensorMap, context); + return [denseBincount4(x2, weights2, size3, binaryOutput)]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.js +var executeOp35 = (node2, tensorMap, context) => { + switch (node2.op) { + case "ConcatV2": + case "Concat": { + const n = getParamValue2("n", node2, tensorMap, context); + const axis = getParamValue2("axis", node2, tensorMap, context); + let inputs = getParamValue2("tensors", node2, tensorMap, context); + inputs = inputs.slice(0, n); + return [concat5(inputs, axis)]; + } + case "Gather": { + const input3 = getParamValue2("x", node2, tensorMap, context); + const indices = getParamValue2("indices", node2, tensorMap, context); + return [gather3(input3, cast6(indices, "int32"), 0)]; + } + case "GatherV2": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const batchDims = getParamValue2("batchDims", node2, tensorMap, context); + const input3 = getParamValue2("x", node2, tensorMap, context); + const indices = getParamValue2("indices", node2, tensorMap, context); + return [gather3(input3, cast6(indices, "int32"), axis, batchDims)]; + } + case "Reverse": { + const dims = getParamValue2("dims", node2, tensorMap, context); + const axis = []; + for (let i = 0; i < dims.length; i++) { + if (dims[i]) { + axis.push(i); + } + } + const input3 = getParamValue2("x", node2, tensorMap, context); + return [reverse5(input3, axis)]; + } + case "ReverseV2": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const input3 = getParamValue2("x", node2, tensorMap, context); + return [reverse5(input3, axis)]; + } + case "Slice": { + const begin = getParamValue2("begin", node2, tensorMap, context); + const size2 = getParamValue2("size", node2, tensorMap, context); + return [slice5(getParamValue2("x", node2, tensorMap, context), begin, size2)]; + } + case "StridedSlice": { + const begin = getParamValue2("begin", node2, tensorMap, context); + const end = getParamValue2("end", node2, tensorMap, context); + const strides = getParamValue2("strides", node2, tensorMap, context); + const beginMask = getParamValue2("beginMask", node2, tensorMap, context); + const endMask = getParamValue2("endMask", node2, tensorMap, context); + const ellipsisMask = getParamValue2("ellipsisMask", node2, tensorMap, context); + const newAxisMask = getParamValue2("newAxisMask", node2, tensorMap, context); + const shrinkAxisMask = getParamValue2("shrinkAxisMask", node2, tensorMap, context); + const tensor3 = getParamValue2("x", node2, tensorMap, context); + return [stridedSlice5(tensor3, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask)]; + } + case "Pack": { + return tidy2(() => { + const axis = getParamValue2("axis", node2, tensorMap, context); + const tensors = getParamValue2("tensors", node2, tensorMap, context); + const shape = tensors[0].shape; + const squeezedShape = squeeze2(tensors[0]).shape; + const mapped = tensors.map((tensor3) => { + const sameShape = util_exports2.arraysEqual(tensor3.shape, shape); + if (!sameShape && !util_exports2.arraysEqual(squeeze2(tensor3).shape, squeezedShape)) { + throw new Error("the input tensors shape does not match"); + } + return sameShape ? tensor3 : reshape6(tensor3, shape); + }); + return [stack2(mapped, axis)]; + }); + } + case "Unpack": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const tensor3 = getParamValue2("tensor", node2, tensorMap, context); + return unstack2(tensor3, axis); + } + case "Tile": { + const reps = getParamValue2("reps", node2, tensorMap, context); + return [tile6(getParamValue2("x", node2, tensorMap, context), reps)]; + } + case "Split": + case "SplitV": { + const axis = getParamValue2("axis", node2, tensorMap, context); + const numOrSizeSplits = getParamValue2("numOrSizeSplits", node2, tensorMap, context); + const tensor3 = getParamValue2("x", node2, tensorMap, context); + return split4(tensor3, numOrSizeSplits, axis); + } + case "ScatterNd": { + const indices = getParamValue2("indices", node2, tensorMap, context); + const values = getParamValue2("values", node2, tensorMap, context); + const shape = getParamValue2("shape", node2, tensorMap, context); + return [scatterND2(indices, values, shape)]; + } + case "GatherNd": { + const x = getParamValue2("x", node2, tensorMap, context); + const indices = getParamValue2("indices", node2, tensorMap, context); + return [gatherND2(x, indices)]; + } + case "SparseToDense": { + const indices = getParamValue2("sparseIndices", node2, tensorMap, context); + const shape = getParamValue2("outputShape", node2, tensorMap, context); + const sparseValues = getParamValue2("sparseValues", node2, tensorMap, context); + const defaultValue = getParamValue2("defaultValue", node2, tensorMap, context); + return [sparseToDense4(indices, sparseValues, shape, sparseValues.dtype === defaultValue.dtype ? defaultValue : cast6(defaultValue, sparseValues.dtype))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/sparse_executor.js +var executeOp36 = (node2, tensorMap, context) => { + switch (node2.op) { + case "SparseFillEmptyRows": { + const { outputIndices, outputValues, emptyRowIndicator, reverseIndexMap } = sparse2.sparseFillEmptyRows(getParamValue2("indices", node2, tensorMap, context), getParamValue2("values", node2, tensorMap, context), getParamValue2("denseShape", node2, tensorMap, context), getParamValue2("defaultValue", node2, tensorMap, context)); + return [ + outputIndices, + outputValues, + emptyRowIndicator, + reverseIndexMap + ]; + } + case "SparseReshape": { + const { outputIndices, outputShape } = sparse2.sparseReshape(getParamValue2("inputIndices", node2, tensorMap, context), getParamValue2("inputShape", node2, tensorMap, context), getParamValue2("newShape", node2, tensorMap, context)); + return [outputIndices, outputShape]; + } + case "SparseSegmentMean": { + const outputData = sparse2.sparseSegmentMean(getParamValue2("data", node2, tensorMap, context), getParamValue2("indices", node2, tensorMap, context), getParamValue2("segmentIds", node2, tensorMap, context)); + return [outputData]; + } + case "SparseSegmentSum": { + const outputData = sparse2.sparseSegmentSum(getParamValue2("data", node2, tensorMap, context), getParamValue2("indices", node2, tensorMap, context), getParamValue2("segmentIds", node2, tensorMap, context)); + return [outputData]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/spectral_executor.js +var executeOp37 = (node2, tensorMap, context) => { + switch (node2.op) { + case "FFT": { + return [fft4(getParamValue2("x", node2, tensorMap, context))]; + } + case "IFFT": { + return [ifft4(getParamValue2("x", node2, tensorMap, context))]; + } + case "RFFT": { + return [rfft2(getParamValue2("x", node2, tensorMap, context))]; + } + case "IRFFT": { + return [irfft2(getParamValue2("x", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/string_executor.js +var executeOp38 = (node2, tensorMap, context) => { + switch (node2.op) { + case "StringNGrams": { + const { nGrams, nGramsSplits } = string2.stringNGrams(getParamValue2("data", node2, tensorMap, context), getParamValue2("dataSplits", node2, tensorMap, context), getParamValue2("separator", node2, tensorMap, context), getParamValue2("nGramWidths", node2, tensorMap, context), getParamValue2("leftPad", node2, tensorMap, context), getParamValue2("rightPad", node2, tensorMap, context), getParamValue2("padWidth", node2, tensorMap, context), getParamValue2("preserveShortSequences", node2, tensorMap, context)); + return [nGrams, nGramsSplits]; + } + case "StringSplit": { + const { indices, values, shape } = string2.stringSplit(getParamValue2("input", node2, tensorMap, context), getParamValue2("delimiter", node2, tensorMap, context), getParamValue2("skipEmpty", node2, tensorMap, context)); + return [indices, values, shape]; + } + case "StringToHashBucketFast": { + const output = string2.stringToHashBucketFast(getParamValue2("input", node2, tensorMap, context), getParamValue2("numBuckets", node2, tensorMap, context)); + return [output]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.js +var executeOp39 = (node2, tensorMap, context) => { + switch (node2.op) { + case "Cast": { + return [cast6(getParamValue2("x", node2, tensorMap, context), getParamValue2("dtype", node2, tensorMap, context))]; + } + case "ExpandDims": { + const axis = getParamValue2("axis", node2, tensorMap, context); + return [expandDims6(getParamValue2("x", node2, tensorMap, context), axis)]; + } + case "Squeeze": { + const axis = getParamValue2("axis", node2, tensorMap, context); + return [squeeze2(getParamValue2("x", node2, tensorMap, context), axis)]; + } + case "Reshape": { + return [reshape6(getParamValue2("x", node2, tensorMap, context), getParamValue2("shape", node2, tensorMap, context))]; + } + case "MirrorPad": { + return [mirrorPad4(getParamValue2("x", node2, tensorMap, context), getParamValue2("padding", node2, tensorMap, context), getParamValue2("mode", node2, tensorMap, context))]; + } + case "PadV2": + case "Pad": { + return [pad3(getParamValue2("x", node2, tensorMap, context), getParamValue2("padding", node2, tensorMap, context), getParamValue2("constantValue", node2, tensorMap, context))]; + } + case "SpaceToBatchND": { + const blockShape = getParamValue2("blockShape", node2, tensorMap, context); + const paddings = getParamValue2("paddings", node2, tensorMap, context); + return [spaceToBatchND5(getParamValue2("x", node2, tensorMap, context), blockShape, paddings)]; + } + case "BatchToSpaceND": { + const blockShape = getParamValue2("blockShape", node2, tensorMap, context); + const crops = getParamValue2("crops", node2, tensorMap, context); + return [batchToSpaceND5(getParamValue2("x", node2, tensorMap, context), blockShape, crops)]; + } + case "DepthToSpace": { + const blockSize = getParamValue2("blockSize", node2, tensorMap, context); + const dataFormat = getParamValue2("dataFormat", node2, tensorMap, context).toUpperCase(); + return [depthToSpace5(getParamValue2("x", node2, tensorMap, context), blockSize, dataFormat)]; + } + case "BroadcastTo": { + return [broadcastTo2(getParamValue2("x", node2, tensorMap, context), getParamValue2("shape", node2, tensorMap, context))]; + } + case "BroadcastArgs": { + return [broadcastArgs3(getParamValue2("s0", node2, tensorMap, context), getParamValue2("s1", node2, tensorMap, context))]; + } + default: + throw TypeError(`Node type ${node2.op} is not implemented`); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.js +function executeOp40(node2, tensorMap, context, resourceManager) { + const value = ((node3, tensorMap2, context2) => { + switch (node3.category) { + case "arithmetic": + return tidy2(() => executeOp21(node3, tensorMap2, context2)); + case "basic_math": + return tidy2(() => executeOp22(node3, tensorMap2, context2)); + case "control": + return executeOp23(node3, tensorMap2, context2); + case "convolution": + return tidy2(() => executeOp24(node3, tensorMap2, context2)); + case "creation": + return tidy2(() => executeOp25(node3, tensorMap2, context2)); + case "dynamic": + return executeOp26(node3, tensorMap2, context2); + case "evaluation": + return tidy2(() => executeOp27(node3, tensorMap2, context2)); + case "image": + return tidy2(() => executeOp30(node3, tensorMap2, context2)); + case "graph": + return tidy2(() => executeOp28(node3, tensorMap2, context2)); + case "logical": + return tidy2(() => executeOp31(node3, tensorMap2, context2)); + case "matrices": + return tidy2(() => executeOp32(node3, tensorMap2, context2)); + case "normalization": + return tidy2(() => executeOp33(node3, tensorMap2, context2)); + case "reduction": + return tidy2(() => executeOp34(node3, tensorMap2, context2)); + case "slice_join": + return tidy2(() => executeOp35(node3, tensorMap2, context2)); + case "sparse": + return tidy2(() => executeOp36(node3, tensorMap2, context2)); + case "spectral": + return tidy2(() => executeOp37(node3, tensorMap2, context2)); + case "string": + return tidy2(() => executeOp38(node3, tensorMap2, context2)); + case "transformation": + return tidy2(() => executeOp39(node3, tensorMap2, context2)); + case "hash_table": + return executeOp29(node3, tensorMap2, context2, resourceManager); + case "custom": + const opMapper = getRegisteredOp2(node3.op); + if (opMapper && opMapper.customExecutor) { + return opMapper.customExecutor(new NodeValueImpl2(node3, tensorMap2, context2)); + } else { + throw TypeError(`Custom op ${node3.op} is not registered.`); + } + default: + throw TypeError(`Unknown op '${node3.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`); + } + })(node2, tensorMap, context); + if (util_exports2.isPromise(value)) { + return value.then((data) => [].concat(data)); + } + return [].concat(value); +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.js +var ExecutionContext2 = class { + constructor(weightMap = {}, tensorArrayMap = {}, tensorListMap = {}, functionMap = {}) { + this.weightMap = weightMap; + this.tensorArrayMap = tensorArrayMap; + this.tensorListMap = tensorListMap; + this.functionMap = functionMap; + this.rootContext = { id: 0, frameName: "", iterationId: 0 }; + this.contexts = [this.rootContext]; + this.lastId = 0; + this.generateCurrentContextIds(); + } + newFrame(id, frameName) { + return { id, frameName, iterationId: 0 }; + } + set currentContext(contexts3) { + if (this.contexts !== contexts3) { + this.contexts = contexts3; + this.generateCurrentContextIds(); + } + } + get currentContext() { + return this.contexts; + } + get currentContextId() { + return this._currentContextIds[0]; + } + get currentContextIds() { + return this._currentContextIds; + } + generateCurrentContextIds() { + const names = []; + for (let i = 0; i < this.contexts.length - 1; i++) { + const contexts3 = this.contexts.slice(0, this.contexts.length - i); + names.push(this.contextIdforContexts(contexts3)); + } + names.push(""); + this._currentContextIds = names; + } + contextIdforContexts(contexts3) { + return contexts3 ? contexts3.map((context) => context.id === 0 && context.iterationId === 0 ? "" : `${context.frameName}-${context.iterationId}`).join("/") : ""; + } + enterFrame(frameId) { + if (this.contexts) { + this.lastId++; + this.contexts = this.contexts.slice(); + this.contexts.push(this.newFrame(this.lastId, frameId)); + this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)); + } + } + exitFrame() { + if (this.contexts && this.contexts.length > 1) { + this.contexts = this.contexts.slice(); + this.contexts.splice(-1); + this.currentContextIds.shift(); + } else { + throw new Error("Cannot exit frame, the context is empty"); + } + } + nextIteration() { + if (this.contexts && this.contexts.length > 0) { + this.contexts = this.contexts.slice(); + this.lastId++; + const context = Object.assign({}, this.contexts[this.contexts.length - 1]); + context.iterationId += 1; + context.id = this.lastId; + this.contexts.splice(-1, 1, context); + this._currentContextIds.splice(0, 1, this.contextIdforContexts(this.contexts)); + } else { + throw new Error("Cannot increase frame iteration, the context is empty"); + } + } + getWeight(name) { + return this.weightMap[name]; + } + addTensorArray(tensorArray) { + this.tensorArrayMap[tensorArray.id] = tensorArray; + } + getTensorArray(id) { + return this.tensorArrayMap[id]; + } + addTensorList(tensorList) { + this.tensorListMap[tensorList.id] = tensorList; + } + getTensorList(id) { + return this.tensorListMap[id]; + } + dispose(keepIds) { + for (const key in this.tensorArrayMap) { + this.tensorArrayMap[key].clearAndClose(keepIds); + } + for (const key in this.tensorListMap) { + this.tensorListMap[key].clearAndClose(keepIds); + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/model_analysis.js +function getExecutionSubgraph2(inputs, outputs, weightMap, initNodes) { + const usedNodes = new Set(); + const missingInputs = []; + let dynamicNode = null; + let syncInputs = null; + const seen = new Set(); + const inputNodeNames = Object.keys(inputs).map((name) => parseNodeName2(name)[0]); + let initNodeNames = []; + if (initNodes != null) { + initNodeNames = initNodes.map((node2) => parseNodeName2(node2.name)[0]); + } + const frontier = [...outputs]; + while (frontier.length > 0) { + const node2 = frontier.pop(); + if (isControlFlow2(node2) || isDynamicShape2(node2) || isHashTable2(node2)) { + if (dynamicNode == null) { + dynamicNode = node2; + syncInputs = dynamicNode.children.map((child) => child.name).filter((name) => usedNodes.has(name)); + } + } + usedNodes.add(node2.name); + if (weightMap[node2.name] != null) { + continue; + } + if (inputNodeNames.indexOf(node2.name) !== -1) { + continue; + } + if (initNodeNames.indexOf(node2.name) !== -1) { + continue; + } + if (node2.inputs.length === 0) { + missingInputs.push(node2.name); + continue; + } + node2.inputs.forEach((input3) => { + if (seen.has(input3.name)) { + return; + } + seen.add(input3.name); + frontier.push(input3); + }); + } + return { inputs, outputs, usedNodes, missingInputs, dynamicNode, syncInputs }; +} +function getNodesInTopologicalOrder2(graph2, weightMap, executionInfo) { + const { usedNodes, inputs } = executionInfo; + const frontier = []; + const inputNodes = Object.keys(inputs).map((name) => parseNodeName2(name)[0]).map((name) => graph2.nodes[name]); + const initNodes = graph2.initNodes; + inputNodes.forEach((input3) => { + if (usedNodes.has(input3.name)) { + frontier.push(input3); + } + }); + graph2.weights.forEach((weight) => { + if (usedNodes.has(weight.name)) { + frontier.push(weight); + } + }); + if (initNodes != null) { + initNodes.forEach((node2) => { + if (usedNodes.has(node2.name)) { + frontier.push(node2); + } + }); + } + const seen = new Set(); + const orderedNodes = []; + while (frontier.length > 0) { + const node2 = frontier.pop(); + seen.add(node2.name); + if (!weightMap[node2.name]) { + orderedNodes.push(node2); + } + node2.children.forEach((child) => { + if (!seen.has(child.name) && usedNodes.has(child.name) && child.inputs.every((input3) => seen.has(input3.name))) { + frontier.push(child); + } + }); + } + return orderedNodes; +} +var CONTROL_FLOW_OPS2 = [ + "Switch", + "Merge", + "Enter", + "Exit", + "NextIteration", + "StatelessIf", + "StatelessWhile", + "if", + "While" +]; +var DYNAMIC_SHAPE_OPS2 = [ + "NonMaxSuppressionV2", + "NonMaxSuppressionV3", + "NonMaxSuppressionV5", + "Where" +]; +var HASH_TABLE_OPS2 = [ + "HashTable", + "HashTableV2", + "LookupTableImport", + "LookupTableImportV2", + "LookupTableFind", + "LookupTableFindV2", + "LookupTableSize", + "LookupTableSizeV2" +]; +function isControlFlow2(node2) { + return CONTROL_FLOW_OPS2.indexOf(node2.op) >= 0; +} +function isDynamicShape2(node2) { + return DYNAMIC_SHAPE_OPS2.indexOf(node2.op) >= 0; +} +function isHashTable2(node2) { + return HASH_TABLE_OPS2.indexOf(node2.op) >= 0; +} + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.js +var GraphExecutor2 = class { + constructor(graph2, parent) { + this.graph = graph2; + this.parent = parent; + this.compiledMap = new Map(); + this._weightMap = {}; + this.SEPERATOR = ","; + this._functions = {}; + this._functionExecutorMap = {}; + this._outputs = graph2.outputs; + this._inputs = graph2.inputs; + this._initNodes = graph2.initNodes; + this._signature = graph2.signature; + this._functions = graph2.functions; + if (graph2.functions != null) { + Object.keys(graph2.functions).forEach((name) => { + this._functionExecutorMap[name] = new GraphExecutor2(graph2.functions[name], this); + }); + } + } + get weightIds() { + return this.parent ? this.parent.weightIds : this._weightIds; + } + get functionExecutorMap() { + return this.parent ? this.parent.functionExecutorMap : this._functionExecutorMap; + } + get weightMap() { + return this.parent ? this.parent.weightMap : this._weightMap; + } + set weightMap(weightMap) { + const weightIds = Object.keys(weightMap).map((key) => weightMap[key].map((tensor3) => tensor3.id)); + this._weightIds = [].concat(...weightIds); + this._weightMap = weightMap; + } + set resourceManager(resourceManager) { + this._resourceManager = resourceManager; + } + get inputs() { + return this._inputs.map((node2) => { + return { + name: node2.name, + shape: node2.attrParams["shape"] ? node2.attrParams["shape"].value : void 0, + dtype: node2.attrParams["dtype"] ? node2.attrParams["dtype"].value : void 0 + }; + }); + } + get outputs() { + return this._outputs.map((node2) => { + return { + name: node2.name, + shape: node2.attrParams["shape"] ? node2.attrParams["shape"].value : void 0, + dtype: node2.attrParams["dtype"] ? node2.attrParams["dtype"].value : void 0 + }; + }); + } + get inputNodes() { + return this._inputs.map((node2) => node2.signatureKey || node2.name); + } + get outputNodes() { + return this._outputs.map((node2) => { + const name = node2.signatureKey || node2.name; + return node2.defaultOutput ? `${name}:${node2.defaultOutput}` : name; + }); + } + get functions() { + return Object.keys(this._functions).reduce((map, key) => { + map[key] = this._functions[key].signature; + return map; + }, {}); + } + getCompilationKey(inputs, outputs) { + const sortedInputs = inputs.map((node2) => node2.name).sort(); + const sortedOutputs = outputs.map((node2) => node2.name).sort(); + return sortedInputs.join(this.SEPERATOR) + "--" + sortedOutputs.join(this.SEPERATOR); + } + compile(inputs, outputs) { + const executionInfo = getExecutionSubgraph2(inputs, outputs, this.weightMap, this._initNodes); + const { missingInputs, dynamicNode, syncInputs } = executionInfo; + if (dynamicNode != null) { + throw new Error(`This execution contains the node '${dynamicNode.name}', which has the dynamic op '${dynamicNode.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${syncInputs}]`); + } + if (missingInputs.length > 0) { + const outNames = outputs.map((n) => n.name); + const inNames = Object.keys(inputs); + throw new Error(`Cannot compute the outputs [${outNames}] from the provided inputs [${inNames}]. Missing the following inputs: [${missingInputs}]`); + } + return getNodesInTopologicalOrder2(this.graph, this.weightMap, executionInfo); + } + execute(inputs, outputs) { + inputs = this.mapInputs(inputs); + const names = Object.keys(inputs).sort(); + this.checkInputs(inputs); + this.checkInputShapeAndType(inputs); + outputs = this.mapOutputs(outputs); + this.checkOutputs(outputs); + const inputNodes = names.map((name) => this.graph.nodes[parseNodeName2(name)[0]]); + const outputNodeNames = outputs.map((name) => parseNodeName2(name)[0]); + let outputNodes2 = outputNodeNames.map((name) => this.graph.nodes[name]); + if (outputNodes2.length === 0) { + outputNodes2 = this._outputs; + } + const compilationKey = this.getCompilationKey(inputNodes, outputNodes2); + let orderedNodes = this.compiledMap.get(compilationKey); + if (orderedNodes == null) { + orderedNodes = this.compile(inputs, outputNodes2); + this.compiledMap.set(compilationKey, orderedNodes); + } + const tensorArrayMap = {}; + const tensorListMap = {}; + return tidy2(() => { + const context = new ExecutionContext2(this.weightMap, tensorArrayMap, tensorListMap, this.functionExecutorMap); + const tensorsMap = Object.assign({}, this.weightMap); + Object.keys(inputs).forEach((name) => { + const [nodeName, index] = parseNodeName2(name); + const tensors = []; + tensors[index] = inputs[name]; + tensorsMap[nodeName] = tensors; + }); + const tensorsToKeep = this.getFrozenTensorIds(tensorsMap); + const intermediateTensorConsumerCount = {}; + for (let i = 0; i < orderedNodes.length; i++) { + const node2 = orderedNodes[i]; + if (!tensorsMap[node2.name]) { + const tensors = executeOp40(node2, tensorsMap, context, this._resourceManager); + if (util_exports2.isPromise(tensors)) { + throw new Error(`The execution of the op '${node2.op}' returned a promise. Please use model.executeAsync() instead.`); + } + tensorsMap[node2.name] = tensors; + this.checkTensorForDisposal(node2.name, node2, tensorsMap, context, tensorsToKeep, outputNodeNames, intermediateTensorConsumerCount); + } + } + if (this.parent == null) { + context.dispose(tensorsToKeep); + } + return outputs.map((name) => getTensor2(name, tensorsMap, context)); + }); + } + getFrozenTensorIds(tensorMap) { + const ids = [].concat.apply([], Object.keys(tensorMap).map((key) => tensorMap[key]).map((tensors) => tensors.map((tensor3) => tensor3.id))); + return new Set(ids); + } + checkTensorForDisposal(nodeName, node2, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount) { + if (node2.category === "control" || outputNames.indexOf(nodeName) !== -1) { + return; + } + tensorMap[nodeName].forEach((tensor3) => { + if (tensor3 != null) { + intermediateTensorConsumerCount[tensor3.id] = (intermediateTensorConsumerCount[tensor3.id] || 0) + node2.children.length; + } + }); + node2.inputs.forEach((input3) => { + if (input3.category !== "control") { + const tensors = getTensorsForCurrentContenxt2(input3.name, tensorMap, context); + if (tensors != null) { + tensors.forEach((tensor3) => { + if (tensor3 && !tensor3.kept && !tensorsToKeep.has(tensor3.id)) { + const count4 = intermediateTensorConsumerCount[tensor3.id]; + if (count4 === 1) { + tensor3.dispose(); + delete intermediateTensorConsumerCount[tensor3.id]; + } else if (count4 != null) { + intermediateTensorConsumerCount[tensor3.id]--; + } + } + }); + } + } + }); + } + async executeAsync(inputs, outputs) { + return this._executeAsync(inputs, outputs); + } + async _executeAsync(inputs, outputs, isFunctionExecution = false, tensorArrayMap = {}, tensorListMap = {}) { + if (!isFunctionExecution) { + inputs = this.mapInputs(inputs); + this.checkInputs(inputs); + this.checkInputShapeAndType(inputs); + outputs = this.mapOutputs(outputs); + this.checkOutputs(outputs); + } + const context = new ExecutionContext2(this.weightMap, tensorArrayMap, tensorListMap, this.functionExecutorMap); + const tensorMap = await this.executeWithControlFlow(inputs, context, outputs, isFunctionExecution); + const results = outputs.map((name) => getTensor2(name, tensorMap, context)); + const outputIds = results.map((t) => t.id); + const inputIds = Object.keys(inputs).map((name) => inputs[name].id); + const keepIds = new Set([...outputIds, ...inputIds, ...this.weightIds]); + Object.keys(tensorMap).forEach((key) => { + const tensorArray = tensorMap[key]; + tensorArray.forEach((tensor3) => { + if (tensor3 && !tensor3.kept && !tensor3.isDisposed && !keepIds.has(tensor3.id)) { + tensor3.dispose(); + } + }); + }); + if (this.parent == null) { + context.dispose(keepIds); + } + return results; + } + async executeFunctionAsync(inputs, tensorArrayMap, tensorListMap) { + const mappedInputs = inputs.reduce((map, tensor3, index) => { + map[this.inputs[index].name] = tensor3; + return map; + }, {}); + return this._executeAsync(mappedInputs, this.outputNodes, true, tensorArrayMap, tensorListMap); + } + async executeWithControlFlow(inputs, context, outputNames, isFunctionExecution) { + const names = Object.keys(inputs); + const inputNodes = names.map((name) => this.graph.nodes[parseNodeName2(name)[0]]); + const outputNodeNames = outputNames.map((name) => parseNodeName2(name)[0]); + let outputNodes2 = outputNodeNames.map((name) => this.graph.nodes[name]); + if (outputNodes2.length === 0) { + outputNodes2 = this._outputs; + } + const { usedNodes, missingInputs, dynamicNode, syncInputs } = getExecutionSubgraph2(inputs, outputNodes2, this.weightMap, this._initNodes); + const stack3 = [ + ...inputNodes, + ...this.graph.weights, + ...this._initNodes || [] + ].map((node2) => { + return { node: node2, contexts: context.currentContext }; + }); + const tensorsMap = Object.assign({}, this.weightMap); + Object.keys(inputs).forEach((name) => { + const [nodeName, index] = parseNodeName2(name); + const tensors = []; + tensors[index] = inputs[name]; + tensorsMap[nodeName] = tensors; + }); + const intermediateTensorConsumerCount = {}; + const tensorsToKeep = this.getFrozenTensorIds(tensorsMap); + const added = {}; + while (stack3.length > 0) { + const promises = this.processStack(inputNodes, stack3, context, tensorsMap, added, tensorsToKeep, outputNodeNames, intermediateTensorConsumerCount, usedNodes); + await Promise.all(promises); + } + if (dynamicNode == null && !isFunctionExecution) { + console.warn(`This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.`); + } + const missingOutputs = outputNodes2.filter((node2) => !isControlFlow2(node2) && !getTensor2(node2.name, tensorsMap, context)).map((node2) => node2.name); + if (missingOutputs.length > 0) { + let alternativeMsg = ""; + if (dynamicNode != null) { + alternativeMsg = `Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${syncInputs}]`; + } + throw new Error(`Cannot compute the outputs [${missingOutputs}] from the provided inputs [${names}]. Consider providing the following inputs: [${missingInputs}]. ${alternativeMsg}`); + } + return tensorsMap; + } + processStack(inputNodes, stack3, context, tensorMap, added, tensorsToKeep, outputNames, intermediateTensorConsumerCount, usedNodes) { + const promises = []; + while (stack3.length > 0) { + const item = stack3.pop(); + context.currentContext = item.contexts; + let nodeName = ""; + if (item.node.op === "Enter" && getParamValue2("isConstant", item.node, tensorMap, context)) { + [nodeName] = getNodeNameAndIndex2(item.node.name, context); + } + if (tensorMap[item.node.name] == null) { + const tensors = executeOp40(item.node, tensorMap, context, this._resourceManager); + if (!nodeName) { + [nodeName] = getNodeNameAndIndex2(item.node.name, context); + } + const currentContext = context.currentContext; + if (util_exports2.isPromise(tensors)) { + promises.push(tensors.then((t) => { + tensorMap[nodeName] = t; + context.currentContext = currentContext; + this.checkTensorForDisposal(nodeName, item.node, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount); + this.processChildNodes(item.node, stack3, context, tensorMap, added, usedNodes); + return t; + })); + } else { + tensorMap[nodeName] = tensors; + this.checkTensorForDisposal(nodeName, item.node, tensorMap, context, tensorsToKeep, outputNames, intermediateTensorConsumerCount); + this.processChildNodes(item.node, stack3, context, tensorMap, added, usedNodes); + } + } else { + this.processChildNodes(item.node, stack3, context, tensorMap, added, usedNodes); + } + } + return promises; + } + processChildNodes(node2, stack3, context, tensorMap, added, usedNodes) { + node2.children.forEach((childNode) => { + const [nodeName] = getNodeNameAndIndex2(childNode.name, context); + if (added[nodeName] || !usedNodes.has(childNode.name)) { + return; + } + if (childNode.op === "Merge") { + if (childNode.inputNames.some((name) => { + return !!getTensor2(name, tensorMap, context); + })) { + added[nodeName] = true; + stack3.push({ contexts: context.currentContext, node: childNode }); + } + } else if (childNode.inputNames.every((name) => { + return !!getTensor2(name, tensorMap, context); + })) { + added[nodeName] = true; + stack3.push({ contexts: context.currentContext, node: childNode }); + } + }); + } + dispose() { + Object.keys(this.weightMap).forEach((key) => this.weightMap[key].forEach((tensor3) => tensor3.dispose())); + } + checkInputShapeAndType(inputs) { + Object.keys(inputs).forEach((name) => { + const input3 = inputs[name]; + const [nodeName] = parseNodeName2(name); + const node2 = this.graph.nodes[nodeName]; + if (node2.attrParams["shape"] && node2.attrParams["shape"].value) { + const shape = node2.attrParams["shape"].value; + const match4 = shape.length === input3.shape.length && input3.shape.every((dim, index) => shape[index] === -1 || shape[index] === dim); + util_exports2.assert(match4, () => `The shape of dict['${node2.name}'] provided in model.execute(dict) must be [${shape}], but was [${input3.shape}]`); + } + if (node2.attrParams["dtype"] && node2.attrParams["dtype"].value) { + util_exports2.assert(input3.dtype === node2.attrParams["dtype"].value, () => `The dtype of dict['${node2.name}'] provided in model.execute(dict) must be ${node2.attrParams["dtype"].value}, but was ${input3.dtype}`); + } + }); + } + mapInputs(inputs) { + const result = {}; + for (const inputName in inputs) { + if (this._signature != null && this._signature.inputs != null && this._signature.inputs[inputName] != null) { + const tensor3 = this._signature.inputs[inputName]; + result[tensor3.name] = inputs[inputName]; + } else { + result[inputName] = inputs[inputName]; + } + } + return result; + } + checkInputs(inputs) { + const notInGraph = Object.keys(inputs).filter((name) => { + const [nodeName] = parseNodeName2(name); + return this.graph.nodes[nodeName] == null; + }); + if (notInGraph.length > 0) { + throw new Error(`The dict provided in model.execute(dict) has keys: [${notInGraph}] that are not part of graph`); + } + } + mapOutputs(outputs) { + return outputs.map((name) => { + if (this._signature != null && this._signature.outputs != null && this._signature.outputs[name] != null) { + const tensor3 = this._signature.outputs[name]; + return tensor3.name; + } + return name; + }, {}); + } + checkOutputs(outputs) { + outputs.forEach((name) => { + const [normalizedName] = parseNodeName2(name); + if (!this.graph.nodes[normalizedName]) { + throw new Error(`The output '${name}' is not found in the graph`); + } + }); + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/resource_manager.js +var ResourceManager2 = class { + constructor(hashTableNameToHandle = {}, hashTableMap = {}) { + this.hashTableNameToHandle = hashTableNameToHandle; + this.hashTableMap = hashTableMap; + } + addHashTable(name, hashTable2) { + this.hashTableNameToHandle[name] = hashTable2.handle; + this.hashTableMap[hashTable2.id] = hashTable2; + } + getHashTableHandleByName(name) { + return this.hashTableNameToHandle[name]; + } + getHashTableById(id) { + return this.hashTableMap[id]; + } + dispose() { + for (const key in this.hashTableMap) { + this.hashTableMap[key].clearAndClose(); + delete this.hashTableMap[key]; + } + for (const name in this.hashTableNameToHandle) { + this.hashTableNameToHandle[name].dispose(); + delete this.hashTableNameToHandle[name]; + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_model.js +var TFHUB_SEARCH_PARAM2 = "?tfjs-format=file"; +var DEFAULT_MODEL_NAME2 = "model.json"; +var GraphModel2 = class { + constructor(modelUrl, loadOptions = {}) { + this.modelUrl = modelUrl; + this.loadOptions = loadOptions; + this.version = "n/a"; + if (loadOptions == null) { + this.loadOptions = {}; + } + this.resourceManager = new ResourceManager2(); + } + get modelVersion() { + return this.version; + } + get inputNodes() { + return this.executor.inputNodes; + } + get outputNodes() { + return this.executor.outputNodes; + } + get inputs() { + return this.executor.inputs; + } + get outputs() { + return this.executor.outputs; + } + get weights() { + return this.executor.weightMap; + } + get metadata() { + return this.artifacts.userDefinedMetadata; + } + get modelSignature() { + return this.signature; + } + findIOHandler() { + const path = this.modelUrl; + if (path.load != null) { + this.handler = path; + } else if (this.loadOptions.requestInit != null) { + this.handler = io_exports2.browserHTTPRequest(path, this.loadOptions); + } else { + const handlers = io_exports2.getLoadHandlers(path, this.loadOptions); + if (handlers.length === 0) { + handlers.push(io_exports2.browserHTTPRequest(path, this.loadOptions)); + } else if (handlers.length > 1) { + throw new Error(`Found more than one (${handlers.length}) load handlers for URL '${[path]}'`); + } + this.handler = handlers[0]; + } + } + async load() { + this.findIOHandler(); + if (this.handler.load == null) { + throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented."); + } + const artifacts = await this.handler.load(); + return this.loadSync(artifacts); + } + loadSync(artifacts) { + this.artifacts = artifacts; + const graph2 = this.artifacts.modelTopology; + let signature; + if (this.artifacts.userDefinedMetadata != null && this.artifacts.userDefinedMetadata.signature != null) { + signature = this.artifacts.userDefinedMetadata.signature; + } else { + signature = this.artifacts.signature; + } + this.signature = signature; + this.version = `${graph2.versions.producer}.${graph2.versions.minConsumer}`; + const weightMap = io_exports2.decodeWeights(this.artifacts.weightData, this.artifacts.weightSpecs); + this.executor = new GraphExecutor2(OperationMapper2.Instance.transformGraph(graph2, this.signature)); + this.executor.weightMap = this.convertTensorMapToTensorsMap(weightMap); + this.executor.resourceManager = this.resourceManager; + if (artifacts.modelInitializer != null && artifacts.modelInitializer.node != null) { + const initializer = OperationMapper2.Instance.transformGraph(artifacts.modelInitializer); + this.initializer = new GraphExecutor2(initializer); + this.initializer.weightMap = this.executor.weightMap; + this.initializer.resourceManager = this.resourceManager; + this.initializer.executeAsync({}, []); + } + return true; + } + async save(handlerOrURL, config3) { + if (typeof handlerOrURL === "string") { + const handlers = io_exports2.getSaveHandlers(handlerOrURL); + if (handlers.length === 0) { + throw new Error(`Cannot find any save handlers for URL '${handlerOrURL}'`); + } else if (handlers.length > 1) { + throw new Error(`Found more than one (${handlers.length}) save handlers for URL '${handlerOrURL}'`); + } + handlerOrURL = handlers[0]; + } + if (handlerOrURL.save == null) { + throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined."); + } + return handlerOrURL.save(this.artifacts); + } + predict(inputs, config3) { + return this.execute(inputs, this.outputNodes); + } + normalizeInputs(inputs) { + if (!(inputs instanceof Tensor2) && !Array.isArray(inputs)) { + return inputs; + } + inputs = Array.isArray(inputs) ? inputs : [inputs]; + if (inputs.length !== this.inputNodes.length) { + throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${inputs.length} input tensors.`); + } + return this.inputNodes.reduce((map, inputName, i) => { + map[inputName] = inputs[i]; + return map; + }, {}); + } + normalizeOutputs(outputs) { + outputs = outputs || this.outputNodes; + return !Array.isArray(outputs) ? [outputs] : outputs; + } + execute(inputs, outputs) { + inputs = this.normalizeInputs(inputs); + outputs = this.normalizeOutputs(outputs); + const result = this.executor.execute(inputs, outputs); + return result.length > 1 ? result : result[0]; + } + async executeAsync(inputs, outputs) { + inputs = this.normalizeInputs(inputs); + outputs = this.normalizeOutputs(outputs); + const result = await this.executor.executeAsync(inputs, outputs); + return result.length > 1 ? result : result[0]; + } + convertTensorMapToTensorsMap(map) { + return Object.keys(map).reduce((newMap, key) => { + newMap[key] = [map[key]]; + return newMap; + }, {}); + } + dispose() { + this.executor.dispose(); + if (this.initializer) { + this.initializer.dispose(); + } + this.resourceManager.dispose(); + } +}; +async function loadGraphModel2(modelUrl, options3 = {}) { + if (modelUrl == null) { + throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model"); + } + if (options3 == null) { + options3 = {}; + } + if (options3.fromTFHub) { + if (modelUrl.load == null) { + if (!modelUrl.endsWith("/")) { + modelUrl = modelUrl + "/"; + } + modelUrl = `${modelUrl}${DEFAULT_MODEL_NAME2}${TFHUB_SEARCH_PARAM2}`; + } + } + const model15 = new GraphModel2(modelUrl, options3); + await model15.load(); + return model15; +} + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/dataset.js +var seedrandom7 = __toModule(require_seedrandom8()); + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js +var seedrandom6 = __toModule(require_seedrandom8()); + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/util/deep_map.js +function deepMap2(input3, mapFn) { + return deepMapInternal2(input3, mapFn); +} +function deepMapInternal2(input3, mapFn, seen = new Map(), containedIn = new Set()) { + if (input3 == null) { + return null; + } + if (containedIn.has(input3)) { + throw new Error("Circular references are not supported."); + } + if (seen.has(input3)) { + return seen.get(input3); + } + const result = mapFn(input3); + if (result.recurse && result.value !== null) { + throw new Error("A deep map function may not return both a value and recurse=true."); + } + if (!result.recurse) { + seen.set(input3, result.value); + return result.value; + } else if (isIterable4(input3)) { + const mappedIterable = Array.isArray(input3) ? [] : {}; + containedIn.add(input3); + for (const k in input3) { + const child = input3[k]; + const childResult = deepMapInternal2(child, mapFn, seen, containedIn); + mappedIterable[k] = childResult; + } + containedIn.delete(input3); + return mappedIterable; + } else { + throw new Error(`Can't recurse into non-iterable type: ${input3}`); + } +} +function deepZip2(inputs, zipFn = zipToList2) { + return deepZipInternal2(inputs, zipFn); +} +function deepZipInternal2(inputs, zipFn, containedIn = new Set()) { + const input3 = inputs[0]; + if (containedIn.has(input3)) { + throw new Error("Circular references are not supported."); + } + const result = zipFn(inputs); + if (result.recurse && result.value !== null) { + throw new Error("A deep zip function may not return both a value and recurse=true."); + } + if (!result.recurse) { + return result.value; + } else if (isIterable4(input3)) { + const mappedIterable = Array.isArray(input3) ? [] : {}; + containedIn.add(input3); + for (const k in input3) { + const children = inputs.map((x) => x[k]); + const childResult = deepZipInternal2(children, zipFn, containedIn); + mappedIterable[k] = childResult; + } + containedIn.delete(input3); + return mappedIterable; + } else { + throw new Error(`Can't recurse into non-iterable type: ${input3}`); + } +} +function zipToList2(x) { + if (x === null) { + return null; + } + if (isIterable4(x[0])) { + return { value: null, recurse: true }; + } else { + return { value: x, recurse: false }; + } +} +function isIterable4(obj) { + let isTextDecoder = false; + if (env3().get("IS_BROWSER")) { + isTextDecoder = obj instanceof TextDecoder; + } else { + const { StringDecoder } = require_string_decoder2(); + isTextDecoder = obj instanceof StringDecoder; + } + return obj != null && !ArrayBuffer.isView(obj) && (Array.isArray(obj) || typeof obj === "object" && !(obj instanceof Tensor2) && !(obj instanceof Promise) && !isTextDecoder); +} +function canTensorify2(obj) { + return obj == null || isPrimitive2(obj) || Array.isArray(obj) || typeof obj === "object" && obj instanceof Tensor2 || util_exports2.isTypedArray(obj); +} +function isPrimitive2(value) { + return value === null || typeof value !== "object" && typeof value !== "function"; +} + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/util/deep_clone.js +function deepClone2(container) { + return deepMap2(container, cloneIfTensor2); +} +function cloneIfTensor2(item) { + if (item instanceof Tensor2) { + return { value: item.clone(), recurse: false }; + } else if (isIterable4(item)) { + return { value: null, recurse: true }; + } else { + return { value: item, recurse: false }; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/util/ring_buffer.js +var RingBuffer2 = class { + constructor(capacity) { + this.capacity = capacity; + this.begin = 0; + this.end = 0; + if (capacity == null) { + throw new RangeError("Can't create a ring buffer of unknown capacity."); + } + if (capacity < 1) { + throw new RangeError("Can't create ring buffer of capacity < 1."); + } + this.data = new Array(capacity); + this.doubledCapacity = 2 * capacity; + } + wrap(index) { + while (index < 0) { + index += this.doubledCapacity; + } + return index % this.doubledCapacity; + } + get(index) { + if (index < 0) { + throw new RangeError("Can't get item at a negative index."); + } + return this.data[index % this.capacity]; + } + set(index, value) { + if (index < 0) { + throw new RangeError("Can't set item at a negative index."); + } + this.data[index % this.capacity] = value; + } + length() { + let length = this.end - this.begin; + if (length < 0) { + length = this.doubledCapacity + length; + } + return length; + } + isFull() { + return this.length() === this.capacity; + } + isEmpty() { + return this.length() === 0; + } + push(value) { + if (this.isFull()) { + throw new RangeError("Ring buffer is full."); + } + this.set(this.end, value); + this.end = this.wrap(this.end + 1); + } + pushAll(values) { + for (const value of values) { + this.push(value); + } + } + pop() { + if (this.isEmpty()) { + throw new RangeError("Ring buffer is empty."); + } + this.end = this.wrap(this.end - 1); + const result = this.get(this.end); + this.set(this.end, void 0); + return result; + } + unshift(value) { + if (this.isFull()) { + throw new RangeError("Ring buffer is full."); + } + this.begin = this.wrap(this.begin - 1); + this.set(this.begin, value); + } + shift() { + if (this.isEmpty()) { + throw new RangeError("Ring buffer is empty."); + } + const result = this.get(this.begin); + this.set(this.begin, void 0); + this.begin = this.wrap(this.begin + 1); + return result; + } + shuffleExcise(relativeIndex) { + if (this.isEmpty()) { + throw new RangeError("Ring buffer is empty."); + } + const index = this.wrap(this.begin + relativeIndex); + const result = this.get(index); + this.set(index, this.pop()); + return result; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/util/growing_ring_buffer.js +var GrowingRingBuffer2 = class extends RingBuffer2 { + constructor() { + super(GrowingRingBuffer2.INITIAL_CAPACITY); + } + isFull() { + return false; + } + push(value) { + if (super.isFull()) { + this.expand(); + } + super.push(value); + } + unshift(value) { + if (super.isFull()) { + this.expand(); + } + super.unshift(value); + } + expand() { + const newCapacity = this.capacity * 2; + const newData = new Array(newCapacity); + const len = this.length(); + for (let i = 0; i < len; i++) { + newData[i] = this.get(this.wrap(this.begin + i)); + } + this.data = newData; + this.capacity = newCapacity; + this.doubledCapacity = 2 * this.capacity; + this.begin = 0; + this.end = len; + } +}; +GrowingRingBuffer2.INITIAL_CAPACITY = 32; + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/iterators/lazy_iterator.js +function iteratorFromItems2(items) { + return new ArrayIterator2(items); +} +function iteratorFromFunction2(func3) { + return new FunctionCallIterator2(func3); +} +function iteratorFromConcatenated2(baseIterators, baseErrorHandler) { + return new ChainedIterator2(baseIterators, baseErrorHandler); +} +var LazyIterator2 = class { + async toArray() { + const result = []; + let x = await this.next(); + while (!x.done) { + result.push(x.value); + x = await this.next(); + } + return result; + } + async toArrayForTest() { + const stream = this.prefetch(100); + const result = []; + let x = await stream.next(); + while (!x.done) { + result.push(x.value); + x = await stream.next(); + } + return result; + } + async resolveFully() { + let x = await this.next(); + while (!x.done) { + x = await this.next(); + } + } + async resolveWhile(predicate) { + let x = await this.next(); + let shouldContinue = predicate(x.value); + while (!x.done && shouldContinue) { + x = await this.next(); + shouldContinue = predicate(x.value); + } + } + handleErrors(handler) { + return new ErrorHandlingLazyIterator2(this, handler); + } + filter(predicate) { + return new FilterIterator2(this, predicate); + } + map(transform8) { + return new MapIterator2(this, transform8); + } + mapAsync(transform8) { + return new AsyncMapIterator2(this, transform8); + } + serialMapAsync(transform8) { + return new AsyncMapIterator2(this, transform8).serial(); + } + flatmap(transform8) { + return new FlatmapIterator2(this, transform8); + } + async forEachAsync(f) { + return this.map(f).resolveFully(); + } + async serialForEach(f) { + return this.serialMapAsync(f).resolveWhile((x) => x === true); + } + rowMajorBatch(batchSize, smallLastBatch = true) { + return new RowMajorBatchIterator2(this, batchSize, smallLastBatch); + } + columnMajorBatch(batchSize, smallLastBatch = true, zipFn = zipToList2) { + const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); + return rowBatches.map((x) => deepZip2(x, zipFn)); + } + concatenate(iterator, baseErrorHandler) { + return new ChainedIterator2(iteratorFromItems2([this, iterator]), baseErrorHandler); + } + take(count4) { + if (count4 < 0 || count4 == null) { + return this; + } + return new TakeIterator2(this, count4); + } + skip(count4) { + if (count4 < 0 || count4 == null) { + return this; + } + return new SkipIterator2(this, count4); + } + prefetch(bufferSize) { + return new PrefetchIterator2(this, bufferSize); + } + shuffle(windowSize, seed) { + return new ShuffleIterator2(this, windowSize, seed); + } + serial() { + return new SerialIterator2(this); + } +}; +var ArrayIterator2 = class extends LazyIterator2 { + constructor(items) { + super(); + this.items = items; + this.trav = 0; + } + summary() { + return `Array of ${this.items.length} items`; + } + async next() { + if (this.trav >= this.items.length) { + return { value: null, done: true }; + } + const item = this.items[this.trav]; + this.trav++; + return { value: deepClone2(item), done: false }; + } +}; +var FunctionCallIterator2 = class extends LazyIterator2 { + constructor(nextFn) { + super(); + this.nextFn = nextFn; + } + summary() { + return `Function call`; + } + async next() { + try { + return this.nextFn(); + } catch (e) { + e.message = `Error thrown while iterating through a dataset: ${e.message}`; + throw e; + } + } +}; +var SerialIterator2 = class extends LazyIterator2 { + constructor(upstream) { + super(); + this.upstream = upstream; + this.lastRead = Promise.resolve({ value: null, done: false }); + } + summary() { + return `${this.upstream.summary()} -> Serial`; + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + return this.upstream.next(); + } +}; +var SkipIterator2 = class extends LazyIterator2 { + constructor(upstream, maxCount) { + super(); + this.upstream = upstream; + this.maxCount = maxCount; + this.count = 0; + this.lastRead = Promise.resolve({ value: null, done: false }); + } + summary() { + return `${this.upstream.summary()} -> Skip`; + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + while (this.count++ < this.maxCount) { + const skipped11 = await this.upstream.next(); + if (skipped11.done) { + return skipped11; + } + dispose2(skipped11.value); + } + return this.upstream.next(); + } +}; +var TakeIterator2 = class extends LazyIterator2 { + constructor(upstream, maxCount) { + super(); + this.upstream = upstream; + this.maxCount = maxCount; + this.count = 0; + } + summary() { + return `${this.upstream.summary()} -> Take`; + } + async next() { + if (this.count++ >= this.maxCount) { + return { value: null, done: true }; + } + return this.upstream.next(); + } +}; +var RowMajorBatchIterator2 = class extends LazyIterator2 { + constructor(upstream, batchSize, enableSmallLastBatch = true) { + super(); + this.upstream = upstream; + this.batchSize = batchSize; + this.enableSmallLastBatch = enableSmallLastBatch; + this.lastRead = Promise.resolve({ value: null, done: false }); + } + summary() { + return `${this.upstream.summary()} -> RowMajorBatch`; + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + const batch = []; + while (batch.length < this.batchSize) { + const item = await this.upstream.next(); + if (item.done) { + if (this.enableSmallLastBatch && batch.length > 0) { + return { value: batch, done: false }; + } + return { value: null, done: true }; + } + batch.push(item.value); + } + return { value: batch, done: false }; + } +}; +var FilterIterator2 = class extends LazyIterator2 { + constructor(upstream, predicate) { + super(); + this.upstream = upstream; + this.predicate = predicate; + this.lastRead = Promise.resolve({ value: null, done: false }); + } + summary() { + return `${this.upstream.summary()} -> Filter`; + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + while (true) { + const item = await this.upstream.next(); + if (item.done || this.predicate(item.value)) { + return item; + } + dispose2(item.value); + } + } +}; +var MapIterator2 = class extends LazyIterator2 { + constructor(upstream, transform8) { + super(); + this.upstream = upstream; + this.transform = transform8; + } + summary() { + return `${this.upstream.summary()} -> Map`; + } + async next() { + const item = await this.upstream.next(); + if (item.done) { + return { value: null, done: true }; + } + const inputTensors = tensor_util_exports2.getTensorsInContainer(item.value); + const mapped = this.transform(item.value); + const outputTensors = tensor_util_exports2.getTensorsInContainer(mapped); + for (const t of inputTensors) { + if (!tensor_util_exports2.isTensorInList(t, outputTensors)) { + t.dispose(); + } + } + return { value: mapped, done: false }; + } +}; +var ErrorHandlingLazyIterator2 = class extends LazyIterator2 { + constructor(upstream, handler) { + super(); + this.upstream = upstream; + this.handler = handler; + this.count = 0; + this.lastRead = Promise.resolve({ value: null, done: false }); + } + summary() { + return `${this.upstream.summary()} -> handleErrors`; + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + while (true) { + try { + return await this.upstream.next(); + } catch (e) { + if (!this.handler(e)) { + return { value: null, done: true }; + } + } + } + } +}; +var AsyncMapIterator2 = class extends LazyIterator2 { + constructor(upstream, transform8) { + super(); + this.upstream = upstream; + this.transform = transform8; + } + summary() { + return `${this.upstream.summary()} -> AsyncMap`; + } + async next() { + const item = await this.upstream.next(); + if (item.done) { + return { value: null, done: true }; + } + const inputTensors = tensor_util_exports2.getTensorsInContainer(item.value); + const mapped = await this.transform(item.value); + const outputTensors = tensor_util_exports2.getTensorsInContainer(mapped); + for (const t of inputTensors) { + if (!tensor_util_exports2.isTensorInList(t, outputTensors)) { + t.dispose(); + } + } + return { value: mapped, done: false }; + } +}; +var OneToManyIterator2 = class extends LazyIterator2 { + constructor() { + super(); + this.outputQueue = new GrowingRingBuffer2(); + this.lastRead = Promise.resolve({ value: null, done: false }); + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + async serialNext() { + while (this.outputQueue.length() === 0) { + if (!await this.pump()) { + return { value: null, done: true }; + } + } + return { value: this.outputQueue.shift(), done: false }; + } +}; +var FlatmapIterator2 = class extends OneToManyIterator2 { + constructor(upstream, transform8) { + super(); + this.upstream = upstream; + this.transform = transform8; + } + summary() { + return `${this.upstream.summary()} -> Flatmap`; + } + async pump() { + const item = await this.upstream.next(); + if (item.done) { + return false; + } + const inputTensors = tensor_util_exports2.getTensorsInContainer(item.value); + const mappedArray = this.transform(item.value); + const outputTensors = tensor_util_exports2.getTensorsInContainer(mappedArray); + this.outputQueue.pushAll(mappedArray); + for (const t of inputTensors) { + if (!tensor_util_exports2.isTensorInList(t, outputTensors)) { + t.dispose(); + } + } + return true; + } +}; +var ChainedIterator2 = class extends LazyIterator2 { + constructor(iterators, baseErrorHandler) { + super(); + this.baseErrorHandler = baseErrorHandler; + this.lastRead = null; + this.iterator = null; + this.moreIterators = iterators; + } + summary() { + const upstreamSummaries = "TODO: fill in upstream of chained summaries"; + return `${upstreamSummaries} -> Chained`; + } + async next() { + this.lastRead = this.readFromChain(this.lastRead); + return this.lastRead; + } + async readFromChain(lastRead) { + await lastRead; + if (this.iterator == null) { + const iteratorResult = await this.moreIterators.next(); + if (iteratorResult.done) { + return { value: null, done: true }; + } + this.iterator = iteratorResult.value; + if (this.baseErrorHandler != null) { + this.iterator = this.iterator.handleErrors(this.baseErrorHandler); + } + } + const itemResult = await this.iterator.next(); + if (itemResult.done) { + this.iterator = null; + return this.readFromChain(lastRead); + } + return itemResult; + } +}; +var ZipMismatchMode2; +(function(ZipMismatchMode3) { + ZipMismatchMode3[ZipMismatchMode3["FAIL"] = 0] = "FAIL"; + ZipMismatchMode3[ZipMismatchMode3["SHORTEST"] = 1] = "SHORTEST"; + ZipMismatchMode3[ZipMismatchMode3["LONGEST"] = 2] = "LONGEST"; +})(ZipMismatchMode2 || (ZipMismatchMode2 = {})); +var PrefetchIterator2 = class extends LazyIterator2 { + constructor(upstream, bufferSize) { + super(); + this.upstream = upstream; + this.bufferSize = bufferSize; + this.buffer = new RingBuffer2(bufferSize); + } + summary() { + return `${this.upstream.summary()} -> Prefetch`; + } + refill() { + while (!this.buffer.isFull()) { + const v = this.upstream.next(); + this.buffer.push(v); + } + } + next() { + this.refill(); + return this.buffer.shift(); + } +}; +var ShuffleIterator2 = class extends PrefetchIterator2 { + constructor(upstream, windowSize, seed) { + super(upstream, windowSize); + this.upstream = upstream; + this.windowSize = windowSize; + this.upstreamExhausted = false; + this.random = seedrandom6.alea(seed || util_exports2.now().toString()); + this.lastRead = Promise.resolve({ value: null, done: false }); + } + async next() { + this.lastRead = this.lastRead.then(() => this.serialNext()); + return this.lastRead; + } + randomInt(max10) { + return Math.floor(this.random() * max10); + } + chooseIndex() { + return this.randomInt(this.buffer.length()); + } + async serialNext() { + if (!this.upstreamExhausted) { + this.refill(); + } + while (!this.buffer.isEmpty()) { + const chosenIndex = this.chooseIndex(); + const result = await this.buffer.shuffleExcise(chosenIndex); + if (result.done) { + this.upstreamExhausted = true; + } else { + this.refill(); + return result; + } + } + return { value: null, done: true }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/dataset.js +var Dataset2 = class { + constructor() { + this.size = null; + } + batch(batchSize, smallLastBatch = true) { + const base2 = this; + util_exports2.assert(batchSize > 0, () => `batchSize needs to be positive, but it is + ${batchSize}`); + let size2; + if (this.size === Infinity || this.size == null) { + size2 = this.size; + } else if (smallLastBatch) { + size2 = Math.ceil(this.size / batchSize); + } else { + size2 = Math.floor(this.size / batchSize); + } + return datasetFromIteratorFn2(async () => { + return (await base2.iterator()).columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat2); + }, size2); + } + concatenate(dataset) { + const base2 = this; + let size2; + if (this.size === Infinity || dataset.size === Infinity) { + size2 = Infinity; + } else if (this.size != null && dataset.size != null) { + size2 = this.size + dataset.size; + } else { + size2 = null; + } + return datasetFromIteratorFn2(async () => (await base2.iterator()).concatenate(await dataset.iterator()), size2); + } + filter(predicate) { + const base2 = this; + let size2; + if (this.size === Infinity) { + size2 = Infinity; + } else { + size2 = null; + } + return datasetFromIteratorFn2(async () => { + return (await base2.iterator()).filter((x) => tidy2(() => predicate(x))); + }, size2); + } + async forEachAsync(f) { + return (await this.iterator()).forEachAsync(f); + } + map(transform8) { + const base2 = this; + return datasetFromIteratorFn2(async () => { + return (await base2.iterator()).map((x) => tidy2(() => transform8(x))); + }, this.size); + } + mapAsync(transform8) { + const base2 = this; + return datasetFromIteratorFn2(async () => { + return (await base2.iterator()).mapAsync(transform8); + }, this.size); + } + prefetch(bufferSize) { + if (bufferSize == null) { + throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified."); + } + const base2 = this; + return datasetFromIteratorFn2(async () => (await base2.iterator()).prefetch(bufferSize), this.size); + } + repeat(count4) { + const base2 = this; + let size2; + if (this.size != null && count4 > 0) { + size2 = this.size * count4; + } else if (count4 === 0) { + size2 = 0; + } else if (this.size != null && (count4 === void 0 || count4 < 0)) { + size2 = Infinity; + } else { + size2 = null; + } + return datasetFromIteratorFn2(async () => { + const iteratorIterator = iteratorFromFunction2(async () => ({ value: await base2.iterator(), done: false })); + return iteratorFromConcatenated2(iteratorIterator.take(count4)); + }, size2); + } + skip(count4) { + const base2 = this; + let size2; + if (this.size != null && count4 >= 0 && this.size >= count4) { + size2 = this.size - count4; + } else if (this.size != null && (this.size < count4 || count4 === void 0 || count4 < 0)) { + size2 = 0; + } else { + size2 = null; + } + return datasetFromIteratorFn2(async () => (await base2.iterator()).skip(count4), size2); + } + shuffle(bufferSize, seed, reshuffleEachIteration = true) { + if (bufferSize == null || bufferSize < 0) { + if (this.size == null) { + throw new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."); + } else { + throw new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`); + } + } + const base2 = this; + const random = seedrandom7.alea(seed || util_exports2.now().toString()); + return datasetFromIteratorFn2(async () => { + let seed2 = random.int32(); + if (reshuffleEachIteration) { + seed2 += random.int32(); + } + return (await base2.iterator()).shuffle(bufferSize, seed2.toString()); + }, this.size); + } + take(count4) { + const base2 = this; + let size2; + if (this.size != null && this.size > count4) { + size2 = count4; + } else if (this.size != null && this.size <= count4) { + size2 = this.size; + } else { + size2 = null; + } + return datasetFromIteratorFn2(async () => (await base2.iterator()).take(count4), size2); + } + async toArray() { + if (this.size === Infinity) { + throw new Error("Can not convert infinite data stream to array."); + } + return (await this.iterator()).toArray(); + } + async toArrayForTest() { + if (this.size === Infinity) { + throw new Error("Can not convert infinite data stream to array."); + } + return (await this.iterator()).toArrayForTest(); + } +}; +Dataset2.MAX_BUFFER_SIZE = 1e4; +function datasetFromIteratorFn2(iteratorFn, size2 = null) { + return new class extends Dataset2 { + constructor() { + super(...arguments); + this.size = size2; + } + async iterator() { + return iteratorFn(); + } + }(); +} +function deepBatchConcat2(rows) { + if (rows === null) { + return null; + } + const exampleRow = rows[0]; + if (canTensorify2(exampleRow)) { + const value = batchConcat2(rows); + return { value, recurse: false }; + } + return { value: null, recurse: true }; +} +function batchConcat2(arrays) { + if (arrays.length === 0) { + throw new Error("Can't make a batch of zero elements."); + } + if (arrays[0] instanceof Tensor2) { + return stack2(arrays); + } else { + return tensor2(arrays); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/dist/datasets/csv_dataset.js +var STATE_OUT2 = Symbol("out"); +var STATE_FIELD2 = Symbol("field"); +var STATE_QUOTE2 = Symbol("quote"); +var STATE_QUOTE_AFTER_QUOTE2 = Symbol("quoteafterquote"); +var STATE_WITHIN_QUOTE_IN_QUOTE2 = Symbol("quoteinquote"); + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/cpu_util.js +function assertNotComplex3(tensor3, opName) { + if (!Array.isArray(tensor3)) { + tensor3 = [tensor3]; + } + tensor3.forEach((t) => { + if (t != null) { + util_exports2.assert(t.dtype !== "complex64", () => `${opName} does not support complex64 tensors in the CPU backend.`); + } + }); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.js +var whereImpl5 = kernel_impls_exports2.whereImpl; +var MathBackendCPU2 = class extends KernelBackend2 { + constructor() { + super(); + this.blockSize = 48; + this.firstUse = true; + this.data = new DataStorage2(this, engine2()); + } + nextDataId() { + return MathBackendCPU2.nextDataId++; + } + write(values, shape, dtype) { + if (this.firstUse) { + this.firstUse = false; + if (env3().get("IS_NODE")) { + backend_util_exports2.warn("\n============================\nHi there \u{1F44B}. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"); + } + } + const dataId = { id: this.nextDataId() }; + this.data.set(dataId, { values, dtype, refCount: 1 }); + return dataId; + } + makeTensorInfo(shape, dtype, values) { + let outId; + if (dtype === "string" && values != null && values.length > 0 && util_exports2.isString(values[0])) { + const encodedValues = values.map((d) => util_exports2.encodeString(d)); + outId = this.write(encodedValues, shape, dtype); + } else { + outId = this.write(values, shape, dtype); + } + return { dataId: outId, shape, dtype }; + } + refCount(dataId) { + if (this.data.has(dataId)) { + const tensorData = this.data.get(dataId); + return tensorData.refCount; + } + return 0; + } + incRef(dataId) { + const tensorData = this.data.get(dataId); + tensorData.refCount++; + } + decRef(dataId) { + if (this.data.has(dataId)) { + const tensorData = this.data.get(dataId); + tensorData.refCount--; + } + } + move(dataId, values, shape, dtype, refCount) { + this.data.set(dataId, { values, dtype, refCount }); + } + numDataIds() { + return this.data.numDataIds(); + } + async read(dataId) { + return this.readSync(dataId); + } + readSync(dataId) { + const { dtype, complexTensorInfos } = this.data.get(dataId); + if (dtype === "complex64") { + const realValues = this.readSync(complexTensorInfos.real.dataId); + const imagValues = this.readSync(complexTensorInfos.imag.dataId); + return backend_util_exports2.mergeRealAndImagArrays(realValues, imagValues); + } + return this.data.get(dataId).values; + } + bufferSync(t) { + const data = this.readSync(t.dataId); + let decodedData = data; + if (t.dtype === "string") { + try { + decodedData = data.map((d) => util_exports2.decodeString(d)); + } catch (_a) { + throw new Error("Failed to decode encoded string bytes into utf-8"); + } + } + return buffer2(t.shape, t.dtype, decodedData); + } + makeOutput(values, shape, dtype) { + const dataId = this.write(values, shape, dtype); + return engine2().makeTensorFromDataId(dataId, shape, dtype, this); + } + disposeData(dataId, force = false) { + if (this.data.has(dataId)) { + this.data.get(dataId).refCount--; + if (!force && this.data.get(dataId).refCount > 0) { + return false; + } + const { complexTensorInfos } = this.data.get(dataId); + if (complexTensorInfos != null) { + this.disposeData(complexTensorInfos.real.dataId, true); + this.disposeData(complexTensorInfos.imag.dataId, true); + } + this.data.delete(dataId); + } + return true; + } + disposeIntermediateTensorInfo(tensorInfo) { + this.disposeData(tensorInfo.dataId); + } + async time(f) { + const start = util_exports2.now(); + f(); + const kernelMs = util_exports2.now() - start; + return { kernelMs }; + } + memory() { + return { + unreliable: true, + reasons: ["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."] + }; + } + where(condition) { + assertNotComplex3([condition], "where"); + const condVals = this.readSync(condition.dataId); + return whereImpl5(condition.shape, condVals); + } + dispose() { + } + floatPrecision() { + return 32; + } + epsilon() { + return super.epsilon(); + } +}; +MathBackendCPU2.nextDataId = 0; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.js +var shared_exports2 = {}; +__export(shared_exports2, { + addImpl: () => addImpl2, + bincountImpl: () => bincountImpl2, + bincountReduceImpl: () => bincountReduceImpl2, + ceilImpl: () => ceilImpl2, + concatImpl: () => concatImpl3, + equalImpl: () => equalImpl2, + expImpl: () => expImpl2, + expm1Impl: () => expm1Impl2, + floorImpl: () => floorImpl2, + gatherNdImpl: () => gatherNdImpl2, + gatherV2Impl: () => gatherV2Impl2, + greaterEqualImpl: () => greaterEqualImpl2, + greaterImpl: () => greaterImpl2, + lessEqualImpl: () => lessEqualImpl2, + lessImpl: () => lessImpl2, + linSpaceImpl: () => linSpaceImpl2, + logImpl: () => logImpl2, + maxImpl: () => maxImpl3, + maximumImpl: () => maximumImpl2, + minimumImpl: () => minimumImpl2, + multiplyImpl: () => multiplyImpl2, + negImpl: () => negImpl2, + notEqualImpl: () => notEqualImpl2, + prodImpl: () => prodImpl2, + rangeImpl: () => rangeImpl2, + rsqrtImpl: () => rsqrtImpl2, + sigmoidImpl: () => sigmoidImpl2, + simpleAbsImpl: () => simpleAbsImpl2, + sliceImpl: () => sliceImpl2, + sparseFillEmptyRowsImpl: () => sparseFillEmptyRowsImpl2, + sparseReshapeImpl: () => sparseReshapeImpl2, + sparseSegmentReductionImpl: () => sparseSegmentReductionImpl2, + sqrtImpl: () => sqrtImpl2, + squaredDifferenceImpl: () => squaredDifferenceImpl2, + stridedSliceImpl: () => stridedSliceImpl2, + stringNGramsImpl: () => stringNGramsImpl2, + stringSplitImpl: () => stringSplitImpl2, + stringToHashBucketFastImpl: () => stringToHashBucketFastImpl2, + subImpl: () => subImpl2, + tileImpl: () => tileImpl2, + topKImpl: () => topKImpl2, + transposeImpl: () => transposeImpl3, + uniqueImpl: () => uniqueImpl2 +}); + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Abs.js +function simpleAbsImpl2(vals) { + const resultValues = new Float32Array(vals.length); + for (let i = 0; i < vals.length; ++i) { + resultValues[i] = Math.abs(vals[i]); + } + return resultValues; +} +var abs5 = (args) => { + const { x } = args.inputs; + const cpuBackend = args.backend; + assertNotComplex3(x, "abs"); + let resultValues = new Float32Array(util_exports2.sizeFromShape(x.shape)); + const values = cpuBackend.data.get(x.dataId).values; + resultValues = simpleAbsImpl2(values); + return cpuBackend.makeOutput(resultValues, x.shape, "float32"); +}; +var absConfig4 = { + kernelName: Abs2, + backendName: "cpu", + kernelFunc: abs5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_impl.js +function createSimpleBinaryKernelImpl2(op3) { + return (aShape, bShape, aVals, bVals, dtype) => { + const newShape = backend_util_exports2.assertAndGetBroadcastShape(aShape, bShape); + const resultRank = newShape.length; + const resultStrides = util_exports2.computeStrides(newShape); + const resultSize = util_exports2.sizeFromShape(newShape); + const result = util_exports2.getTypedArrayFromDType(dtype, resultSize); + const aRank = aShape.length; + const bRank = bShape.length; + const aStrides = util_exports2.computeStrides(aShape); + const bStrides = util_exports2.computeStrides(bShape); + const aBroadcastDims = backend_util_exports2.getBroadcastDims(aShape, newShape); + const bBroadcastDims = backend_util_exports2.getBroadcastDims(bShape, newShape); + if (aBroadcastDims.length + bBroadcastDims.length === 0) { + for (let i = 0; i < result.length; ++i) { + result[i] = op3(aVals[i % aVals.length], bVals[i % bVals.length]); + } + } else { + for (let i = 0; i < result.length; ++i) { + const loc = util_exports2.indexToLoc(i, resultRank, resultStrides); + const aLoc = loc.slice(-aRank); + aBroadcastDims.forEach((d) => aLoc[d] = 0); + const aIndex = util_exports2.locToIndex(aLoc, aRank, aStrides); + const bLoc = loc.slice(-bRank); + bBroadcastDims.forEach((d) => bLoc[d] = 0); + const bIndex = util_exports2.locToIndex(bLoc, bRank, bStrides); + result[i] = op3(aVals[aIndex], bVals[bIndex]); + } + } + return [result, newShape]; + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Complex.js +function complex5(args) { + const { inputs, backend: backend4 } = args; + const { real: real7, imag: imag7 } = inputs; + const realVals = backend4.data.get(real7.dataId).values; + const imagVals = backend4.data.get(imag7.dataId).values; + const complexInfo = backend4.makeTensorInfo(real7.shape, "complex64"); + const complex7 = backend4.data.get(complexInfo.dataId); + complex7.complexTensorInfos = { + real: backend4.makeTensorInfo(real7.shape, "float32", realVals), + imag: backend4.makeTensorInfo(imag7.shape, "float32", imagVals) + }; + return complexInfo; +} +var complexConfig3 = { + kernelName: Complex2, + backendName: "cpu", + kernelFunc: complex5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/zeros_impl.js +function zeros5(backend4, shape, dtype = "float32") { + if (dtype === "complex64") { + const real7 = zeros5(backend4, shape, "float32"); + const imag7 = zeros5(backend4, shape, "float32"); + return complex5({ inputs: { real: real7, imag: imag7 }, backend: backend4 }); + } + const values = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(shape), dtype); + return backend4.makeTensorInfo(shape, dtype, values); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Identity.js +function identity5(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + backend4.incRef(x.dataId); + return { dataId: x.dataId, shape: x.shape, dtype: x.dtype }; +} +var identityConfig4 = { + kernelName: Identity3, + backendName: "cpu", + kernelFunc: identity5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Real.js +function real5(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const real7 = backend4.data.get(input3.dataId).complexTensorInfos.real; + const realVal = backend4.data.get(real7.dataId).values; + return backend4.makeTensorInfo(real7.shape, real7.dtype, realVal); +} +var realConfig3 = { + kernelName: Real2, + backendName: "cpu", + kernelFunc: real5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Cast.js +function cast8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { dtype } = attrs; + if (dtype === "complex64") { + if (x.dtype === "complex64") { + return identity5({ inputs: { x }, backend: backend4 }); + } + const zerosTensorInfo = zeros5(backend4, x.shape, x.dtype); + const floatX = cast8({ inputs: { x }, backend: backend4, attrs: { dtype: "float32" } }); + const result = complex5({ inputs: { real: floatX, imag: zerosTensorInfo }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(zerosTensorInfo); + backend4.disposeIntermediateTensorInfo(floatX); + return result; + } + if (x.dtype === "complex64") { + const realPart = real5({ inputs: { input: x }, backend: backend4 }); + const result = cast8({ inputs: { x: realPart }, backend: backend4, attrs: { dtype } }); + backend4.disposeIntermediateTensorInfo(realPart); + return result; + } + if (!util_exports2.hasEncodingLoss(x.dtype, dtype)) { + const result = identity5({ inputs: { x }, backend: backend4 }); + return { dataId: result.dataId, shape: result.shape, dtype }; + } + if (dtype === "int32") { + const values = backend4.data.get(x.dataId).values; + const resultValues = Int32Array.from(values); + return backend4.makeTensorInfo(x.shape, "int32", resultValues); + } + if (dtype === "bool") { + const xVals = backend4.data.get(x.dataId).values; + const zero = util_exports2.toTypedArray([0], x.dtype); + const [resultData, resultShape] = createSimpleBinaryKernelImpl2((a, b) => a !== b ? 1 : 0)(x.shape, [], xVals, zero, "bool"); + return backend4.makeTensorInfo(resultShape, "bool", resultData); + } + throw new Error(`Error in Cast: failed to cast ${x.dtype} to ${dtype}`); +} +var castConfig4 = { + kernelName: Cast2, + backendName: "cpu", + kernelFunc: cast8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_utils.js +function binaryKernelFunc3(name, simpleImpl, complexImpl, dtype) { + if (complexImpl == null) { + return ({ inputs, backend: backend4 }) => { + const { a, b } = inputs; + const cpuBackend = backend4; + assertNotComplex3([a, b], name); + const aVals = cpuBackend.data.get(a.dataId).values; + const bVals = cpuBackend.data.get(b.dataId).values; + const decodedAVals = a.dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(aVals) : aVals; + const decodedBVals = a.dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(bVals) : bVals; + const $dtype = dtype || a.dtype; + const [resultData, resultShape] = simpleImpl(a.shape, b.shape, decodedAVals, decodedBVals, $dtype); + return cpuBackend.makeTensorInfo(resultShape, $dtype, resultData); + }; + } + return ({ inputs, backend: backend4 }) => { + const { a, b } = inputs; + const cpuBackend = backend4; + if (a.dtype === "complex64" || b.dtype === "complex64") { + const $aComplex = cast8({ inputs: { x: a }, backend: cpuBackend, attrs: { dtype: "complex64" } }); + const $aComplexVals = cpuBackend.data.get($aComplex.dataId); + const aReal = $aComplexVals.complexTensorInfos.real; + const aImag = $aComplexVals.complexTensorInfos.imag; + const aRealVals = cpuBackend.data.get(aReal.dataId).values; + const aImagVals = cpuBackend.data.get(aImag.dataId).values; + const $bComplex = cast8({ inputs: { x: b }, backend: cpuBackend, attrs: { dtype: "complex64" } }); + const $bComplexVals = cpuBackend.data.get($bComplex.dataId); + const bReal = $bComplexVals.complexTensorInfos.real; + const bImag = $bComplexVals.complexTensorInfos.imag; + const bRealVals = cpuBackend.data.get(bReal.dataId).values; + const bImagVals = cpuBackend.data.get(bImag.dataId).values; + const [resultRealData, resultImagData, resultShape] = complexImpl(a.shape, b.shape, aRealVals, aImagVals, bRealVals, bImagVals); + const resultReal = cpuBackend.makeTensorInfo(resultShape, "float32", resultRealData); + const resultImag = cpuBackend.makeTensorInfo(resultShape, "float32", resultImagData); + const result = complex5({ inputs: { real: resultReal, imag: resultImag }, backend: cpuBackend }); + cpuBackend.disposeIntermediateTensorInfo($aComplex); + cpuBackend.disposeIntermediateTensorInfo($bComplex); + cpuBackend.disposeIntermediateTensorInfo(resultReal); + cpuBackend.disposeIntermediateTensorInfo(resultImag); + return result; + } else { + const aVals = cpuBackend.data.get(a.dataId).values; + const bVals = cpuBackend.data.get(b.dataId).values; + const $dtype = dtype || a.dtype; + const [resultData, resultShape] = simpleImpl(a.shape, b.shape, aVals, bVals, $dtype); + return cpuBackend.makeTensorInfo(resultShape, $dtype, resultData); + } + }; +} +function createComplexBinaryKernelImpl2(op3) { + return (aShape, bShape, aRealVals, aImagVals, bRealVals, bImagVals) => { + const resultShape = backend_util_exports2.assertAndGetBroadcastShape(aShape, bShape); + const resultSize = util_exports2.sizeFromShape(resultShape); + const resultRank = resultShape.length; + const resultStrides = util_exports2.computeStrides(resultShape); + const resultRealVals = util_exports2.getTypedArrayFromDType("float32", resultSize); + const resultImagVals = util_exports2.getTypedArrayFromDType("float32", resultSize); + const aBroadcastDims = backend_util_exports2.getBroadcastDims(aShape, resultShape); + const bBroadcastDims = backend_util_exports2.getBroadcastDims(bShape, resultShape); + const aVals = backend_util_exports2.mergeRealAndImagArrays(aRealVals, aImagVals); + const bVals = backend_util_exports2.mergeRealAndImagArrays(bRealVals, bImagVals); + const aRank = aShape.length; + const aStrides = util_exports2.computeStrides(aShape); + const bRank = bShape.length; + const bStrides = util_exports2.computeStrides(bShape); + if (aBroadcastDims.length + bBroadcastDims.length === 0) { + for (let i = 0; i < resultRealVals.length; i++) { + const aIdx = i % aVals.length; + const bIdx = i % bVals.length; + const result = op3(aVals[aIdx * 2], aVals[aIdx * 2 + 1], bVals[bIdx * 2], bVals[bIdx * 2 + 1]); + resultRealVals[i] = result.real; + resultImagVals[i] = result.imag; + } + } else { + for (let i = 0; i < resultRealVals.length; i++) { + const loc = util_exports2.indexToLoc(i, resultRank, resultStrides); + const aLoc = loc.slice(-aRank); + aBroadcastDims.forEach((d) => aLoc[d] = 0); + const aIndex = util_exports2.locToIndex(aLoc, aRank, aStrides); + const bLoc = loc.slice(-bRank); + bBroadcastDims.forEach((d) => bLoc[d] = 0); + const bIndex = util_exports2.locToIndex(bLoc, bRank, bStrides); + const opResult = op3(aVals[aIndex * 2], aVals[aIndex * 2 + 1], bVals[bIndex * 2], bVals[bIndex * 2 + 1]); + resultRealVals[i] = opResult.real; + resultImagVals[i] = opResult.imag; + } + } + return [resultRealVals, resultImagVals, resultShape]; + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Add.js +var addImpl2 = createSimpleBinaryKernelImpl2((a, b) => a + b); +var addComplexImpl2 = createComplexBinaryKernelImpl2((aReal, aImag, bReal, bImag) => { + return { real: aReal + bReal, imag: aImag + bImag }; +}); +var add7 = binaryKernelFunc3(Add3, addImpl2, addComplexImpl2); +var addConfig4 = { + kernelName: Add3, + backendName: "cpu", + kernelFunc: add7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Bincount_impl.js +function bincountImpl2(xVals, weightsVals, weightsDtype, weightsShape, size2) { + const weightsSize = util_exports2.sizeFromShape(weightsShape); + const outVals = util_exports2.makeZerosTypedArray(size2, weightsDtype); + for (let i = 0; i < xVals.length; i++) { + const value = xVals[i]; + if (value < 0) { + throw new Error("Input x must be non-negative!"); + } + if (value >= size2) { + continue; + } + if (weightsSize > 0) { + outVals[value] += weightsVals[i]; + } else { + outVals[value] += 1; + } + } + return outVals; +} +function bincountReduceImpl2(xBuf, weightsBuf, size2, binaryOutput = false) { + const numRows = xBuf.shape[0]; + const numCols = xBuf.shape[1]; + const outBuf = buffer2([numRows, size2], weightsBuf.dtype); + for (let i = 0; i < numRows; i++) { + for (let j = 0; j < numCols; j++) { + const value = xBuf.get(i, j); + if (value < 0) { + throw new Error("Input x must be non-negative!"); + } + if (value >= size2) { + continue; + } + if (binaryOutput) { + outBuf.set(1, i, value); + } else { + if (weightsBuf.size > 0) { + outBuf.set(outBuf.get(i, value) + weightsBuf.get(i, j), i, value); + } else { + outBuf.set(outBuf.get(i, value) + 1, i, value); + } + } + } + } + return outBuf; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_impl.js +function createSimpleUnaryImpl2(op3) { + return (values, dtype, attrs) => { + const newValues = util_exports2.getTypedArrayFromDType(dtype, values.length); + for (let i = 0; i < values.length; ++i) { + newValues[i] = op3(values[i], attrs); + } + return newValues; + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_utils.js +function unaryKernelFunc3(name, op3, dtype) { + return ({ inputs, attrs, backend: backend4 }) => { + const { x } = inputs; + assertNotComplex3(x, name); + if (x.dtype === "string" || dtype === "string") { + throw new Error("unaryKernelFunc does not support string input/output"); + } + const cpuBackend = backend4; + const values = cpuBackend.data.get(x.dataId).values; + const xSize = util_exports2.sizeFromShape(x.shape); + const $dtype = dtype || x.dtype; + const newValues = util_exports2.getArrayFromDType($dtype, xSize); + for (let i = 0; i < xSize; ++i) { + newValues[i] = op3(values[i], attrs); + } + return cpuBackend.makeTensorInfo(x.shape, $dtype, newValues); + }; +} +function unaryKernelFuncFromImpl2(name, unaryImpl, dtype) { + return ({ inputs, attrs, backend: backend4 }) => { + const { x } = inputs; + assertNotComplex3(x, name); + if (x.dtype === "string" || dtype === "string") { + throw new Error("unaryKernelFunc does not support string input/output"); + } + const cpuBackend = backend4; + const values = cpuBackend.data.get(x.dataId).values; + const $dtype = dtype || x.dtype; + const newValues = unaryImpl(values, $dtype, attrs); + return cpuBackend.makeTensorInfo(x.shape, $dtype, newValues); + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Ceil.js +var ceilImpl2 = createSimpleUnaryImpl2((xi) => Math.ceil(xi)); +var ceil5 = unaryKernelFuncFromImpl2(Ceil2, ceilImpl2); +var ceilConfig4 = { + kernelName: Ceil2, + backendName: "cpu", + kernelFunc: ceil5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Concat_impl.js +function concatImpl3(inputs, outShape, dtype, simplyConcat) { + const outVals = util_exports2.getArrayFromDType(dtype, util_exports2.sizeFromShape(outShape)); + if (simplyConcat && dtype !== "string") { + let offset = 0; + inputs.forEach((input3) => { + const size2 = util_exports2.sizeFromShape(input3.shape); + outVals.set(input3.vals, offset); + offset += size2; + }); + } else { + let colOffset = 0; + inputs.forEach((input3) => { + const decodedData = dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(input3.vals) : input3.vals; + let tIdx = 0; + for (let row = 0; row < input3.shape[0]; ++row) { + const resIdx = row * outShape[1] + colOffset; + for (let col = 0; col < input3.shape[1]; ++col) { + outVals[resIdx + col] = decodedData[tIdx++]; + } + } + colOffset += input3.shape[1]; + }); + } + return outVals; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Equal.js +var equalImpl2 = createSimpleBinaryKernelImpl2((a, b) => a === b ? 1 : 0); +var equal5 = binaryKernelFunc3(Equal2, equalImpl2, null, "bool"); +var equalConfig4 = { + kernelName: Equal2, + backendName: "cpu", + kernelFunc: equal5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Exp.js +var expImpl2 = createSimpleUnaryImpl2((xi) => Math.exp(xi)); +var exp5 = unaryKernelFuncFromImpl2(Exp2, expImpl2); +var expConfig4 = { + kernelName: Exp2, + backendName: "cpu", + kernelFunc: exp5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Expm1.js +var expm1Impl2 = createSimpleUnaryImpl2((xi) => Math.expm1(xi)); +var expm15 = unaryKernelFuncFromImpl2(Expm12, expm1Impl2); +var expm1Config3 = { + kernelName: Expm12, + backendName: "cpu", + kernelFunc: expm15 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Floor.js +var floorImpl2 = createSimpleUnaryImpl2((xi) => Math.floor(xi)); +var floor5 = unaryKernelFuncFromImpl2(Floor2, floorImpl2); +var floorConfig4 = { + kernelName: Floor2, + backendName: "cpu", + kernelFunc: floor5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/GatherNd_Impl.js +function gatherNdImpl2(indicesData, paramsBuf, dtype, numSlices, sliceRank, sliceSize, strides, paramsShape, paramsSize) { + const outBuf = buffer2([numSlices, sliceSize], dtype); + for (let i = 0; i < numSlices; i++) { + const index = []; + let flattenIndex = 0; + for (let j = 0; j < sliceRank; j++) { + const dim = indicesData[i * sliceRank + j]; + flattenIndex += dim * strides[j]; + index.push(dim); + } + if (flattenIndex < 0 || flattenIndex >= paramsSize / sliceSize) { + throw new Error(`Invalid indices: ${index} does not index into ${paramsShape}`); + } + for (let k = 0; k < sliceSize; k++) { + outBuf.values[i * sliceSize + k] = paramsBuf.get(...paramsBuf.indexToLoc(flattenIndex * sliceSize + k)); + } + } + return outBuf; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/GatherV2_impl.js +function gatherV2Impl2(xBuf, indicesBuf, flattenOutputShape) { + const outBuf = buffer2(flattenOutputShape, xBuf.dtype); + for (let i = 0; i < outBuf.size; ++i) { + const newLoc = outBuf.indexToLoc(i); + const originalLoc = newLoc.slice(); + const batchIdx = originalLoc[0]; + const indicesIdx = originalLoc[2]; + const indicesIndex = indicesBuf.locToIndex([batchIdx, indicesIdx]); + originalLoc[2] = indicesBuf.values[indicesIndex]; + const originalIndex = xBuf.locToIndex(originalLoc); + outBuf.values[i] = xBuf.values[originalIndex]; + } + return outBuf; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Greater.js +var greaterImpl2 = createSimpleBinaryKernelImpl2((a, b) => a > b ? 1 : 0); +var greater6 = binaryKernelFunc3(Greater2, greaterImpl2, null, "bool"); +var greaterConfig4 = { + kernelName: Greater2, + backendName: "cpu", + kernelFunc: greater6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/GreaterEqual.js +var greaterEqualImpl2 = createSimpleBinaryKernelImpl2((a, b) => a >= b ? 1 : 0); +var greaterEqual5 = binaryKernelFunc3(GreaterEqual2, greaterEqualImpl2, null, "bool"); +var greaterEqualConfig4 = { + kernelName: GreaterEqual2, + backendName: "cpu", + kernelFunc: greaterEqual5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Less.js +var lessImpl2 = createSimpleBinaryKernelImpl2((a, b) => a < b ? 1 : 0); +var less6 = binaryKernelFunc3(Less2, lessImpl2, null, "bool"); +var lessConfig4 = { + kernelName: Less2, + backendName: "cpu", + kernelFunc: less6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LessEqual.js +var lessEqualImpl2 = createSimpleBinaryKernelImpl2((a, b) => a <= b ? 1 : 0); +var lessEqual5 = binaryKernelFunc3(LessEqual2, lessEqualImpl2, null, "bool"); +var lessEqualConfig4 = { + kernelName: LessEqual2, + backendName: "cpu", + kernelFunc: lessEqual5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LinSpace_impl.js +function linSpaceImpl2(start, stop, num) { + const step8 = (stop - start) / (num - 1); + const values = util_exports2.makeZerosTypedArray(num, "float32"); + values[0] = start; + for (let i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step8; + } + return values; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Log.js +var logImpl2 = createSimpleUnaryImpl2((xi) => Math.log(xi)); +var log11 = unaryKernelFuncFromImpl2(Log2, logImpl2); +var logConfig4 = { + kernelName: Log2, + backendName: "cpu", + kernelFunc: log11 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Max_impl.js +function maxImpl3(aVals, reduceSize, outShape, dtype) { + const vals = util_exports2.getTypedArrayFromDType(dtype, util_exports2.sizeFromShape(outShape)); + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let max10 = aVals[offset]; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + if (Number.isNaN(value) || value > max10) { + max10 = value; + } + } + vals[i] = max10; + } + return vals; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Maximum.js +var maximumImpl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => Math.max(aValue, bValue)); +var maximum6 = binaryKernelFunc3(Maximum3, maximumImpl2); +var maximumConfig4 = { + kernelName: Maximum3, + backendName: "cpu", + kernelFunc: maximum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Minimum.js +var minimumImpl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => Math.min(aValue, bValue)); +var minimum6 = binaryKernelFunc3(Minimum3, minimumImpl2); +var minimumConfig4 = { + kernelName: Minimum3, + backendName: "cpu", + kernelFunc: minimum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Multiply.js +var multiplyImpl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => aValue * bValue); +var multiplyComplexImpl2 = createComplexBinaryKernelImpl2((aReal, aImag, bReal, bImag) => { + return { + real: aReal * bReal - aImag * bImag, + imag: aReal * bImag + aImag * bReal + }; +}); +var multiply4 = binaryKernelFunc3(Multiply3, multiplyImpl2, multiplyComplexImpl2); +var multiplyConfig4 = { + kernelName: Multiply3, + backendName: "cpu", + kernelFunc: multiply4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Neg.js +function negImpl2(xVals, xShape, xDtype) { + const minusOne = util_exports2.createScalarValue(-1, xDtype); + return multiplyImpl2([], xShape, minusOne, xVals, xDtype); +} +function neg5(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + assertNotComplex3(x, "neg"); + const xVals = backend4.data.get(x.dataId).values; + const [res, newShape] = negImpl2(xVals, x.shape, x.dtype); + return backend4.makeTensorInfo(newShape, x.dtype, res); +} +var negConfig4 = { + kernelName: Neg2, + backendName: "cpu", + kernelFunc: neg5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/NotEqual.js +var notEqualImpl2 = createSimpleBinaryKernelImpl2((a, b) => a !== b ? 1 : 0); +var notEqual5 = binaryKernelFunc3(NotEqual2, notEqualImpl2, null, "bool"); +var notEqualConfig4 = { + kernelName: NotEqual2, + backendName: "cpu", + kernelFunc: notEqual5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Transpose_impl.js +function transposeImpl3(xVals, xShape, dtype, perm, newShape) { + const xRank = xShape.length; + const xSize = util_exports2.sizeFromShape(xShape); + const xStrides = util_exports2.computeStrides(xShape); + const newStrides = util_exports2.computeStrides(newShape); + const result = util_exports2.getTypedArrayFromDType(dtype, util_exports2.sizeFromShape(newShape)); + for (let i = 0; i < xSize; ++i) { + const loc = util_exports2.indexToLoc(i, xRank, xStrides); + const newLoc = new Array(loc.length); + for (let i2 = 0; i2 < newLoc.length; i2++) { + newLoc[i2] = loc[perm[i2]]; + } + const newIndex = util_exports2.locToIndex(newLoc, xRank, newStrides); + result[newIndex] = xVals[i]; + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Transpose.js +function transpose6(args) { + const { inputs, attrs, backend: backend4 } = args; + const { x } = inputs; + const { perm } = attrs; + assertNotComplex3(x, "transpose"); + const xRank = x.shape.length; + const newShape = new Array(xRank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[perm[i]]; + } + const values = backend4.data.get(x.dataId).values; + const result = transposeImpl3(values, x.shape, x.dtype, perm, newShape); + const dataId = backend4.write(result, newShape, x.dtype); + return { dataId, shape: newShape, dtype: x.dtype }; +} +var transposeConfig4 = { + kernelName: Transpose2, + backendName: "cpu", + kernelFunc: transpose6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Prod.js +function prodImpl2(xShape, xDtype, xVals, reductionAxes) { + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(xShape, reductionAxes); + const outDtype = upcastType2(xDtype, "int32"); + const outVals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(outShape), outDtype); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + for (let i = 0; i < outVals.length; ++i) { + const offset = i * reduceSize; + let prod8 = 1; + for (let j = 0; j < reduceSize; ++j) { + prod8 *= xVals[offset + j]; + } + outVals[i] = prod8; + } + return { outVals, outShape, outDtype }; +} +function prod6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + assertNotComplex3(x, "prod"); + const xRank = x.shape.length; + const axes = util_exports2.parseAxisParam(axis, x.shape); + const permutation = backend_util_exports2.getAxesPermutation(axes, xRank); + let reductionAxes = axes; + let permutedX = x; + const intermediateTensorInfos = []; + if (permutation != null) { + permutedX = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutation } }); + intermediateTensorInfos.push(permutedX); + reductionAxes = backend_util_exports2.getInnerMostAxes(reductionAxes.length, xRank); + } + const xVals = backend4.data.get(permutedX.dataId).values; + const { outVals, outShape, outDtype } = prodImpl2(permutedX.shape, permutedX.dtype, xVals, reductionAxes); + let resultShape = outShape; + if (keepDims) { + resultShape = backend_util_exports2.expandShapeToKeepDim(outShape, axes); + } + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return backend4.makeTensorInfo(resultShape, outDtype, outVals); +} +var prodConfig4 = { + kernelName: Prod2, + backendName: "cpu", + kernelFunc: prod6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Range_impl.js +function rangeImpl2(start, stop, step8, dtype) { + const sameStartStop = start === stop; + const increasingRangeNegativeStep = start < stop && step8 < 0; + const decreasingRangePositiveStep = stop < start && step8 > 1; + if (sameStartStop || increasingRangeNegativeStep || decreasingRangePositiveStep) { + return util_exports2.makeZerosTypedArray(0, dtype); + } + const numElements = Math.abs(Math.ceil((stop - start) / step8)); + const values = util_exports2.makeZerosTypedArray(numElements, dtype); + if (stop < start && step8 === 1) { + step8 = -1; + } + values[0] = start; + for (let i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step8; + } + return values; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Rsqrt.js +var rsqrtImpl2 = createSimpleUnaryImpl2((xi) => 1 / Math.sqrt(xi)); +var rsqrt5 = unaryKernelFuncFromImpl2(Rsqrt2, rsqrtImpl2); +var rsqrtConfig4 = { + kernelName: Rsqrt2, + backendName: "cpu", + kernelFunc: rsqrt5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sigmoid.js +var sigmoidImpl2 = createSimpleUnaryImpl2((xi) => 1 / (1 + Math.exp(-xi))); +var sigmoid6 = unaryKernelFunc3(Sigmoid3, (xi) => 1 / (1 + Math.exp(-xi))); +var sigmoidConfig4 = { + kernelName: Sigmoid3, + backendName: "cpu", + kernelFunc: sigmoid6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Slice.js +function sliceImpl2(vals, begin, size2, shape, dtype) { + const isContinous = slice_util_exports2.isSliceContinous(shape, begin, size2); + const length = util_exports2.sizeFromShape(size2); + const xStrides = util_exports2.computeStrides(shape); + if (isContinous) { + const flatOffset = slice_util_exports2.computeFlatOffset(begin, xStrides); + if (dtype === "string") { + return vals.slice(flatOffset, flatOffset + length); + } + return vals.subarray(flatOffset, flatOffset + length); + } + const decodedData = dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(vals) : vals; + const inBuf = buffer2(shape, dtype, decodedData); + const outBuf = buffer2(size2, dtype); + for (let i = 0; i < outBuf.size; ++i) { + const outLoc = outBuf.indexToLoc(i); + const inLoc = outLoc.map((idx, j) => idx + begin[j]); + outBuf.set(inBuf.get(...inLoc), ...outLoc); + } + if (dtype === "string") { + return backend_util_exports2.fromStringArrayToUint8(outBuf.values); + } + return outBuf.values; +} +function slice6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { begin, size: size2 } = attrs; + assertNotComplex3(x, "slice"); + const [$begin, $size] = slice_util_exports2.parseSliceParams(x, begin, size2); + slice_util_exports2.assertParamsValid(x, $begin, $size); + const vals = backend4.data.get(x.dataId).values; + const outVals = sliceImpl2(vals, $begin, $size, x.shape, x.dtype); + return backend4.makeTensorInfo($size, x.dtype, outVals); +} +var sliceConfig4 = { + kernelName: Slice2, + backendName: "cpu", + kernelFunc: slice6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseFillEmptyRows_impl.js +function sparseFillEmptyRowsImpl2(indices, indicesShape, indicesDType, values, valuesDType, denseShape, defaultValue) { + const indicesCount = indicesShape[0]; + const denseRows = denseShape[0]; + const emptyRowIndicator = new Array(denseRows); + const reverseIndexMap = new Array(indicesCount); + const rank = indicesShape[1]; + if (denseRows === 0) { + if (indicesCount !== 0) { + throw new Error(`Received SparseTensor with denseShape[0] = 0 but + indices.shape[0] = ${indicesCount}`); + } + const outputIndices = util_exports2.getArrayFromDType(indicesDType, 0); + const outputValues = util_exports2.getArrayFromDType(valuesDType, 0); + return [ + outputIndices, + [0, rank], + outputValues, + emptyRowIndicator, + reverseIndexMap + ]; + } + let rowsAreOrdered = true; + let lastIndicesRow = 0; + const csrOffset = new Array(denseRows).fill(0); + for (let i = 0; i < indicesCount; ++i) { + const row = indices[i * rank]; + if (row < 0) { + throw new Error(`indices(${i}, 0) is invalid: ${row} < 0`); + } + if (row >= denseRows) { + throw new Error(`indices(${i}, 0) is invalid: ${row} >= ${denseRows}`); + } + ++csrOffset[row]; + rowsAreOrdered = rowsAreOrdered && row >= lastIndicesRow; + lastIndicesRow = row; + } + let allRowsFull = true; + for (let row = 0; row < denseRows; ++row) { + const rowEmpty = csrOffset[row] === 0; + emptyRowIndicator[row] = rowEmpty; + allRowsFull = allRowsFull && !rowEmpty; + csrOffset[row] = Math.max(csrOffset[row], 1); + if (row > 0) { + csrOffset[row] += csrOffset[row - 1]; + } + } + if (allRowsFull && rowsAreOrdered) { + const outputIndices = indices; + const outputValues = values; + for (let i = 0; i < indicesCount; ++i) { + reverseIndexMap[i] = i; + } + return [ + outputIndices, + [indicesCount, rank], + outputValues, + emptyRowIndicator, + reverseIndexMap + ]; + } else { + const fullIndicesCount = csrOffset[denseRows - 1]; + const outputIndices = util_exports2.getArrayFromDType(indicesDType, fullIndicesCount * rank); + const outputValues = util_exports2.getArrayFromDType(valuesDType, fullIndicesCount); + const filledCount = new Array(denseRows).fill(0); + for (let i = 0; i < indicesCount; ++i) { + const row = indices[i * rank]; + const offset = filledCount[row]; + const outputI = (row === 0 ? 0 : csrOffset[row - 1]) + offset; + filledCount[row]++; + for (let j = 0; j < rank; ++j) { + outputIndices[outputI * rank + j] = indices[i * rank + j]; + } + outputValues[outputI] = values[i]; + reverseIndexMap[i] = outputI; + } + for (let row = 0; row < denseRows; ++row) { + const rowCount = filledCount[row]; + if (rowCount === 0) { + const startingIndex = row === 0 ? 0 : csrOffset[row - 1]; + outputIndices[startingIndex * rank + 0] = row; + for (let col = 1; col < rank; ++col) { + outputIndices[startingIndex * rank + col] = 0; + } + outputValues[startingIndex] = defaultValue; + } + } + return [ + outputIndices, + [fullIndicesCount, rank], + outputValues, + emptyRowIndicator, + reverseIndexMap + ]; + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseReshape_impl.js +function sparseReshapeImpl2(inputIndices, inputIndicesShape, inputDType, inputShape, targetShape) { + const denseSize = util_exports2.sizeFromShape(inputShape); + const nnz = inputIndicesShape[0]; + const outputRank = targetShape.length; + const outputShape = []; + let product = 1; + let unknownIndex = -1; + for (let d = 0; d < outputRank; ++d) { + const size2 = targetShape[d]; + if (size2 === -1) { + if (unknownIndex !== -1) { + throw new Error(`only one output dimension may be -1, not both ${unknownIndex} and ${d}`); + } + unknownIndex = d; + outputShape.push(1); + } else { + if (size2 < 0) { + throw new Error(`size ${d} must be non-negative, not ${size2}`); + } + product *= size2; + outputShape.push(size2); + } + } + if (unknownIndex !== -1) { + if (product <= 0) { + throw new Error("reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"); + } + const missing = Math.trunc(denseSize / product); + if (product * missing !== denseSize) { + throw new Error(`Input to reshape is a SparseTensor with ${denseSize} + dense values, but the requested shape requires a multiple of ${product}. inputShape=${inputShape} outputShape= ${outputShape}`); + } + outputShape[unknownIndex] = missing; + } + const outputSize2 = util_exports2.sizeFromShape(outputShape); + if (outputSize2 !== denseSize) { + throw new Error(`Input to reshape is a tensor with ${denseSize} dense values, but the requested shape has ${outputSize2}. inputShape=${inputShape} outputShape=${outputShape}`); + } + const inputRank = inputShape.length; + const inputStrides = []; + if (inputRank > 0) { + inputStrides[inputRank - 1] = 1; + for (let d = inputRank - 2; d >= 0; --d) { + inputStrides[d] = inputStrides[d + 1] * inputShape[d + 1]; + } + } + const outputStrides = []; + if (outputRank > 0) { + outputStrides[outputRank - 1] = 1; + for (let d = outputRank - 2; d >= 0; --d) { + outputStrides[d] = outputStrides[d + 1] * outputShape[d + 1]; + } + } + const newIndices = util_exports2.getArrayFromDType(inputDType, nnz * outputRank); + for (let i = 0; i < nnz; ++i) { + let id = 0; + for (let j = 0; j < inputRank; ++j) { + id += inputIndices[i * inputRank + j] * inputStrides[j]; + } + for (let j = 0; j < outputRank; ++j) { + newIndices[i * outputRank + j] = Math.trunc(id / outputStrides[j]); + id %= outputStrides[j]; + } + } + return [newIndices, [nnz, outputRank], outputShape]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseSegmentReduction_impl.js +function sparseSegmentReductionImpl2(input3, inputShape, inputDType, indices, segmentIds, isMean = false, defaultValue = 0) { + const numIndices = indices.length; + if (numIndices !== segmentIds.length) { + throw new Error(`segmentIds and indices should have same size.`); + } + const inputFlat = [inputShape[0], input3.length / inputShape[0]]; + const numCol = inputFlat[1]; + const lastSegmentIdPlusOne = numIndices > 0 ? segmentIds[numIndices - 1] + 1 : 0; + const outputRows = lastSegmentIdPlusOne; + if (outputRows < 0) { + throw new Error(`segment ids must be >= 0`); + } + const outputShape = inputShape.slice(); + outputShape[0] = outputRows; + const outputLength = outputShape.reduce((product, value) => product * value, 1); + const output = util_exports2.getArrayFromDType(inputDType, outputLength); + if (numIndices === 0) { + if (outputRows > 0) { + output.fill(defaultValue); + } + return [output, outputShape]; + } + if (outputRows <= 0) { + throw new Error(`segment ids must be >= 0`); + } + let start = 0, end = 1; + let uninitializedIndex = 0; + let outIndex = segmentIds[start]; + while (true) { + let nextIndex = 0; + if (end < numIndices) { + nextIndex = segmentIds[end]; + if (outIndex === nextIndex) { + ++end; + continue; + } + if (outIndex >= nextIndex) { + throw new Error(`segment ids are not increasing`); + } + } + if (outIndex < 0 || outIndex >= outputRows) { + throw new Error(`Segment id ${outIndex} out of range [0, ${outputRows}), possibly because segmentIds input is not sorted.`); + } + if (outIndex > uninitializedIndex) { + output.fill(defaultValue, uninitializedIndex * numCol, outIndex * numCol); + } + for (let i = start; i < end; ++i) { + const index = indices[i]; + if (index < 0 || index >= inputFlat[0]) { + throw new Error(`Bad: indices[${i}] == ${indices[i]} out of range [0, ${inputFlat[0]})`); + } + for (let j = 0; j < numCol; j++) { + output[outIndex * numCol + j] += input3[index * numCol + j]; + } + } + if (isMean) { + for (let j = 0; j < numCol; j++) { + output[outIndex * numCol + j] /= end - start; + } + } + start = end; + ++end; + uninitializedIndex = outIndex + 1; + outIndex = nextIndex; + if (end > numIndices) { + break; + } + } + if (uninitializedIndex < outputRows) { + output.fill(defaultValue, uninitializedIndex * numCol, outputRows * numCol); + } + return [output, outputShape]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sqrt.js +var sqrtImpl2 = createSimpleUnaryImpl2((xi) => Math.sqrt(xi)); +var sqrt5 = unaryKernelFunc3(Sqrt2, (xi) => Math.sqrt(xi)); +var sqrtConfig4 = { + kernelName: Sqrt2, + backendName: "cpu", + kernelFunc: sqrt5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SquaredDifference.js +var squaredDifferenceImpl2 = createSimpleBinaryKernelImpl2((a, b) => { + const diff = a - b; + return diff * diff; +}); +var squaredDifference5 = binaryKernelFunc3(SquaredDifference2, squaredDifferenceImpl2); +var squaredDifferenceConfig4 = { + kernelName: SquaredDifference2, + backendName: "cpu", + kernelFunc: squaredDifference5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StridedSlice_impl.js +function stridedSliceImpl2(outShape, xBuf, strides, begin) { + const outBuf = buffer2(outShape, xBuf.dtype); + for (let i = 0; i < outBuf.size; i++) { + const loc = outBuf.indexToLoc(i); + const newLoc = new Array(loc.length); + for (let j = 0; j < newLoc.length; j++) { + newLoc[j] = loc[j] * strides[j] + begin[j]; + } + outBuf.set(xBuf.get(...newLoc), ...loc); + } + return outBuf; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringNGrams_impl.js +var StringNGramsOp2 = class { + constructor(separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences) { + this.separator = util_exports2.encodeString(separator); + this.nGramWidths = nGramWidths; + this.leftPad = util_exports2.encodeString(leftPad); + this.rightPad = util_exports2.encodeString(rightPad3); + this.padWidth = padWidth; + this.preserveShort = preserveShortSequences; + } + getPadWidth(nGramWidth) { + return Math.min(this.padWidth < 0 ? nGramWidth - 1 : this.padWidth, nGramWidth - 1); + } + getNumNGrams(length, nGramWidth) { + const padWidth = this.getPadWidth(nGramWidth); + return Math.max(0, length + 2 * padWidth - nGramWidth + 1); + } + createNGrams(data, splitIndex, output, outputStartIndex, numNGrams, nGramWidth) { + for (let nGramIndex = 0; nGramIndex < numNGrams; ++nGramIndex) { + const padWidth = this.getPadWidth(nGramWidth); + const leftPadding = Math.max(0, padWidth - nGramIndex); + const rightPadding = Math.max(0, padWidth - (numNGrams - (nGramIndex + 1))); + const numTokens = nGramWidth - (leftPadding + rightPadding); + const dataStartIndex = splitIndex + (leftPadding > 0 ? 0 : nGramIndex - padWidth); + let nGramSize = 0; + nGramSize += leftPadding * this.leftPad.length; + for (let n = 0; n < numTokens; ++n) { + nGramSize += data[dataStartIndex + n].length; + } + nGramSize += rightPadding * this.rightPad.length; + const numSeparators = leftPadding + rightPadding + numTokens - 1; + nGramSize += numSeparators * this.separator.length; + output[outputStartIndex + nGramIndex] = new Uint8Array(nGramSize); + const nGram = output[outputStartIndex + nGramIndex]; + let nextNGramIndex = 0; + const appendToNGram = (str) => str.forEach((value) => nGram[nextNGramIndex++] = value); + for (let n = 0; n < leftPadding; ++n) { + appendToNGram(this.leftPad); + appendToNGram(this.separator); + } + for (let n = 0; n < numTokens - 1; ++n) { + appendToNGram(data[dataStartIndex + n]); + appendToNGram(this.separator); + } + if (numTokens > 0) { + appendToNGram(data[dataStartIndex + numTokens - 1]); + for (let n = 0; n < rightPadding; ++n) { + appendToNGram(this.separator); + appendToNGram(this.rightPad); + } + } else { + for (let n = 0; n < rightPadding - 1; ++n) { + appendToNGram(this.rightPad); + appendToNGram(this.separator); + } + appendToNGram(this.rightPad); + } + } + } + compute(data, splits) { + const inputDataSize = data.length; + const splitsSize = splits.length; + if (splitsSize > 0) { + let prevSplit = splits[0]; + if (prevSplit !== 0) { + throw new Error(`First split value must be 0, got ${prevSplit}`); + } + for (let i = 1; i < splitsSize; ++i) { + let validSplits = splits[i] >= prevSplit; + validSplits = validSplits && splits[i] <= inputDataSize; + if (!validSplits) { + throw new Error(`Invalid split value ${splits[i]}, must be in [${prevSplit}, ${inputDataSize}]`); + } + prevSplit = splits[i]; + } + if (prevSplit !== inputDataSize) { + throw new Error(`Last split value must be data size. Expected ${inputDataSize}, got ${prevSplit}`); + } + } + const numBatchItems = splitsSize - 1; + const nGramsSplits = util_exports2.getArrayFromDType("int32", splitsSize); + if (inputDataSize === 0 || splitsSize === 0) { + const empty = new Array(inputDataSize); + for (let i = 0; i <= numBatchItems; ++i) { + nGramsSplits[i] = 0; + } + return [empty, nGramsSplits]; + } + nGramsSplits[0] = 0; + for (let i = 1; i <= numBatchItems; ++i) { + const length = splits[i] - splits[i - 1]; + let numNGrams = 0; + this.nGramWidths.forEach((nGramWidth) => { + numNGrams += this.getNumNGrams(length, nGramWidth); + }); + if (this.preserveShort && length > 0 && numNGrams === 0) { + numNGrams = 1; + } + nGramsSplits[i] = nGramsSplits[i - 1] + numNGrams; + } + const nGrams = new Array(nGramsSplits[numBatchItems]); + for (let i = 0; i < numBatchItems; ++i) { + const splitIndex = splits[i]; + let outputStartIdx = nGramsSplits[i]; + this.nGramWidths.forEach((nGramWidth) => { + const length = splits[i + 1] - splits[i]; + const numNGrams = this.getNumNGrams(length, nGramWidth); + this.createNGrams(data, splitIndex, nGrams, outputStartIdx, numNGrams, nGramWidth); + outputStartIdx += numNGrams; + }); + if (this.preserveShort && outputStartIdx === nGramsSplits[i]) { + const dataLength = splits[i + 1] - splits[i]; + if (dataLength === 0) { + continue; + } + const nGramWidth = dataLength + 2 * this.padWidth; + const numNGrams = 1; + this.createNGrams(data, splitIndex, nGrams, outputStartIdx, numNGrams, nGramWidth); + } + } + return [nGrams, nGramsSplits]; + } +}; +function stringNGramsImpl2(data, dataSplits, separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences) { + return new StringNGramsOp2(separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences).compute(data, dataSplits); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringSplit_impl.js +function split6(str, delimiters, skipEmpty, result) { + if (!str.length) { + return; + } + if (delimiters.length === 0) { + for (let i = 0; i < str.length; ++i) { + result.push(str.subarray(i, i + 1)); + } + return; + } + if (delimiters.length === 1) { + const delimiter = delimiters[0]; + let f = str.indexOf(delimiter); + while (f !== -1) { + const token = str.subarray(0, f); + if (!skipEmpty || token.length !== 0) { + result.push(token); + } + str = str.subarray(f + 1); + f = str.indexOf(delimiter); + } + if (!skipEmpty || str.length !== 0) { + result.push(str); + } + return; + } + let tokenStart = 0; + for (let i = 0; i < str.length + 1; i++) { + if (i === str.length || delimiters.indexOf(str[i]) !== -1) { + const token = str.subarray(tokenStart, i); + if (!skipEmpty || token.length !== 0) { + result.push(token); + } + tokenStart = i + 1; + } + } +} +function stringSplitImpl2(input3, delimiter, skipEmpty) { + const batchSize = input3.length; + const tokens = []; + let outputSize2 = 0; + let maxNumEntries = 0; + const numIndices = new Array(batchSize); + for (let i = 0; i < batchSize; ++i) { + const prevTokensLength = tokens.length; + split6(input3[i], delimiter, skipEmpty, tokens); + const nEntries = tokens.length - prevTokensLength; + numIndices[i] = nEntries; + outputSize2 += nEntries; + maxNumEntries = Math.max(maxNumEntries, nEntries); + } + const indices = util_exports2.getArrayFromDType("int32", outputSize2 * 2); + const values = new Array(outputSize2); + const shape = [batchSize, maxNumEntries]; + let c = 0; + for (let i = 0; i < batchSize; ++i) { + for (let j = 0; j < numIndices[i]; ++j) { + indices[c * 2] = i; + indices[c * 2 + 1] = j; + values[c] = tokens[c]; + ++c; + } + } + return [indices, values, shape]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringToHashBucketFast_impl.js +function stringToHashBucketFastImpl2(input3, numBuckets) { + const output = util_exports2.getArrayFromDType("int32", input3.length); + for (let i = 0; i < input3.length; ++i) { + output[i] = util_exports2.fingerPrint64(input3[i]).modulo(numBuckets).getLowBitsUnsigned(); + } + return output; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sub.js +var subImpl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => aValue - bValue); +var subComplexImpl2 = createComplexBinaryKernelImpl2((aReal, aImag, bReal, bImag) => { + return { real: aReal - bReal, imag: aImag - bImag }; +}); +var sub5 = binaryKernelFunc3(Sub2, subImpl2, subComplexImpl2); +var subConfig4 = { + kernelName: Sub2, + backendName: "cpu", + kernelFunc: sub5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Tile_impl.js +function tileImpl2(xBuf, reps) { + const newShape = new Array(xBuf.rank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = xBuf.shape[i] * reps[i]; + } + const result = buffer2(newShape, xBuf.dtype); + for (let i = 0; i < result.values.length; ++i) { + const newLoc = result.indexToLoc(i); + const originalLoc = new Array(xBuf.rank); + for (let j = 0; j < originalLoc.length; j++) { + originalLoc[j] = newLoc[j] % xBuf.shape[j]; + } + const originalIndex = xBuf.locToIndex(originalLoc); + result.values[i] = xBuf.values[originalIndex]; + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/TopK_impl.js +var comparePair2 = (a, b) => { + const valueDiff = b.value - a.value; + return valueDiff === 0 ? a.index - b.index : valueDiff; +}; +function select5(array3, k, left = 0, right = array3.length - 1) { + while (right > left) { + if (right - left > 600) { + const n = right - left + 1; + const i2 = k - left + 1; + const z = Math.log(n); + const s = 0.5 * Math.exp(2 * z / 3); + const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * Math.sign(i2 - n / 2); + const newLeft = Math.max(left, Math.floor(k - i2 * s / n + sd)); + const newRight = Math.min(right, Math.floor(k + (n - i2) * s / n + sd)); + select5(array3, k, newLeft, newRight); + } + const t = array3[k]; + let i = left; + let j = right; + util_exports2.swap(array3, left, k); + if (comparePair2(array3[right], t) > 0) { + util_exports2.swap(array3, left, right); + } + while (i < j) { + util_exports2.swap(array3, i, j); + i++; + j--; + while (comparePair2(array3[i], t) < 0) { + i = i + 1; + } + while (comparePair2(array3[j], t) > 0) { + j = j - 1; + } + } + if (comparePair2(array3[left], t) === 0) { + util_exports2.swap(array3, left, j); + } else { + j = j + 1; + util_exports2.swap(array3, j, right); + } + if (j <= k) { + left = j + 1; + } + if (k <= j) { + right = j - 1; + } + } +} +function topKImpl2(x, xShape, xDtype, k, sorted) { + const lastDim = xShape[xShape.length - 1]; + const [batch, size2] = [x.length / lastDim, lastDim]; + const allTopKVals = util_exports2.getTypedArrayFromDType(xDtype, batch * k); + const allTopKIndices = util_exports2.getTypedArrayFromDType("int32", batch * k); + for (let b = 0; b < batch; b++) { + const offset = b * size2; + const vals = x.subarray(offset, offset + size2); + let valAndInd = new Array(vals.length); + vals.forEach((value, index) => valAndInd[index] = { value, index }); + if (k < valAndInd.length) { + select5(valAndInd, k); + valAndInd = valAndInd.slice(0, k); + } + if (sorted) { + valAndInd.sort(comparePair2); + } + const outOffset = b * k; + const topKVals = allTopKVals.subarray(outOffset, outOffset + k); + const topKIndices = allTopKIndices.subarray(outOffset, outOffset + k); + for (let i = 0; i < k; i++) { + topKVals[i] = valAndInd[i].value; + topKIndices[i] = valAndInd[i].index; + } + } + const outputShape = xShape.slice(); + outputShape[outputShape.length - 1] = k; + return [ + buffer2(outputShape, xDtype, allTopKVals), + buffer2(outputShape, "int32", allTopKIndices) + ]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Unique_impl.js +function uniqueImpl2(values, axis, shape, dtype) { + const $axis = util_exports2.parseAxisParam(axis, shape)[0]; + const newShape = [1, shape[0], 1]; + for (let i = 0; i < $axis; i++) { + newShape[0] *= shape[i]; + } + newShape[1] = shape[$axis]; + for (let i = $axis + 1; i < shape.length; i++) { + newShape[2] *= shape[i]; + } + const uniqueElements = {}; + const indices = new Int32Array(shape[$axis]); + const inputBuffer = new TensorBuffer2(newShape, dtype, values); + const uniqueIndices = []; + const is1DTensor = newShape[0] === 1 && newShape[2] === 1; + for (let i = 0; i < shape[$axis]; i++) { + let element; + if (is1DTensor) { + element = values[i].toString(); + } else { + const axisValues = []; + for (let m = 0; m < newShape[0]; m++) { + for (let n = 0; n < newShape[2]; n++) { + axisValues.push(inputBuffer.get(m, i, n)); + } + } + element = axisValues.join(","); + } + if (uniqueElements[element] !== void 0) { + indices[i] = uniqueElements[element]; + } else { + const uniqueIndex = Object.keys(uniqueElements).length; + uniqueElements[element] = uniqueIndex; + indices[i] = uniqueIndex; + uniqueIndices.push(i); + } + } + const outputTmpShape = newShape.slice(); + outputTmpShape[1] = Object.keys(uniqueElements).length; + const outputBuffer = new TensorBuffer2(outputTmpShape, dtype); + uniqueIndices.forEach((uniqueElementIndex, i) => { + for (let m = 0; m < newShape[0]; m++) { + for (let n = 0; n < newShape[2]; n++) { + outputBuffer.set(inputBuffer.get(m, uniqueElementIndex, n), m, i, n); + } + } + }); + const outputShape = shape.slice(); + outputShape[$axis] = outputTmpShape[1]; + return { + outputValues: outputBuffer.values, + outputShape, + indices + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.js +registerBackend2("cpu", () => new MathBackendCPU2(), 1); + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Elu.js +var elu8 = unaryKernelFunc3(Elu3, (xi) => xi >= 0 ? xi : Math.exp(xi) - 1); +var eluConfig4 = { + kernelName: Elu3, + backendName: "cpu", + kernelFunc: elu8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LeakyRelu.js +function leakyRelu6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { alpha } = attrs; + assertNotComplex3([x], "leakyRelu"); + const xSize = util_exports2.sizeFromShape(x.shape); + const xVals = backend4.data.get(x.dataId).values; + const outVals = util_exports2.getTypedArrayFromDType("float32", xSize); + for (let i = 0; i < xVals.length; i++) { + outVals[i] = xVals[i] < 0 ? alpha * xVals[i] : xVals[i]; + } + return backend4.makeTensorInfo(x.shape, "float32", outVals); +} +var leakyReluConfig4 = { + kernelName: LeakyRelu2, + backendName: "cpu", + kernelFunc: leakyRelu6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Prelu.js +var preluImpl2 = createSimpleBinaryKernelImpl2((xValue, aValue) => xValue < 0 ? aValue * xValue : xValue); +function prelu7(args) { + const { inputs, backend: backend4 } = args; + const { x, alpha } = inputs; + assertNotComplex3([x, alpha], "prelu"); + const aVals = backend4.data.get(x.dataId).values; + const bVals = backend4.data.get(alpha.dataId).values; + const [resultData, resultShape] = preluImpl2(x.shape, alpha.shape, aVals, bVals, x.dtype); + return backend4.makeTensorInfo(resultShape, x.dtype, resultData); +} +var preluConfig4 = { + kernelName: Prelu2, + backendName: "cpu", + kernelFunc: prelu7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Relu.js +var relu5 = unaryKernelFunc3(Relu3, (xi) => Math.max(0, xi)); +var reluConfig4 = { + kernelName: Relu3, + backendName: "cpu", + kernelFunc: relu5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Relu6.js +var relu65 = unaryKernelFunc3(Relu63, (xi) => Math.min(Math.max(0, xi), 6)); +var relu6Config4 = { + kernelName: Relu63, + backendName: "cpu", + kernelFunc: relu65 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/fused_utils.js +function applyActivation4(backend4, x, activation2, preluActivationWeights, leakyreluAlpha) { + if (activation2 === "linear") { + return identity5({ inputs: { x }, backend: backend4 }); + } else if (activation2 === "relu") { + return relu5({ inputs: { x }, backend: backend4 }); + } else if (activation2 === "elu") { + return elu8({ inputs: { x }, backend: backend4 }); + } else if (activation2 === "relu6") { + return relu65({ inputs: { x }, backend: backend4 }); + } else if (activation2 === "prelu") { + return prelu7({ inputs: { x, alpha: preluActivationWeights }, backend: backend4 }); + } else if (activation2 === "leakyrelu") { + return leakyRelu6({ inputs: { x }, backend: backend4, attrs: { alpha: leakyreluAlpha } }); + } else if (activation2 === "sigmoid") { + return sigmoid6({ inputs: { x }, backend: backend4 }); + } + throw new Error(`Activation ${activation2} has not been implemented for the CPU backend.`); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Reshape.js +function reshape7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { shape } = attrs; + const xSize = util_exports2.sizeFromShape(x.shape); + const $shape = util_exports2.inferFromImplicitShape(shape, xSize); + const $xSize = util_exports2.sizeFromShape($shape); + util_exports2.assert(xSize === $xSize, () => `The new shape (${$shape}) has ${$xSize} elements and the old shape (${x.shape}) has ${xSize} elements. The new shape and old shape must have the same number of elements.`); + backend4.incRef(x.dataId); + const xData = backend4.data.get(x.dataId); + if (xData.complexTensorInfos != null) { + const real7 = xData.complexTensorInfos.real; + const imag7 = xData.complexTensorInfos.imag; + real7.shape = $shape; + imag7.shape = $shape; + } + return { dataId: x.dataId, shape: $shape, dtype: x.dtype }; +} +var reshapeConfig4 = { + kernelName: Reshape3, + backendName: "cpu", + kernelFunc: reshape7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/BatchMatMul.js +function batchMatMul4(args) { + const { inputs, backend: backend4, attrs } = args; + const { a, b } = inputs; + const { transposeA, transposeB } = attrs; + assertNotComplex3([a, b], "matMul"); + const aRank = a.shape.length; + const bRank = b.shape.length; + const innerShapeA = transposeA ? a.shape[aRank - 2] : a.shape[aRank - 1]; + const innerShapeB = transposeB ? b.shape[bRank - 1] : b.shape[bRank - 2]; + const outerShapeA = transposeA ? a.shape[aRank - 1] : a.shape[aRank - 2]; + const outerShapeB = transposeB ? b.shape[bRank - 2] : b.shape[bRank - 1]; + const outerDimsA = a.shape.slice(0, -2); + const outerDimsB = b.shape.slice(0, -2); + const batchDimA = util_exports2.sizeFromShape(outerDimsA); + const batchDimB = util_exports2.sizeFromShape(outerDimsB); + const batchDimsCompatible = batchDimA === batchDimB || batchDimA === 1 || batchDimB === 1; + util_exports2.assert(aRank >= 2 && bRank >= 2 && batchDimsCompatible, () => `Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${outerDimsA}) and (${outerDimsB}).`); + const outShapeOuterDims = batchDimA > batchDimB ? a.shape.slice(0, -2) : b.shape.slice(0, -2); + const outShape = outShapeOuterDims.concat([outerShapeA, outerShapeB]); + util_exports2.assert(innerShapeA === innerShapeB, () => `Error in matMul: inner shapes (${innerShapeA}) and (${innerShapeB}) of Tensors with shapes ${a.shape} and ${b.shape} and transposeA=${transposeA} and transposeB=${transposeB} must match.`); + const a3dShape = transposeA ? [batchDimA, innerShapeA, outerShapeA] : [batchDimA, outerShapeA, innerShapeA]; + const b3dShape = transposeB ? [batchDimB, outerShapeB, innerShapeB] : [batchDimB, innerShapeB, outerShapeB]; + const a3d = reshape7({ inputs: { x: a }, backend: backend4, attrs: { shape: a3dShape } }); + const b3d = reshape7({ inputs: { x: b }, backend: backend4, attrs: { shape: b3dShape } }); + const sharedDim = transposeA ? a3d.shape[1] : a3d.shape[2]; + const leftDim = transposeA ? a3d.shape[2] : a3d.shape[1]; + const rightDim = transposeB ? b3d.shape[1] : b3d.shape[2]; + const batchDim = Math.max(batchDimA, batchDimB); + const a3dValues = backend4.data.get(a3d.dataId).values; + const b3dValues = backend4.data.get(b3d.dataId).values; + const a3dStrides = util_exports2.computeStrides(a3d.shape); + const b3dStrides = util_exports2.computeStrides(b3d.shape); + const [aBatch, aOuterStep, aInnerStep] = transposeA ? [a3dStrides[0], 1, a3dStrides[1]] : [a3dStrides[0], a3dStrides[1], 1]; + const [bInnerStep, bOuterStep, bBatch] = transposeB ? [1, b3dStrides[1], b3dStrides[0]] : [b3dStrides[1], 1, b3dStrides[0]]; + const size2 = leftDim * rightDim; + const result = buffer2([batchDim, leftDim, rightDim], a3d.dtype); + const resVals = result.values; + const blockSize = backend4.blockSize; + for (let bi = 0; bi < batchDim; bi++) { + for (let i0 = 0; i0 < leftDim; i0 += blockSize) { + for (let j0 = 0; j0 < rightDim; j0 += blockSize) { + for (let k03 = 0; k03 < sharedDim; k03 += blockSize) { + const iBlock = Math.min(i0 + blockSize, leftDim); + const jBlock = Math.min(j0 + blockSize, rightDim); + const kBlock = Math.min(k03 + blockSize, sharedDim); + for (let i = i0; i < iBlock; i++) { + for (let j = j0; j < jBlock; j++) { + let sum10 = 0; + for (let k = k03; k < kBlock; k++) { + const batchOffsetA = Math.min(bi, batchDimA - 1) * aBatch; + const batchOffsetB = Math.min(bi, batchDimB - 1) * bBatch; + const aVal = a3dValues[batchOffsetA + i * aOuterStep + k * aInnerStep]; + const bVal = b3dValues[k * bInnerStep + j * bOuterStep + batchOffsetB]; + sum10 += aVal * bVal; + } + resVals[bi * size2 + (i * rightDim + j)] += sum10; + } + } + } + } + } + } + backend4.disposeIntermediateTensorInfo(a3d); + backend4.disposeIntermediateTensorInfo(b3d); + return backend4.makeTensorInfo(outShape, result.dtype, result.values); +} +var batchMatMulConfig4 = { + kernelName: BatchMatMul2, + backendName: "cpu", + kernelFunc: batchMatMul4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/_FusedMatMul.js +function _fusedMatMul3(args) { + const { inputs, backend: backend4, attrs } = args; + const { a, b, bias, preluActivationWeights } = inputs; + const { transposeA, transposeB, activation: activation2, leakyreluAlpha } = attrs; + let current; + let addRes; + let activationRes; + const intermediates = []; + const matMulRes = batchMatMul4({ inputs: { a, b }, attrs: { transposeA, transposeB }, backend: backend4 }); + current = matMulRes; + if (bias) { + addRes = add7({ inputs: { a: current, b: bias }, backend: backend4 }); + intermediates.push(current); + current = addRes; + } + if (activation2) { + activationRes = applyActivation4(backend4, current, activation2, preluActivationWeights, leakyreluAlpha); + intermediates.push(current); + current = activationRes; + } + for (const i of intermediates) { + backend4.disposeIntermediateTensorInfo(i); + } + return current; +} +var _fusedMatMulConfig3 = { + kernelName: _FusedMatMul2, + backendName: "cpu", + kernelFunc: _fusedMatMul3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Acos.js +var acos5 = unaryKernelFunc3(Acos2, (xi) => Math.acos(xi)); +var acosConfig3 = { + kernelName: Acos2, + backendName: "cpu", + kernelFunc: acos5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Acosh.js +var acosh5 = unaryKernelFunc3(Acosh2, (xi) => Math.acosh(xi)); +var acoshConfig3 = { + kernelName: Acosh2, + backendName: "cpu", + kernelFunc: acosh5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/AddN.js +function addN5(args) { + const { inputs, backend: backend4 } = args; + const tensors = inputs; + assertNotComplex3(inputs, "addN"); + const vals = tensors.map((t) => backend4.data.get(t.dataId).values); + const outBuf = buffer2(tensors[0].shape, tensors[0].dtype); + const outVals = outBuf.values; + for (let i = 0; i < tensors.length; i++) { + const currVals = vals[i]; + for (let j = 0; j < outVals.length; j++) { + outVals[j] += currVals[j]; + } + } + return backend4.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values); +} +var addNConfig4 = { + kernelName: AddN2, + backendName: "cpu", + kernelFunc: addN5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/All.js +function all6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + assertNotComplex3(x, "all"); + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + if (permutedAxes != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("all", axes, $x.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes($x.shape, axes); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const vals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(outShape), $x.dtype); + const aVals = backend4.data.get($x.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let all9 = aVals[offset]; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + all9 = all9 && value; + } + vals[i] = all9; + } + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo($x); + } + const result = backend4.makeTensorInfo(outShape, $x.dtype, vals); + if (keepDims) { + const expandedShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + const reshapedResult = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: expandedShape } }); + backend4.disposeIntermediateTensorInfo(result); + return reshapedResult; + } + return result; +} +var allConfig4 = { + kernelName: All2, + backendName: "cpu", + kernelFunc: all6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Any.js +function any6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + assertNotComplex3(x, "any"); + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + if (permutedAxes != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("any", axes, $x.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes($x.shape, axes); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const vals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(outShape), $x.dtype); + const aVals = backend4.data.get($x.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let anyVal = aVals[offset]; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + anyVal = anyVal || value; + } + vals[i] = anyVal; + } + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo($x); + } + const result = backend4.makeTensorInfo(outShape, $x.dtype, vals); + if (keepDims) { + const expandedShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + const reshapedResult = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: expandedShape } }); + backend4.disposeIntermediateTensorInfo(result); + return reshapedResult; + } + return result; +} +var anyConfig4 = { + kernelName: Any2, + backendName: "cpu", + kernelFunc: any6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ArgMax.js +function argMax5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis } = attrs; + assertNotComplex3(x, "argMax"); + let axes = util_exports2.parseAxisParam(axis, x.shape); + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + const intermediateTensorInfos = []; + if (permutedAxes != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + intermediateTensorInfos.push($x); + axes = backend_util_exports2.getInnerMostAxes(axes.length, $x.shape.length); + } + axes = [axes[0]]; + backend_util_exports2.assertAxesAreInnerMostDims("argMax", axes, $x.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes($x.shape, axes); + const outSize = util_exports2.sizeFromShape(outShape); + const vals = util_exports2.makeZerosTypedArray(outSize, "int32"); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const aVals = backend4.data.get($x.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let max10 = aVals[offset]; + let maxIndex = 0; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + if (value > max10) { + max10 = value; + maxIndex = j; + } + } + vals[i] = maxIndex; + } + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return backend4.makeTensorInfo(outShape, "int32", vals); +} +var argMaxConfig4 = { + kernelName: ArgMax2, + backendName: "cpu", + kernelFunc: argMax5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ArgMin.js +function argMin5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis } = attrs; + assertNotComplex3(x, "argMin"); + let axes = util_exports2.parseAxisParam(axis, x.shape); + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + const intermediateTensorInfos = []; + if (permutedAxes != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + intermediateTensorInfos.push($x); + axes = backend_util_exports2.getInnerMostAxes(axes.length, $x.shape.length); + } + axes = [axes[0]]; + backend_util_exports2.assertAxesAreInnerMostDims("argMin", axes, $x.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes($x.shape, axes); + const outSize = util_exports2.sizeFromShape(outShape); + const vals = util_exports2.makeZerosTypedArray(outSize, "int32"); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const aVals = backend4.data.get($x.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let min10 = aVals[offset]; + let minIndex = 0; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + if (value < min10) { + min10 = value; + minIndex = j; + } + } + vals[i] = minIndex; + } + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return backend4.makeTensorInfo(outShape, "int32", vals); +} +var argMinConfig3 = { + kernelName: ArgMin2, + backendName: "cpu", + kernelFunc: argMin5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Asin.js +var asin5 = unaryKernelFunc3(Asin2, (xi) => Math.asin(xi)); +var asinConfig3 = { + kernelName: Asin2, + backendName: "cpu", + kernelFunc: asin5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Asinh.js +var asinh5 = unaryKernelFunc3(Asinh2, (xi) => Math.asinh(xi)); +var asinhConfig3 = { + kernelName: Asinh2, + backendName: "cpu", + kernelFunc: asinh5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Atan.js +var atan6 = unaryKernelFunc3(Atan3, (xi) => Math.atan(xi)); +var atanConfig3 = { + kernelName: Atan3, + backendName: "cpu", + kernelFunc: atan6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Atan2.js +var atan2Impl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => Math.atan2(aValue, bValue)); +var atan25 = binaryKernelFunc3(Atan22, atan2Impl2); +var atan2Config3 = { + kernelName: Atan22, + backendName: "cpu", + kernelFunc: atan25 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Atanh.js +var atanh5 = unaryKernelFunc3(Atanh2, (xi) => Math.atanh(xi)); +var atanhConfig3 = { + kernelName: Atanh2, + backendName: "cpu", + kernelFunc: atanh5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/pool_utils.js +function pool4(xValues, xShape, dtype, strides, convInfo, poolType) { + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const initialValue = poolType === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY; + const output = buffer2(convInfo.outShape, dtype); + const outputVals = output.values; + const outputBatchStrides = convInfo.outShape[1] * convInfo.outShape[2] * convInfo.outShape[3]; + const outputRowStrides = convInfo.outShape[2] * convInfo.outShape[3]; + const outputColStrides = convInfo.outShape[3]; + for (let b = 0; b < convInfo.batchSize; ++b) { + const outputBatchOffset = b * outputBatchStrides; + const inputBatchOffset = b * strides[0]; + for (let d = 0; d < convInfo.inChannels; ++d) { + for (let yR = 0; yR < convInfo.outHeight; ++yR) { + const xRCorner = yR * strideHeight - padTop; + const xRMin = Math.max(0, xRCorner); + const xRMax = Math.min(convInfo.inHeight, effectiveFilterHeight + xRCorner); + const outputRowOffset = outputBatchOffset + yR * outputRowStrides; + for (let yC = 0; yC < convInfo.outWidth; ++yC) { + const xCCorner = yC * strideWidth - padLeft; + const xCMin = Math.max(0, xCCorner); + const xCMax = Math.min(convInfo.inWidth, effectiveFilterWidth + xCCorner); + let minMaxValue = initialValue; + let avgValue = 0; + let count4 = 0; + for (let xR = xRMin; xR < xRMax; xR += dilationHeight) { + const xROffset = inputBatchOffset + xR * strides[1]; + for (let xC = xCMin; xC < xCMax; xC += dilationWidth) { + const xCOffset = xROffset + xC * strides[2]; + const pixel = xValues[xCOffset + d]; + if (poolType === "max" && pixel > minMaxValue) { + minMaxValue = pixel; + } else if (poolType === "avg") { + avgValue += pixel; + count4++; + } + } + if (isNaN(minMaxValue)) { + break; + } + } + const outputOffset = outputRowOffset + yC * outputColStrides + d; + outputVals[outputOffset] = poolType === "avg" ? avgValue / count4 : minMaxValue; + } + } + } + } + return output; +} +function maxPoolPositions2(xValues, xShape, dtype, convInfo, flattenPositions = false, includeBatchInIndex = false) { + const maxPositions = buffer2(convInfo.outShape, "int32"); + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const xBuf = buffer2(xShape, dtype, xValues); + for (let b = 0; b < convInfo.batchSize; ++b) { + for (let d = 0; d < convInfo.inChannels; ++d) { + for (let yR = 0; yR < convInfo.outHeight; ++yR) { + const xRCorner = yR * strideHeight - padTop; + let xRMin = xRCorner; + while (xRMin < 0) { + xRMin += dilationHeight; + } + const xRMax = Math.min(convInfo.inHeight, effectiveFilterHeight + xRCorner); + for (let yC = 0; yC < convInfo.outWidth; ++yC) { + const xCCorner = yC * strideWidth - padLeft; + let xCMin = xCCorner; + while (xCMin < 0) { + xCMin += dilationWidth; + } + const xCMax = Math.min(convInfo.inWidth, effectiveFilterWidth + xCCorner); + let maxValue = Number.NEGATIVE_INFINITY; + let maxPosition = -1; + for (let xR = xRMin; xR < xRMax; xR += dilationHeight) { + const wR = xR - xRCorner; + for (let xC = xCMin; xC < xCMax; xC += dilationWidth) { + const wC = xC - xCCorner; + const pixel = xBuf.get(b, xR, xC, d); + if (pixel > maxValue) { + maxValue = pixel; + if (flattenPositions) { + maxPosition = includeBatchInIndex ? ((b * convInfo.inHeight + xR) * convInfo.inWidth + xC) * convInfo.inChannels + d : (xR * convInfo.inWidth + xC) * convInfo.inChannels + d; + } else { + maxPosition = wR * effectiveFilterWidth + wC; + } + } + } + } + maxPositions.set(maxPosition, b, yR, yC, d); + } + } + } + } + return maxPositions; +} +function pool3d4(xValues, xShape, dtype, strides, convInfo, poolType) { + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = convInfo.padInfo.front; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const initialValue = poolType === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY; + const output = buffer2(convInfo.outShape, dtype); + const outputVals = output.values; + const outputBatchStrides = convInfo.outShape[1] * convInfo.outShape[2] * convInfo.outShape[3] * convInfo.outShape[4]; + const outputDepthStrides = convInfo.outShape[2] * convInfo.outShape[3] * convInfo.outShape[4]; + const outputRowStrides = convInfo.outShape[3] * convInfo.outShape[4]; + const outputColStrides = convInfo.outShape[4]; + for (let batch = 0; batch < convInfo.batchSize; ++batch) { + const outputBatchOffset = batch * outputBatchStrides; + const inputBatchOffset = batch * strides[0]; + for (let channel = 0; channel < convInfo.inChannels; ++channel) { + for (let yDepth = 0; yDepth < convInfo.outDepth; ++yDepth) { + const xDepthCorner = yDepth * strideDepth - padFront; + let xDepthMin = xDepthCorner; + while (xDepthMin < 0) { + xDepthMin += dilationDepth; + } + const xDepthMax = Math.min(convInfo.inDepth, effectiveFilterDepth + xDepthCorner); + const outputDepthOffset = outputBatchOffset + yDepth * outputDepthStrides; + for (let yRow = 0; yRow < convInfo.outHeight; ++yRow) { + const xRowCorner = yRow * strideHeight - padTop; + let xRowMin = xRowCorner; + while (xRowMin < 0) { + xRowMin += dilationHeight; + } + const xRowMax = Math.min(convInfo.inHeight, effectiveFilterHeight + xRowCorner); + const outputRowOffset = outputDepthOffset + yRow * outputRowStrides; + for (let yCol = 0; yCol < convInfo.outWidth; ++yCol) { + const xColCorner = yCol * strideWidth - padLeft; + let xColMin = xColCorner; + while (xColMin < 0) { + xColMin += dilationWidth; + } + const xColMax = Math.min(convInfo.inWidth, effectiveFilterWidth + xColCorner); + const outputColOffset = outputRowOffset + yCol * outputColStrides; + let minMaxValue = initialValue; + let avgValue = 0; + let count4 = 0; + for (let xDepth = xDepthMin; xDepth < xDepthMax; xDepth += dilationDepth) { + const xDepthOffset = inputBatchOffset + xDepth * strides[1]; + for (let xRow = xRowMin; xRow < xRowMax; xRow += dilationHeight) { + const xRowOffset = xDepthOffset + xRow * strides[2]; + for (let xCol = xColMin; xCol < xColMax; xCol += dilationWidth) { + const xColOffset = xRowOffset + xCol * strides[3]; + const pixel = xValues[xColOffset + channel]; + if (poolType === "max" && pixel > minMaxValue) { + minMaxValue = pixel; + } else if (poolType === "avg") { + avgValue += pixel; + count4++; + } + if (isNaN(minMaxValue)) { + break; + } + } + if (isNaN(minMaxValue)) { + break; + } + } + if (isNaN(minMaxValue)) { + break; + } + } + const outputOffset = outputColOffset + channel; + outputVals[outputOffset] = poolType === "avg" ? avgValue / count4 : minMaxValue; + } + } + } + } + } + return output; +} +function maxPool3dPositions2(xBuf, convInfo) { + const maxPositions = buffer2(convInfo.outShape, "int32"); + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = convInfo.padInfo.front; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + for (let batch = 0; batch < convInfo.batchSize; ++batch) { + for (let channel = 0; channel < convInfo.inChannels; ++channel) { + for (let yDepth = 0; yDepth < convInfo.outDepth; ++yDepth) { + const xDepthCorner = yDepth * strideDepth - padFront; + let xDepthMin = xDepthCorner; + while (xDepthMin < 0) { + xDepthMin += dilationDepth; + } + const xDepthMax = Math.min(convInfo.inDepth, effectiveFilterDepth + xDepthCorner); + for (let yRow = 0; yRow < convInfo.outHeight; ++yRow) { + const xRowCorner = yRow * strideHeight - padTop; + let xRowMin = xRowCorner; + while (xRowMin < 0) { + xRowMin += dilationHeight; + } + const xRowMax = Math.min(convInfo.inHeight, effectiveFilterHeight + xRowCorner); + for (let yCol = 0; yCol < convInfo.outWidth; ++yCol) { + const xColCorner = yCol * strideWidth - padLeft; + let xColMin = xColCorner; + while (xColMin < 0) { + xColMin += dilationWidth; + } + const xColMax = Math.min(convInfo.inWidth, effectiveFilterWidth + xColCorner); + let maxValue = Number.NEGATIVE_INFINITY; + let maxPosition = -1; + for (let xDepth = xDepthMin; xDepth < xDepthMax; xDepth += dilationDepth) { + const wDepth = xDepth - xDepthCorner; + for (let xRow = xRowMin; xRow < xRowMax; xRow += dilationHeight) { + const wRow = xRow - xRowCorner; + for (let xCol = xColMin; xCol < xColMax; xCol += dilationWidth) { + const wCol = xCol - xColCorner; + const pixel = xBuf.get(batch, xDepth, xRow, xCol, channel); + if (pixel >= maxValue) { + maxValue = pixel; + maxPosition = wDepth * effectiveFilterHeight * effectiveFilterWidth + wRow * effectiveFilterHeight + wCol; + } + } + } + } + maxPositions.set(maxPosition, batch, yDepth, yRow, yCol, channel); + } + } + } + } + } + return maxPositions; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/AvgPool.js +function avgPool6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + assertNotComplex3(x, "avgPool"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = 1; + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + let res; + if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports2.arraysEqual(convInfo.inShape, convInfo.outShape)) { + res = identity5({ inputs: { x }, backend: backend4 }); + } else { + const xValues = backend4.data.get(x.dataId).values; + const strides2 = util_exports2.computeStrides(x.shape); + const buffer3 = pool4(xValues, x.shape, x.dtype, strides2, convInfo, "avg"); + res = backend4.makeTensorInfo(convInfo.outShape, x.dtype, buffer3.values); + } + return res; +} +var avgPoolConfig4 = { + kernelName: AvgPool2, + backendName: "cpu", + kernelFunc: avgPool6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/AvgPool3D.js +function avgPool3D3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { filterSize, strides, pad: pad4, dimRoundingMode, dataFormat } = attrs; + assertNotComplex3(x, "avgPool3d"); + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, 1, pad4, dimRoundingMode, dataFormat); + const xValues = backend4.data.get(x.dataId).values; + const outBuf = pool3d4(xValues, x.shape, x.dtype, util_exports2.computeStrides(x.shape), convInfo, "avg"); + return backend4.makeTensorInfo(outBuf.shape, "float32", outBuf.values); +} +var avgPool3DConfig3 = { + kernelName: AvgPool3D2, + backendName: "cpu", + kernelFunc: avgPool3D3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/AvgPool3DGrad.js +function avgPool3DGrad3(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + assertNotComplex3([dy, input3], "avgPool3DGrad"); + const convInfo = backend_util_exports2.computePool3DInfo(input3.shape, filterSize, strides, 1, pad4, dimRoundingMode); + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const filterDepth = convInfo.filterDepth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const dx = buffer2(input3.shape, "float32"); + const avgMultiplier = 1 / (filterDepth * filterHeight * filterWidth); + const dyBuf = backend4.bufferSync(dy); + for (let batch = 0; batch < convInfo.batchSize; ++batch) { + for (let channel = 0; channel < convInfo.inChannels; ++channel) { + for (let dxDepth = 0; dxDepth < convInfo.inDepth; ++dxDepth) { + for (let dxRow = 0; dxRow < convInfo.inHeight; ++dxRow) { + for (let dxCol = 0; dxCol < convInfo.inWidth; ++dxCol) { + const dyDepthCorner = dxDepth - padFront; + const dyRowCorner = dxRow - padTop; + const dyColCorner = dxCol - padLeft; + let dotProd = 0; + for (let wDepth = 0; wDepth < effectiveFilterDepth; wDepth += dilationDepth) { + const dyDepth = (dyDepthCorner + wDepth) / strideDepth; + if (dyDepth < 0 || dyDepth >= convInfo.outDepth || Math.floor(dyDepth) !== dyDepth) { + continue; + } + for (let wRow = 0; wRow < effectiveFilterHeight; wRow += dilationHeight) { + const dyRow = (dyRowCorner + wRow) / strideHeight; + if (dyRow < 0 || dyRow >= convInfo.outHeight || Math.floor(dyRow) !== dyRow) { + continue; + } + for (let wCol = 0; wCol < effectiveFilterWidth; wCol += dilationWidth) { + const dyCol = (dyColCorner + wCol) / strideWidth; + if (dyCol < 0 || dyCol >= convInfo.outWidth || Math.floor(dyCol) !== dyCol) { + continue; + } + const pixel = dyBuf.get(batch, dyDepth, dyRow, dyCol, channel); + dotProd += pixel; + } + } + } + dx.set(dotProd * avgMultiplier, batch, dxDepth, dxRow, dxCol, channel); + } + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var avgPool3DGradConfig4 = { + kernelName: AvgPool3DGrad2, + backendName: "cpu", + kernelFunc: avgPool3DGrad3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/AvgPoolGrad.js +function avgPoolGrad5(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const x = input3; + assertNotComplex3([dy, input3], "avgPoolGrad"); + const { filterSize, strides, pad: pad4 } = attrs; + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, 1, pad4); + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const dx = buffer2(x.shape, "float32"); + const avgMultiplier = 1 / (filterHeight * filterWidth); + const dyData = backend4.data.get(dy.dataId).values; + const dyBuf = buffer2(dy.shape, "float32", dyData); + for (let b = 0; b < convInfo.batchSize; ++b) { + for (let d = 0; d < convInfo.inChannels; ++d) { + for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) { + const dyRCorner = dxR - padTop; + const dyCCorner = dxC - padLeft; + let dotProd = 0; + for (let wR = 0; wR < effectiveFilterHeight; wR += dilationHeight) { + const dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || Math.floor(dyR) !== dyR) { + continue; + } + for (let wC = 0; wC < effectiveFilterWidth; wC += dilationWidth) { + const dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || Math.floor(dyC) !== dyC) { + continue; + } + const pixel = dyBuf.get(b, dyR, dyC, d); + dotProd += pixel; + } + } + dx.set(dotProd * avgMultiplier, b, dxR, dxC, d); + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var avgPoolGradConfig5 = { + kernelName: AvgPoolGrad2, + backendName: "cpu", + kernelFunc: avgPoolGrad5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/BatchNorm.js +function batchNorm5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, scale: scale4, offset, mean: mean6, variance } = inputs; + util_exports2.assert(mean6.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); + util_exports2.assert(offset == null || mean6.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); + util_exports2.assert(scale4 == null || mean6.shape.length === scale4.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + assertNotComplex3([x, mean6, variance, scale4, offset], "batchNorm"); + let { varianceEpsilon } = attrs; + if (varianceEpsilon == null) { + varianceEpsilon = 1e-3; + } + const xVals = backend4.data.get(x.dataId).values; + const mVals = backend4.data.get(mean6.dataId).values; + const varVals = backend4.data.get(variance.dataId).values; + const sVals = scale4 ? backend4.data.get(scale4.dataId).values : new Float32Array([1]); + const offVals = offset ? backend4.data.get(offset.dataId).values : new Float32Array([0]); + const outVals = new Float32Array(xVals.length); + const offValsLength = offVals.length; + const sValsLength = sVals.length; + const varValsLength = varVals.length; + const mValsLength = mVals.length; + let offi = 0; + let mi = 0; + let si = 0; + let vi = 0; + for (let i = 0; i < xVals.length; ++i) { + outVals[i] = offVals[offi++] + (xVals[i] - mVals[mi++]) * sVals[si++] / Math.sqrt(varVals[vi++] + varianceEpsilon); + if (offi >= offValsLength) { + offi = 0; + } + if (mi >= mValsLength) { + mi = 0; + } + if (si >= sValsLength) { + si = 0; + } + if (vi >= varValsLength) { + vi = 0; + } + } + return backend4.makeTensorInfo(x.shape, x.dtype, outVals); +} +var batchNormConfig3 = { + kernelName: FusedBatchNorm2, + backendName: "cpu", + kernelFunc: batchNorm5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/BatchToSpaceND.js +function batchToSpaceND6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockShape, crops } = attrs; + assertNotComplex3([x], "batchToSpaceND"); + const prod8 = blockShape.reduce((a, b) => a * b); + const reshaped = backend_util_exports2.getReshaped(x.shape, blockShape, prod8); + const permuted = backend_util_exports2.getPermuted(reshaped.length, blockShape.length); + const reshapedPermuted = backend_util_exports2.getReshapedPermuted(x.shape, blockShape, prod8); + const sliceBeginCoords = backend_util_exports2.getSliceBeginCoords(crops, blockShape.length); + const sliceSize = backend_util_exports2.getSliceSize(reshapedPermuted, crops, blockShape.length); + const xReshaped = reshape7({ inputs: { x }, backend: backend4, attrs: { shape: reshaped } }); + const xTransposed = transpose6({ inputs: { x: xReshaped }, backend: backend4, attrs: { perm: permuted } }); + const xTransposedReshaped = reshape7({ inputs: { x: xTransposed }, backend: backend4, attrs: { shape: reshapedPermuted } }); + const result = slice6({ + inputs: { x: xTransposedReshaped }, + backend: backend4, + attrs: { begin: sliceBeginCoords, size: sliceSize } + }); + backend4.disposeIntermediateTensorInfo(xReshaped); + backend4.disposeIntermediateTensorInfo(xTransposed); + backend4.disposeIntermediateTensorInfo(xTransposedReshaped); + return result; +} +var batchToSpaceNDConfig4 = { + kernelName: BatchToSpaceND2, + backendName: "cpu", + kernelFunc: batchToSpaceND6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Bincount.js +function bincount5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, weights } = inputs; + const { size: size2 } = attrs; + const xVals = backend4.data.get(x.dataId).values; + const weightsVals = backend4.data.get(weights.dataId).values; + const outVals = bincountImpl2(xVals, weightsVals, weights.dtype, weights.shape, size2); + return backend4.makeTensorInfo([size2], weights.dtype, outVals); +} +var bincountConfig3 = { + kernelName: Bincount2, + backendName: "cpu", + kernelFunc: bincount5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/BroadcastArgs.js +function broadcastArgs4(args) { + const { inputs, backend: backend4 } = args; + const { s0, s1 } = inputs; + const s0Vals = backend4.data.get(s0.dataId).values; + const s1Vals = backend4.data.get(s1.dataId).values; + const broadcastShape = backend_util_exports2.assertAndGetBroadcastShape(Array.from(s0Vals), Array.from(s1Vals)); + return backend4.makeTensorInfo([broadcastShape.length], "int32", Int32Array.from(broadcastShape)); +} +var broadcastArgsConfig2 = { + kernelName: BroadcastArgs2, + backendName: "cpu", + kernelFunc: broadcastArgs4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Clip.js +var clip3 = unaryKernelFunc3(ClipByValue2, (xi, attrs) => { + const clipAttrs = attrs; + if (xi > clipAttrs.clipValueMax) { + return clipAttrs.clipValueMax; + } + return xi < clipAttrs.clipValueMin ? clipAttrs.clipValueMin : xi; +}); +var clipConfig2 = { + kernelName: ClipByValue2, + backendName: "cpu", + kernelFunc: clip3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ComplexAbs.js +var complexAbs3 = (args) => { + const { x } = args.inputs; + const cpuBackend = args.backend; + const resultValues = new Float32Array(util_exports2.sizeFromShape(x.shape)); + const complexVals = cpuBackend.data.get(x.dataId); + const real7 = complexVals.complexTensorInfos.real; + const imag7 = complexVals.complexTensorInfos.imag; + const realVals = cpuBackend.data.get(real7.dataId).values; + const imagVals = cpuBackend.data.get(imag7.dataId).values; + for (let i = 0; i < realVals.length; i++) { + const real8 = realVals[i]; + const imag8 = imagVals[i]; + resultValues[i] = Math.hypot(real8, imag8); + } + return cpuBackend.makeOutput(resultValues, x.shape, "float32"); +}; +var complexAbsConfig3 = { + kernelName: ComplexAbs2, + backendName: "cpu", + kernelFunc: complexAbs3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Imag.js +function imag5(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const imag7 = backend4.data.get(input3.dataId).complexTensorInfos.imag; + const imagVal = backend4.data.get(imag7.dataId).values; + return backend4.makeTensorInfo(imag7.shape, imag7.dtype, imagVal); +} +var imagConfig3 = { + kernelName: Imag2, + backendName: "cpu", + kernelFunc: imag5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Concat.js +function concat6(args) { + const { inputs, backend: backend4, attrs } = args; + const { axis } = attrs; + const $axis = util_exports2.parseAxisParam(axis, inputs[0].shape)[0]; + let outShape = backend_util_exports2.computeOutShape(inputs.map((t) => t.shape), $axis); + if (util_exports2.sizeFromShape(outShape) === 0) { + return backend4.makeTensorInfo(outShape, inputs[0].dtype, []); + } + const $inputs = inputs.filter((t) => util_exports2.sizeFromShape(t.shape) > 0); + if ($inputs.length === 1) { + return identity5({ inputs: { x: $inputs[0] }, backend: backend4 }); + } + const shapes = $inputs.map((t) => t.shape); + backend_util_exports2.assertParamsConsistent(shapes, $axis); + if ($inputs[0].dtype === "complex64") { + const reals = $inputs.map((t) => real5({ inputs: { input: t }, backend: backend4 })); + const imags = $inputs.map((t) => imag5({ inputs: { input: t }, backend: backend4 })); + const realConcated = concat6({ inputs: reals, backend: backend4, attrs: { axis: $axis } }); + const imagConcated = concat6({ inputs: imags, backend: backend4, attrs: { axis: $axis } }); + const result = complex5({ inputs: { real: realConcated, imag: imagConcated }, backend: backend4 }); + reals.forEach((r) => backend4.disposeIntermediateTensorInfo(r)); + imags.forEach((i) => backend4.disposeIntermediateTensorInfo(i)); + backend4.disposeIntermediateTensorInfo(realConcated); + backend4.disposeIntermediateTensorInfo(imagConcated); + return result; + } + const inputs2D = $inputs.map((t) => { + const innerSize = util_exports2.sizeFromShape(t.shape.slice($axis)); + const shape = [-1, innerSize]; + return reshape7({ inputs: { x: t }, backend: backend4, attrs: { shape } }); + }); + const inputsValShapes = inputs2D.map((t) => { + return { vals: backend4.data.get(t.dataId).values, shape: t.shape }; + }); + outShape = backend_util_exports2.computeOutShape(inputs2D.map((t) => t.shape), 1); + const simplyConcat = inputs2D[0].shape[0] === 1; + const outVals = concatImpl3(inputsValShapes, outShape, inputs[0].dtype, simplyConcat); + const finalOutShape = backend_util_exports2.computeOutShape($inputs.map((t) => t.shape), $axis); + const outInfo = backend4.makeTensorInfo(finalOutShape, inputs[0].dtype, outVals); + inputs2D.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return outInfo; +} +var concatConfig4 = { + kernelName: Concat2, + backendName: "cpu", + kernelFunc: concat6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv2D.js +function conv2D2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dataFormat, dilations, dimRoundingMode } = attrs; + assertNotComplex3([x, filter], "conv2d"); + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad4, dimRoundingMode, false, $dataFormat); + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const padLeft = convInfo.padInfo.left; + const padTop = convInfo.padInfo.top; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + const y = new TensorBuffer2(convInfo.outShape, x.dtype); + const xStrides = util_exports2.computeStrides(x.shape); + const filterStrides = util_exports2.computeStrides(filter.shape); + const xBatchStride = xStrides[0]; + const xRowStride = isChannelsLast ? xStrides[1] : xStrides[2]; + const xColStride = isChannelsLast ? xStrides[2] : 1; + const xChannelStride = isChannelsLast ? 1 : xStrides[1]; + const yBatchStride = y.strides[0]; + const yRowStride = isChannelsLast ? y.strides[1] : y.strides[2]; + const yColStride = isChannelsLast ? y.strides[2] : 1; + const yChannelStride = isChannelsLast ? 1 : y.strides[1]; + const xVals = backend4.data.get(x.dataId).values; + const wVals = backend4.data.get(filter.dataId).values; + const yVals = y.values; + for (let b = 0; b < convInfo.batchSize; ++b) { + const xOffset1 = b * xBatchStride; + const yOffset1 = b * yBatchStride; + for (let yR = 0; yR < convInfo.outHeight; ++yR) { + const yOffset2 = yOffset1 + yR * yRowStride; + const xRCorner = yR * convInfo.strideHeight - padTop; + for (let wR = 0; wR < filterHeight; ++wR) { + const xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + const wOffset1 = wR * filterStrides[0]; + const xOffset2 = xOffset1 + xR * xRowStride; + for (let yC = 0; yC < convInfo.outWidth; ++yC) { + const yOffset3 = yOffset2 + yC * yColStride; + const xCCorner = yC * convInfo.strideWidth - padLeft; + for (let wC = 0; wC < filterWidth; ++wC) { + const xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + const wOffset2 = wOffset1 + wC * filterStrides[1]; + const xOffset3 = xOffset2 + xC * xColStride; + let wOffset3 = wOffset2; + for (let d1 = 0; d1 < convInfo.inChannels; ++d1) { + const xVal = xVals[xOffset3 + d1 * xChannelStride]; + for (let d2 = 0; d2 < convInfo.outChannels; ++d2) { + yVals[yOffset3 + d2 * yChannelStride] += xVal * wVals[wOffset3 + d2]; + } + wOffset3 += convInfo.outChannels; + } + } + } + } + } + } + return backend4.makeTensorInfo(y.shape, y.dtype, yVals); +} +var conv2DConfig4 = { + kernelName: Conv2D3, + backendName: "cpu", + kernelFunc: conv2D2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv2DBackpropFilter.js +function conv2DBackpropFilter5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, pad: pad4, dataFormat, dimRoundingMode, filterShape } = attrs; + assertNotComplex3([x, dy], "conv2dBackpropFilter"); + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filterShape, strides, 1, pad4, dimRoundingMode, false, $dataFormat); + const { strideHeight, strideWidth, filterHeight, filterWidth } = convInfo; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + const dW = new TensorBuffer2(convInfo.filterShape, "float32"); + const leftPad = convInfo.padInfo.left; + const topPad = convInfo.padInfo.top; + const xVals = backend4.data.get(x.dataId).values; + const dyVals = backend4.data.get(dy.dataId).values; + const xBuf = new TensorBuffer2(x.shape, x.dtype, xVals); + const dyBuf = new TensorBuffer2(dy.shape, dy.dtype, dyVals); + for (let wR = 0; wR < filterHeight; ++wR) { + const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + const yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (let wC = 0; wC < filterWidth; ++wC) { + const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + const yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (let d1 = 0; d1 < convInfo.inChannels; ++d1) { + for (let d2 = 0; d2 < convInfo.outChannels; ++d2) { + let dotProd = 0; + for (let b = 0; b < convInfo.batchSize; ++b) { + for (let yR = yRMin; yR < yRMax; ++yR) { + const xR = wR + yR * strideHeight - topPad; + for (let yC = yCMin; yC < yCMax; ++yC) { + const xC = wC + yC * strideWidth - leftPad; + if (isChannelsLast) { + dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2); + } else { + dotProd += xBuf.get(b, d1, xR, xC) * dyBuf.get(b, d2, yR, yC); + } + } + } + } + dW.set(dotProd, wR, wC, d1, d2); + } + } + } + } + return backend4.makeTensorInfo(dW.shape, dW.dtype, dW.values); +} +var conv2DBackpropFilterConfig3 = { + kernelName: Conv2DBackpropFilter2, + backendName: "cpu", + kernelFunc: conv2DBackpropFilter5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv2DBackpropInput.js +function conv2DBackpropInput6(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { inputShape, strides, pad: pad4, dataFormat, dimRoundingMode } = attrs; + assertNotComplex3([dy, filter], "conv2dBackpropInput"); + const filterStrides = util_exports2.computeStrides(filter.shape); + const dyStrides = util_exports2.computeStrides(dy.shape); + let $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad4, dimRoundingMode, false, $dataFormat); + const dx = new TensorBuffer2(convInfo.inShape, "float32"); + const dxValues = dx.values; + const dyValues = backend4.data.get(dy.dataId).values; + const fltValues = backend4.data.get(filter.dataId).values; + const [fltS0, fltS1, fltS2] = filterStrides; + const { batchSize, filterHeight, filterWidth, inChannels, inHeight, inWidth, outChannels, outHeight, outWidth, strideHeight, strideWidth } = convInfo; + $dataFormat = convInfo.dataFormat; + const topPad = filterHeight - 1 - convInfo.padInfo.top; + const leftPad = filterWidth - 1 - convInfo.padInfo.left; + const isChannelsLast = $dataFormat === "channelsLast"; + const xBatchStride = dx.strides[0]; + const xRowStride = isChannelsLast ? dx.strides[1] : dx.strides[2]; + const xColStride = isChannelsLast ? dx.strides[2] : 1; + const xChannelStride = isChannelsLast ? 1 : dx.strides[1]; + const yBatchStride = dyStrides[0]; + const yRowStride = isChannelsLast ? dyStrides[1] : dyStrides[2]; + const yColStride = isChannelsLast ? dyStrides[2] : 1; + const yChannelStride = isChannelsLast ? 1 : dyStrides[1]; + for (let b = 0; b < batchSize; ++b) { + for (let d1 = 0; d1 < inChannels; ++d1) { + for (let xR = 0; xR < inHeight; ++xR) { + const xRCorner = xR - topPad; + const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + const yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (let xC = 0; xC < inWidth; ++xC) { + const xCCorner = xC - leftPad; + const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + const yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + let dotProd = 0; + for (let yR = xRMin; yR < yRMax; ++yR) { + const wR = yR * strideHeight - xRCorner; + for (let yC = xCMin; yC < yCMax; ++yC) { + const wC = yC * strideWidth - xCCorner; + const dyOffset = yBatchStride * b + yRowStride * yR + yColStride * yC; + const fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (let d2 = 0; d2 < outChannels; ++d2) { + const pixel = dyValues[dyOffset + yChannelStride * d2]; + const weight = fltValues[fltOffset + d2]; + dotProd += pixel * weight; + } + } + } + const dxOffset = xBatchStride * b + xRowStride * xR + xColStride * xC + xChannelStride * d1; + dxValues[dxOffset] = dotProd; + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var conv2DBackpropInputConfig4 = { + kernelName: Conv2DBackpropInput2, + backendName: "cpu", + kernelFunc: conv2DBackpropInput6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv3D.js +function conv3D3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dilations } = attrs; + assertNotComplex3([x, filter], "conv3d"); + const convInfo = backend_util_exports2.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad4); + const { filterDepth, filterHeight, filterWidth, dilationDepth, dilationHeight, dilationWidth, padInfo } = convInfo; + const padFront = padInfo.front; + const padLeft = padInfo.left; + const padTop = padInfo.top; + const y = new TensorBuffer2(convInfo.outShape, x.dtype); + const xVals = backend4.data.get(x.dataId).values; + const wVals = backend4.data.get(filter.dataId).values; + const yVals = y.values; + const xStrides = util_exports2.computeStrides(x.shape); + const filterStrides = util_exports2.computeStrides(filter.shape); + for (let b = 0; b < convInfo.batchSize; ++b) { + const xOffset1 = b * xStrides[0]; + const yOffset1 = b * y.strides[0]; + for (let yF = 0; yF < convInfo.outDepth; ++yF) { + const yOffset2 = yOffset1 + yF * y.strides[1]; + const xFCorner = yF * convInfo.strideDepth - padFront; + for (let wF = 0; wF < filterDepth; ++wF) { + const xF = xFCorner + wF * dilationDepth; + if (xF < 0 || xF >= convInfo.inDepth) { + continue; + } + const wOffset1 = wF * filterStrides[0]; + const xOffset2 = xOffset1 + xF * xStrides[1]; + for (let yR = 0; yR < convInfo.outHeight; ++yR) { + const yOffset3 = yOffset2 + yR * y.strides[2]; + const xRCorner = yR * convInfo.strideHeight - padTop; + for (let wR = 0; wR < filterHeight; ++wR) { + const xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + const wOffset2 = wOffset1 + wR * filterStrides[1]; + const xOffset3 = xOffset2 + xR * xStrides[2]; + for (let yC = 0; yC < convInfo.outWidth; ++yC) { + const yOffset4 = yOffset3 + yC * convInfo.outChannels; + const xCCorner = yC * convInfo.strideWidth - padLeft; + for (let wC = 0; wC < filterWidth; ++wC) { + const xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + const wOffset3 = wOffset2 + wC * filterStrides[2]; + const xOffset4 = xOffset3 + xC * convInfo.inChannels; + let wOffset4 = wOffset3; + for (let d1 = 0; d1 < convInfo.inChannels; ++d1) { + const xVal = xVals[xOffset4 + d1]; + for (let d2 = 0; d2 < convInfo.outChannels; ++d2) { + yVals[yOffset4 + d2] += xVal * wVals[wOffset4 + d2]; + } + wOffset4 += convInfo.outChannels; + } + } + } + } + } + } + } + } + return backend4.makeTensorInfo(y.shape, y.dtype, y.values); +} +var conv3DConfig3 = { + kernelName: Conv3D3, + backendName: "cpu", + kernelFunc: conv3D3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv3DBackpropFilterV2.js +function conv3DBackpropFilterV23(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, pad: pad4, filterShape } = attrs; + assertNotComplex3([x, dy], "conv3dBackpropFilterV2"); + const xStrides = util_exports2.computeStrides(x.shape); + const dyStrides = util_exports2.computeStrides(dy.shape); + const convInfo = backend_util_exports2.computeConv3DInfo(x.shape, filterShape, strides, 1, pad4); + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const filterDepth = convInfo.filterDepth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const dw = new TensorBuffer2(convInfo.filterShape, "float32"); + const dwValues = dw.values; + const [dwS0, dwS1, dwS2, dwS3] = dw.strides; + const dyValues = backend4.data.get(dy.dataId).values; + const [dyS0, dyS1, dyS2, dyS3] = dyStrides; + const xValues = backend4.data.get(x.dataId).values; + const [xS0, xS1, xS2, xS3] = xStrides; + const frontPad = convInfo.padInfo.front; + const leftPad = convInfo.padInfo.left; + const topPad = convInfo.padInfo.top; + for (let wF = 0; wF < filterDepth; ++wF) { + const yFMin = Math.max(0, Math.ceil((frontPad - wF) / strideDepth)); + const yFMax = Math.min(convInfo.outDepth, (convInfo.inDepth + frontPad - wF) / strideDepth); + const wOffset1 = wF * dwS0; + for (let wR = 0; wR < filterHeight; ++wR) { + const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + const yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + const wOffset2 = wR * dwS1 + wOffset1; + for (let wC = 0; wC < filterWidth; ++wC) { + const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + const yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + const wOffset3 = wC * dwS2 + wOffset2; + for (let d1 = 0; d1 < convInfo.inChannels; ++d1) { + const wOffset4 = d1 * dwS3 + wOffset3; + for (let d2 = 0; d2 < convInfo.outChannels; ++d2) { + let dotProd = 0; + for (let b = 0; b < convInfo.batchSize; ++b) { + const xOffset1 = b * xS0; + const yOffset1 = b * dyS0; + for (let yF = yFMin; yF < yFMax; ++yF) { + const xF = wF + yF * strideDepth - frontPad; + const xOffset2 = xF * xS1 + xOffset1; + const yOffset2 = yF * dyS1 + yOffset1; + for (let yR = yRMin; yR < yRMax; ++yR) { + const xR = wR + yR * strideHeight - topPad; + const xOffset3 = xR * xS2 + xOffset2; + const yOffset3 = yR * dyS2 + yOffset2; + for (let yC = yCMin; yC < yCMax; ++yC) { + const xC = wC + yC * strideWidth - leftPad; + const xOffset4 = xC * xS3 + xOffset3; + const yOffset4 = yC * dyS3 + yOffset3; + dotProd += xValues[xOffset4 + d1] * dyValues[yOffset4 + d2]; + } + } + } + } + dwValues[wOffset4 + d2] = dotProd; + } + } + } + } + } + return backend4.makeTensorInfo(dw.shape, dw.dtype, dw.values); +} +var conv3DBackpropFilterV2Config3 = { + kernelName: Conv3DBackpropFilterV22, + backendName: "cpu", + kernelFunc: conv3DBackpropFilterV23 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Conv3DBackpropInputV2.js +function conv3DBackpropInputV22(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { pad: pad4, strides, inputShape } = attrs; + assertNotComplex3([dy], "conv3dBackpropInputV2"); + const dyStrides = util_exports2.computeStrides(dy.shape); + const filterStrides = util_exports2.computeStrides(filter.shape); + const convInfo = backend_util_exports2.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad4); + const dx = new TensorBuffer2(convInfo.inShape, "float32"); + const dxValues = dx.values; + const [dxS0, dxS1, dxS2, dxS3] = dx.strides; + const dyValues = backend4.data.get(dy.dataId).values; + const [dyS0, dyS1, dyS2, dyS3] = dyStrides; + const fltValues = backend4.data.get(filter.dataId).values; + const [fltS0, fltS1, fltS2, fltS3] = filterStrides; + const { batchSize, filterDepth, filterHeight, filterWidth, inChannels, inDepth, inHeight, inWidth, outChannels, outDepth, outHeight, outWidth, strideDepth, strideHeight, strideWidth } = convInfo; + const frontPad = filterDepth - 1 - convInfo.padInfo.front; + const topPad = filterHeight - 1 - convInfo.padInfo.top; + const leftPad = filterWidth - 1 - convInfo.padInfo.left; + for (let b = 0; b < batchSize; ++b) { + for (let d1 = 0; d1 < inChannels; ++d1) { + for (let xF = 0; xF < inDepth; ++xF) { + const xFCorner = xF - frontPad; + const xFMin = Math.max(0, Math.ceil(xFCorner / strideDepth)); + const yFMax = Math.min(outDepth, (filterDepth + xFCorner) / strideDepth); + for (let xR = 0; xR < inHeight; ++xR) { + const xRCorner = xR - topPad; + const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + const yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (let xC = 0; xC < inWidth; ++xC) { + const xCCorner = xC - leftPad; + const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + const yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + let dotProd = 0; + for (let yF = xFMin; yF < yFMax; ++yF) { + const wF = yF * strideDepth - xFCorner; + for (let yR = xRMin; yR < yRMax; ++yR) { + const wR = yR * strideHeight - xRCorner; + for (let yC = xCMin; yC < yCMax; ++yC) { + const wC = yC * strideWidth - xCCorner; + const dyOffset = dyS0 * b + dyS1 * yF + dyS2 * yR + dyS3 * yC; + const fltOffset = fltS0 * (filterDepth - 1 - wF) + fltS1 * (filterHeight - 1 - wR) + fltS2 * (filterWidth - 1 - wC) + fltS3 * d1; + for (let d2 = 0; d2 < outChannels; ++d2) { + const pixel = dyValues[dyOffset + d2]; + const weight = fltValues[fltOffset + d2]; + dotProd += pixel * weight; + } + } + } + } + dxValues[dxS0 * b + dxS1 * xF + dxS2 * xR + dxS3 * xC + d1] = dotProd; + } + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var conv3DBackpropInputV2Config2 = { + kernelName: Conv3DBackpropInputV22, + backendName: "cpu", + kernelFunc: conv3DBackpropInputV22 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Cos.js +var cos5 = unaryKernelFunc3(Cos2, (xi) => Math.cos(xi)); +var cosConfig4 = { + kernelName: Cos2, + backendName: "cpu", + kernelFunc: cos5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Cosh.js +var cosh5 = unaryKernelFunc3(Cosh2, (xi) => Math.cosh(xi)); +var coshConfig4 = { + kernelName: Cosh2, + backendName: "cpu", + kernelFunc: cosh5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/CropAndResize.js +function cropAndResize6(args) { + const { inputs, backend: backend4, attrs } = args; + const { image: image9, boxes, boxInd } = inputs; + const { cropSize, method, extrapolationValue } = attrs; + const [batch, imageHeight, imageWidth, numChannels] = image9.shape; + const numBoxes = boxes.shape[0]; + const [cropHeight, cropWidth] = cropSize; + const output = buffer2([numBoxes, cropHeight, cropWidth, numChannels], "float32"); + const boxVals = backend4.data.get(boxes.dataId).values; + const boxIndVals = backend4.data.get(boxInd.dataId).values; + const imageVals = backend4.data.get(image9.dataId).values; + const inStride = util_exports2.computeStrides(image9.shape); + const outStride = util_exports2.computeStrides(output.shape); + for (let b = 0; b < numBoxes; b++) { + const startInd = b * 4; + const y1 = boxVals[startInd]; + const x1 = boxVals[startInd + 1]; + const y2 = boxVals[startInd + 2]; + const x2 = boxVals[startInd + 3]; + const bInd = boxIndVals[b]; + if (bInd >= batch) { + continue; + } + const heightScale = cropHeight > 1 ? (y2 - y1) * (imageHeight - 1) / (cropHeight - 1) : 0; + const widthScale = cropWidth > 1 ? (x2 - x1) * (imageWidth - 1) / (cropWidth - 1) : 0; + for (let y = 0; y < cropHeight; y++) { + const yInd = cropHeight > 1 ? y1 * (imageHeight - 1) + y * heightScale : 0.5 * (y1 + y2) * (imageHeight - 1); + if (yInd < 0 || yInd > imageHeight - 1) { + for (let x = 0; x < cropWidth; x++) { + for (let c = 0; c < numChannels; c++) { + const ind = c + x * outStride[2] + y * outStride[1] + b * outStride[0]; + output.values[ind] = extrapolationValue; + } + } + continue; + } + if (method === "bilinear") { + const topInd = Math.floor(yInd); + const bottomInd = Math.ceil(yInd); + const yLerp = yInd - topInd; + for (let x = 0; x < cropWidth; x++) { + const xInd = cropWidth > 1 ? x1 * (imageWidth - 1) + x * widthScale : 0.5 * (x1 + x2) * (imageWidth - 1); + if (xInd < 0 || xInd > imageWidth - 1) { + for (let c = 0; c < numChannels; c++) { + const ind = c + x * outStride[2] + y * outStride[1] + b * outStride[0]; + output.values[ind] = extrapolationValue; + } + continue; + } + const leftInd = Math.floor(xInd); + const rightInd = Math.ceil(xInd); + const xLerp = xInd - leftInd; + for (let c = 0; c < numChannels; c++) { + let ind = c + leftInd * inStride[2] + topInd * inStride[1] + bInd * inStride[0]; + const topLeft = imageVals[ind]; + ind = c + rightInd * inStride[2] + topInd * inStride[1] + bInd * inStride[0]; + const topRight = imageVals[ind]; + ind = c + leftInd * inStride[2] + bottomInd * inStride[1] + bInd * inStride[0]; + const bottomLeft = imageVals[ind]; + ind = c + rightInd * inStride[2] + bottomInd * inStride[1] + bInd * inStride[0]; + const bottomRight = imageVals[ind]; + const top = topLeft + (topRight - topLeft) * xLerp; + const bottom = bottomLeft + (bottomRight - bottomLeft) * xLerp; + ind = c + x * outStride[2] + y * outStride[1] + b * outStride[0]; + output.values[ind] = top + (bottom - top) * yLerp; + } + } + } else { + for (let x = 0; x < cropWidth; ++x) { + const xInd = cropWidth > 1 ? x1 * (imageWidth - 1) + x * widthScale : 0.5 * (x1 + x2) * (imageWidth - 1); + if (xInd < 0 || xInd > imageWidth - 1) { + for (let c = 0; c < numChannels; c++) { + const ind = c + x * outStride[2] + y * outStride[1] + b * outStride[0]; + output.values[ind] = extrapolationValue; + } + continue; + } + const closestX = Math.round(xInd); + const closestY = Math.round(yInd); + for (let c = 0; c < numChannels; c++) { + const inInd = c + closestX * inStride[2] + closestY * inStride[1] + bInd * inStride[0]; + const outInd = c + x * outStride[2] + y * outStride[1] + b * outStride[0]; + output.values[outInd] = imageVals[inInd]; + } + } + } + } + } + return backend4.makeTensorInfo(output.shape, output.dtype, output.values); +} +var cropAndResizeConfig4 = { + kernelName: CropAndResize2, + backendName: "cpu", + kernelFunc: cropAndResize6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Cumsum.js +function cumsum6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, exclusive, reverse: reverse8 } = attrs; + assertNotComplex3(x, "cumsum"); + const permutation = backend_util_exports2.getAxesPermutation([axis], x.shape.length); + let $x = x; + if (permutation != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutation } }); + } + const permutedAxis = backend_util_exports2.getInnerMostAxes(1, x.shape.length)[0]; + if (permutedAxis !== $x.shape.length - 1) { + throw new Error(`backend.cumsum in CPU expects an inner-most axis=${$x.shape.length - 1} but got axis=${permutedAxis}`); + } + const resultDtype = upcastType2($x.dtype, "int32"); + const vals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape($x.shape), resultDtype); + const aVals = backend4.data.get($x.dataId).values; + const finalDim = $x.shape[$x.shape.length - 1]; + const indexAdjuster = reverse8 ? (i, j) => i + finalDim - j - 1 : (i, j) => i + j; + for (let i = 0; i < aVals.length; i += finalDim) { + for (let j = 0; j < finalDim; j++) { + const idx = indexAdjuster(i, j); + if (j === 0) { + vals[idx] = exclusive ? 0 : aVals[idx]; + } else { + const prevIdx = indexAdjuster(i, j - 1); + vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] : aVals[idx] + vals[prevIdx]; + } + } + } + const result = backend4.makeTensorInfo($x.shape, resultDtype, vals); + if (permutation != null) { + const reversePermutation = backend_util_exports2.getUndoAxesPermutation(permutation); + const reverseTransposedResult = transpose6({ inputs: { x: result }, backend: backend4, attrs: { perm: reversePermutation } }); + backend4.disposeIntermediateTensorInfo(result); + backend4.disposeIntermediateTensorInfo($x); + return reverseTransposedResult; + } + return result; +} +var cumsumConfig4 = { + kernelName: Cumsum2, + backendName: "cpu", + kernelFunc: cumsum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/DenseBincount.js +function denseBincount5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, weights } = inputs; + const { size: size2, binaryOutput } = attrs; + if (x.shape.length === 1) { + const xVals = backend4.data.get(x.dataId).values; + const weightsVals = backend4.data.get(weights.dataId).values; + const outVals = bincountImpl2(xVals, weightsVals, weights.dtype, weights.shape, size2); + return backend4.makeTensorInfo([size2], weights.dtype, outVals); + } else if (x.shape.length === 2) { + const xBuf = backend4.bufferSync(x); + const weightsBuf = backend4.bufferSync(weights); + const outBuf = bincountReduceImpl2(xBuf, weightsBuf, size2, binaryOutput); + return backend4.makeTensorInfo(outBuf.shape, weights.dtype, outBuf.values); + } + throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${x.shape.length}.`); +} +var denseBincountConfig3 = { + kernelName: DenseBincount2, + backendName: "cpu", + kernelFunc: denseBincount5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/DepthToSpace.js +function depthToSpace6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockSize, dataFormat } = attrs; + util_exports2.assert(dataFormat === "NHWC", () => `Only NHWC dataFormat supported on CPU for depthToSpace. Got ${dataFormat}`); + util_exports2.assert(blockSize > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${blockSize}`); + const batchSize = x.shape[0]; + const inputHeight = x.shape[1]; + const inputWidth = x.shape[2]; + const inputDepth = x.shape[3]; + const outputHeight = inputHeight * blockSize; + const outputWidth = inputWidth * blockSize; + const outputDepth = inputDepth / (blockSize * blockSize); + const xValues = backend4.data.get(x.dataId).values; + const result = new Float32Array(batchSize * outputHeight * outputWidth * outputDepth); + let outputIdx = 0; + for (let b = 0; b < batchSize; ++b) { + for (let h = 0; h < outputHeight; ++h) { + const inH = Math.floor(h / blockSize); + const offsetH = h % blockSize; + for (let w = 0; w < outputWidth; ++w) { + const inW = Math.floor(w / blockSize); + const offsetW = w % blockSize; + const offsetD = (offsetH * blockSize + offsetW) * outputDepth; + for (let d = 0; d < outputDepth; ++d) { + const inD = d + offsetD; + const inputIdx = inD + inputDepth * (inW + inputWidth * (inH + inputHeight * b)); + result[outputIdx++] = xValues[inputIdx]; + } + } + } + } + return backend4.makeTensorInfo([batchSize, outputHeight, outputWidth, outputDepth], x.dtype, result); +} +var depthToSpaceConfig4 = { + kernelName: DepthToSpace2, + backendName: "cpu", + kernelFunc: depthToSpace6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/DepthwiseConv2dNative.js +function depthwiseConv2dNative3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dilations, dimRoundingMode } = attrs; + assertNotComplex3([x, filter], "depthwiseConv2DNative"); + const xStrides = util_exports2.computeStrides(x.shape); + const filterStrides = util_exports2.computeStrides(filter.shape); + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad4, dimRoundingMode, true); + const { filterHeight, filterWidth, dilationHeight, dilationWidth, padInfo } = convInfo; + const padLeft = padInfo.left; + const padTop = padInfo.top; + const chMul = convInfo.outChannels / convInfo.inChannels; + const y = new TensorBuffer2(convInfo.outShape, x.dtype); + const xVals = backend4.data.get(x.dataId).values; + const wVals = backend4.data.get(filter.dataId).values; + const yVals = y.values; + for (let b = 0; b < convInfo.batchSize; ++b) { + const xOffset1 = b * xStrides[0]; + const yOffset1 = b * y.strides[0]; + for (let yR = 0; yR < convInfo.outHeight; ++yR) { + const yOffset2 = yOffset1 + yR * y.strides[1]; + const xRCorner = yR * convInfo.strideHeight - padTop; + for (let wR = 0; wR < filterHeight; ++wR) { + const xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + const wOffset1 = wR * filterStrides[0]; + const xOffset2 = xOffset1 + xR * xStrides[1]; + for (let yC = 0; yC < convInfo.outWidth; ++yC) { + const yOffset3 = yOffset2 + yC * y.strides[2]; + const xCCorner = yC * convInfo.strideWidth - padLeft; + for (let wC = 0; wC < filterWidth; ++wC) { + const xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + const wOffset2 = wOffset1 + wC * filterStrides[1]; + const xOffset3 = xOffset2 + xC * convInfo.inChannels; + let yOffset4 = yOffset3; + let wOffset3 = wOffset2; + for (let d1 = 0; d1 < convInfo.inChannels; ++d1) { + const xVal = xVals[xOffset3 + d1]; + for (let q = 0; q < chMul; ++q) { + yVals[yOffset4 + q] += xVal * wVals[wOffset3 + q]; + } + yOffset4 += chMul; + wOffset3 += chMul; + } + } + } + } + } + } + return backend4.makeTensorInfo(y.shape, y.dtype, y.values); +} +var depthwiseConv2dNativeConfig4 = { + kernelName: DepthwiseConv2dNative2, + backendName: "cpu", + kernelFunc: depthwiseConv2dNative3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js +function depthwiseConv2dNativeBackpropFilter5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, dilations, pad: pad4, dimRoundingMode, filterShape } = attrs; + assertNotComplex3([x, dy], "depthwiseConv2dNativeBackpropFilter"); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad4, dimRoundingMode, true); + const { strideHeight, strideWidth, filterHeight, filterWidth } = convInfo; + const dW = new TensorBuffer2(convInfo.filterShape, "float32"); + const leftPad = convInfo.padInfo.left; + const topPad = convInfo.padInfo.top; + const chMul = convInfo.outChannels / convInfo.inChannels; + const xVals = backend4.data.get(x.dataId).values; + const xBuf = new TensorBuffer2(x.shape, x.dtype, xVals); + const dyVals = backend4.data.get(dy.dataId).values; + const dyBuf = new TensorBuffer2(dy.shape, dy.dtype, dyVals); + for (let wR = 0; wR < filterHeight; ++wR) { + const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + const yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (let wC = 0; wC < filterWidth; ++wC) { + const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + const yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (let d2 = 0; d2 < convInfo.outChannels; ++d2) { + const d1 = Math.trunc(d2 / chMul); + const dm = d2 % chMul; + let dotProd = 0; + for (let b = 0; b < convInfo.batchSize; ++b) { + for (let yR = yRMin; yR < yRMax; ++yR) { + const xR = wR + yR * strideHeight - topPad; + for (let yC = yCMin; yC < yCMax; ++yC) { + const xC = wC + yC * strideWidth - leftPad; + dotProd += xBuf.get(b, xR, xC, d1) * dyBuf.get(b, yR, yC, d2); + } + } + } + dW.set(dotProd, wR, wC, d1, dm); + } + } + } + return backend4.makeTensorInfo(dW.shape, dW.dtype, dW.values); +} +var depthwiseConv2dNativeBackpropFilterConfig3 = { + kernelName: DepthwiseConv2dNativeBackpropFilter2, + backendName: "cpu", + kernelFunc: depthwiseConv2dNativeBackpropFilter5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/DepthwiseConv2dNativeBackpropInput.js +function depthwiseConv2dNativeBackpropInput5(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { strides, dilations, pad: pad4, dimRoundingMode, inputShape } = attrs; + assertNotComplex3([dy, filter], "depthwiseConv2DNativeBackpropInput"); + const dyStrides = util_exports2.computeStrides(dy.shape); + const filterStrides = util_exports2.computeStrides(filter.shape); + const convInfo = backend_util_exports2.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad4, dimRoundingMode, true); + const dx = new TensorBuffer2(convInfo.inShape, "float32"); + const dxValues = dx.values; + const [dxS0, dxS1, dxS2] = dx.strides; + const dyValues = backend4.data.get(dy.dataId).values; + const [dyS0, dyS1, dyS2] = dyStrides; + const fltValues = backend4.data.get(filter.dataId).values; + const [fltS0, fltS1, fltS2] = filterStrides; + const { batchSize, filterHeight, filterWidth, inChannels, inHeight, inWidth, outChannels, outHeight, outWidth, strideHeight, strideWidth } = convInfo; + const topPad = filterHeight - 1 - convInfo.padInfo.top; + const leftPad = filterWidth - 1 - convInfo.padInfo.left; + const chMul = outChannels / inChannels; + for (let b = 0; b < batchSize; ++b) { + for (let d1 = 0; d1 < inChannels; ++d1) { + for (let xR = 0; xR < inHeight; ++xR) { + const xRCorner = xR - topPad; + const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + const yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (let xC = 0; xC < inWidth; ++xC) { + const xCCorner = xC - leftPad; + const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + const yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + let dotProd = 0; + for (let yR = xRMin; yR < yRMax; ++yR) { + const wR = yR * strideHeight - xRCorner; + for (let yC = xCMin; yC < yCMax; ++yC) { + const wC = yC * strideWidth - xCCorner; + const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC; + const fltOffset = fltS0 * (filterHeight - 1 - wR) + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (let dm = 0; dm < chMul; ++dm) { + const d2 = d1 * chMul + dm; + const pixel = dyValues[dyOffset + d2]; + const weight = fltValues[fltOffset + dm]; + dotProd += pixel * weight; + } + } + } + dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd; + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var depthwiseConv2dNativeBackpropInputConfig3 = { + kernelName: DepthwiseConv2dNativeBackpropInput2, + backendName: "cpu", + kernelFunc: depthwiseConv2dNativeBackpropInput5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Diag.js +function diag4(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + const xSize = util_exports2.sizeFromShape(x.shape); + const xVals = backend4.data.get(x.dataId).values; + const outBuf = buffer2([xSize, xSize], x.dtype); + const vals = outBuf.values; + for (let i = 0; i < xVals.length; i++) { + vals[i * xSize + i] = xVals[i]; + } + const outShape = [...x.shape, ...x.shape]; + return backend4.makeTensorInfo(outShape, outBuf.dtype, outBuf.values); +} +var diagConfig3 = { + kernelName: Diag2, + backendName: "cpu", + kernelFunc: diag4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Dilation2D.js +var dilation2dConfig2 = { + kernelName: Dilation2D2, + backendName: "cpu", + kernelFunc: ({ inputs, backend: backend4, attrs }) => { + const { x, filter } = inputs; + const { strides, pad: pad4, dilations } = attrs; + const cpuBackend = backend4; + const xVals = cpuBackend.data.get(x.dataId).values; + const xRank = x.shape.length; + const filterVals = cpuBackend.data.get(filter.dataId).values; + const filterRank = filter.shape.length; + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports2.computeDilation2DInfo(x.shape, filter.shape, strides, pad4, "NHWC", dilations); + const outSize = util_exports2.sizeFromShape(outShape); + const outRank = outShape.length; + const outputVals = util_exports2.getArrayFromDType(x.dtype, outSize); + for (let b = 0; b < batchSize; ++b) { + for (let hOut = 0; hOut < outHeight; ++hOut) { + const hBeg = hOut * strideHeight - padInfo.top; + for (let wOut = 0; wOut < outWidth; ++wOut) { + const wBeg = wOut * strideWidth - padInfo.left; + for (let d = 0; d < inChannels; ++d) { + let curVal = Number.MIN_SAFE_INTEGER; + for (let h = 0; h < filterHeight; ++h) { + const hIn = hBeg + h * dilationHeight; + if (hIn >= 0 && hIn < inHeight) { + for (let w = 0; w < filterWidth; ++w) { + const wIn = wBeg + w * dilationWidth; + if (wIn >= 0 && wIn < inWidth) { + const xIndex = util_exports2.locToIndex([b, hIn, wIn, d], xRank, util_exports2.computeStrides(x.shape)); + const filterIndex = util_exports2.locToIndex([h, w, d], filterRank, util_exports2.computeStrides(filter.shape)); + const val = xVals[xIndex] + filterVals[filterIndex]; + if (val > curVal) { + curVal = val; + } + } + } + } + } + const outputIndex = util_exports2.locToIndex([b, hOut, wOut, d], outRank, util_exports2.computeStrides(outShape)); + outputVals[outputIndex] = curVal; + } + } + } + } + const dataId = cpuBackend.write(util_exports2.toTypedArray(outputVals, x.dtype), outShape, x.dtype); + return { dataId, shape: outShape, dtype: x.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Dilation2DBackpropFilter.js +var dilation2dBackpropFilterConfig2 = { + kernelName: Dilation2DBackpropFilter2, + backendName: "cpu", + kernelFunc: ({ inputs, backend: backend4, attrs }) => { + const { x, filter, dy } = inputs; + const { strides, pad: pad4, dilations } = attrs; + const cpuBackend = backend4; + const $x = util_exports2.toNestedArray(x.shape, cpuBackend.data.get(x.dataId).values); + const $filter = util_exports2.toNestedArray(filter.shape, cpuBackend.data.get(filter.dataId).values); + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports2.computeDilation2DInfo(x.shape, filter.shape, strides, pad4, "NHWC", dilations); + util_exports2.assert(dy.rank === outShape.length, () => `Error in ${Dilation2DBackpropFilter2}, dy must have the same rank as output ${outShape.length}, but got ${dy.rank}`); + const $dy = util_exports2.toNestedArray(outShape, cpuBackend.data.get(dy.dataId).values); + const gradients = util_exports2.makeZerosNestedTypedArray(filter.shape, filter.dtype); + for (let b = 0; b < batchSize; ++b) { + for (let hOut = 0; hOut < outHeight; ++hOut) { + const hBeg = hOut * strideHeight - padInfo.top; + for (let wOut = 0; wOut < outWidth; ++wOut) { + const wBeg = wOut * strideWidth - padInfo.left; + for (let d = 0; d < inChannels; ++d) { + let curVal = Number.MIN_SAFE_INTEGER; + let hMax = 0; + let wMax = 0; + for (let h = 0; h < filterHeight; ++h) { + const hIn = hBeg + h * dilationHeight; + if (hIn >= 0 && hIn < inHeight) { + for (let w = 0; w < filterWidth; ++w) { + const wIn = wBeg + w * dilationWidth; + if (wIn >= 0 && wIn < inWidth) { + const val = $x[b][hIn][wIn][d] + $filter[h][w][d]; + if (val > curVal) { + curVal = val; + hMax = h; + wMax = w; + } + } + } + } + } + gradients[hMax][wMax][d] += $dy[b][hOut][wOut][d]; + } + } + } + } + const dataId = cpuBackend.write(util_exports2.toTypedArray(gradients, x.dtype), filter.shape, filter.dtype); + return { dataId, shape: filter.shape, dtype: filter.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Dilation2DBackpropInput.js +var dilation2dBackpropInputConfig2 = { + kernelName: Dilation2DBackpropInput2, + backendName: "cpu", + kernelFunc: ({ inputs, backend: backend4, attrs }) => { + const { x, filter, dy } = inputs; + const { strides, pad: pad4, dilations } = attrs; + const cpuBackend = backend4; + const $x = util_exports2.toNestedArray(x.shape, cpuBackend.data.get(x.dataId).values); + const $filter = util_exports2.toNestedArray(filter.shape, cpuBackend.data.get(filter.dataId).values); + const { batchSize, inHeight, inWidth, inChannels, outHeight, outWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth, outShape } = backend_util_exports2.computeDilation2DInfo(x.shape, filter.shape, strides, pad4, "NHWC", dilations); + util_exports2.assert(dy.rank === outShape.length, () => `Error in ${Dilation2DBackpropInput2}, dy must have the same rank as output ${outShape.length}, but got ${dy.rank}`); + const $dy = util_exports2.toNestedArray(outShape, cpuBackend.data.get(dy.dataId).values); + const gradients = util_exports2.makeZerosNestedTypedArray(x.shape, x.dtype); + for (let b = 0; b < batchSize; ++b) { + for (let hOut = 0; hOut < outHeight; ++hOut) { + const hBeg = hOut * strideHeight - padInfo.top; + for (let wOut = 0; wOut < outWidth; ++wOut) { + const wBeg = wOut * strideWidth - padInfo.left; + for (let d = 0; d < inChannels; ++d) { + let curVal = Number.MIN_SAFE_INTEGER; + let hInMax = hBeg < 0 ? 0 : hBeg; + let wInMax = wBeg < 0 ? 0 : wBeg; + for (let h = 0; h < filterHeight; ++h) { + const hIn = hBeg + h * dilationHeight; + if (hIn >= 0 && hIn < inHeight) { + for (let w = 0; w < filterWidth; ++w) { + const wIn = wBeg + w * dilationWidth; + if (wIn >= 0 && wIn < inWidth) { + const val = $x[b][hIn][wIn][d] + $filter[h][w][d]; + if (val > curVal) { + curVal = val; + hInMax = hIn; + wInMax = wIn; + } + } + } + } + } + gradients[b][hInMax][wInMax][d] += $dy[b][hOut][wOut][d]; + } + } + } + } + const dataId = cpuBackend.write(util_exports2.toTypedArray(gradients, x.dtype), x.shape, x.dtype); + return { dataId, shape: x.shape, dtype: x.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sum.js +function sum8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + assertNotComplex3(x, "sum"); + let $x; + if (x.dtype === "bool") { + $x = cast8({ inputs: { x }, backend: backend4, attrs: { dtype: "int32" } }); + } else { + $x = identity5({ inputs: { x }, backend: backend4 }); + } + const xRank = $x.shape.length; + const axes = util_exports2.parseAxisParam(axis, $x.shape); + const permutation = backend_util_exports2.getAxesPermutation(axes, xRank); + let reductionAxes = axes; + let permutedX = $x; + if (permutation != null) { + permutedX = transpose6({ inputs: { x: $x }, backend: backend4, attrs: { perm: permutation } }); + reductionAxes = backend_util_exports2.getInnerMostAxes(reductionAxes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("sum", reductionAxes, permutedX.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(permutedX.shape, reductionAxes); + const resultDtype = backend_util_exports2.upcastType(permutedX.dtype, "int32"); + let result = zeros5(backend4, outShape, resultDtype); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const vals = backend4.data.get(result.dataId).values; + const aVals = backend4.data.get(permutedX.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let sum10 = 0; + for (let j = 0; j < reduceSize; ++j) { + sum10 += aVals[offset + j]; + } + vals[i] = sum10; + } + if (keepDims) { + const newShape = backend_util_exports2.expandShapeToKeepDim(result.shape, axes); + const oldResult = result; + result = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: newShape } }); + backend4.disposeIntermediateTensorInfo(oldResult); + } + backend4.disposeIntermediateTensorInfo($x); + if (permutation != null) { + backend4.disposeIntermediateTensorInfo(permutedX); + } + return result; +} +var sumConfig4 = { + kernelName: Sum2, + backendName: "cpu", + kernelFunc: sum8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Einsum.js +function einsum5(args) { + const { inputs, backend: backend4, attrs } = args; + const { equation } = attrs; + const tensors = inputs; + const { allDims, summedDims, idDims } = backend_util_exports2.decodeEinsumEquation(equation, tensors.length); + backend_util_exports2.checkEinsumDimSizes(allDims.length, idDims, tensors); + const { path, steps } = backend_util_exports2.getEinsumComputePath(summedDims, idDims); + const nSteps = steps.length; + let out = null; + let numDimsRemaining = allDims.length; + const tensorsToDispose = []; + for (let i = 0; i < nSteps; ++i) { + for (const idTerm of steps[i]) { + const { permutationIndices: perm, expandDims: dimsToExpand } = backend_util_exports2.getEinsumPermutation(numDimsRemaining, idDims[idTerm]); + let x; + if (backend_util_exports2.isIdentityPermutation(perm)) { + x = tensors[idTerm]; + } else { + x = transpose6({ inputs: { x: tensors[idTerm] }, backend: backend4, attrs: { perm } }); + tensorsToDispose.push(x); + } + const targetShape = x.shape.slice(); + for (let k = 0; k < dimsToExpand.length; ++k) { + targetShape.splice(dimsToExpand[k], 0, 1); + } + if (!util_exports2.arraysEqual(x.shape, targetShape)) { + x = reshape7({ inputs: { x }, backend: backend4, attrs: { shape: targetShape } }); + tensorsToDispose.push(x); + } + if (out === null) { + out = x; + } else { + out = multiply4({ inputs: { a: x, b: out }, backend: backend4 }); + tensorsToDispose.push(out); + } + } + if (i < nSteps - 1) { + if (path[i] >= 0) { + out = sum8({ + inputs: { x: out }, + backend: backend4, + attrs: { + axis: path[i] - (allDims.length - numDimsRemaining), + keepDims: false + } + }); + tensorsToDispose.push(out); + } + numDimsRemaining--; + } + } + for (const tensorInfo of tensorsToDispose) { + if (tensorInfo === out) { + continue; + } + backend4.disposeIntermediateTensorInfo(tensorInfo); + } + return out; +} +var einsumConfig3 = { + kernelName: Einsum2, + backendName: "cpu", + kernelFunc: einsum5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/EluGrad.js +function eluGrad3(args) { + const { inputs, backend: backend4 } = args; + const { dy, y } = inputs; + assertNotComplex3([dy, y], "eluGrad"); + const resultValues = new Float32Array(util_exports2.sizeFromShape(y.shape)); + const values = backend4.data.get(y.dataId).values; + const dyValues = backend4.data.get(dy.dataId).values; + for (let i = 0; i < values.length; ++i) { + const v = values[i]; + if (v >= 1) { + resultValues[i] = dyValues[i]; + } else { + resultValues[i] = dyValues[i] * (v + 1); + } + } + return backend4.makeTensorInfo(y.shape, "float32", resultValues); +} +var eluGradConfig5 = { + kernelName: EluGrad2, + backendName: "cpu", + kernelFunc: eluGrad3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Erf.js +var p2 = backend_util_exports2.ERF_P; +var a12 = backend_util_exports2.ERF_A1; +var a22 = backend_util_exports2.ERF_A2; +var a32 = backend_util_exports2.ERF_A3; +var a42 = backend_util_exports2.ERF_A4; +var a52 = backend_util_exports2.ERF_A5; +var erf5 = unaryKernelFunc3(Erf2, (xi) => { + const sign7 = Math.sign(xi); + const v = Math.abs(xi); + const t = 1 / (1 + p2 * v); + return sign7 * (1 - ((((a52 * t + a42) * t + a32) * t + a22) * t + a12) * t * Math.exp(-v * v)); +}); +var erfConfig3 = { + kernelName: Erf2, + backendName: "cpu", + kernelFunc: erf5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ExpandDims.js +function expandDims8(args) { + const { inputs, backend: backend4, attrs } = args; + const { input: input3 } = inputs; + const { dim } = attrs; + const inputRank = input3.shape.length; + const newShape = input3.shape.slice(); + let $dim = dim; + if (dim < 0) { + util_exports2.assert(-(inputRank + 1) <= dim, () => `Axis must be in the interval [${-(inputRank + 1)}, ${inputRank}]`); + $dim = inputRank + dim + 1; + } + newShape.splice($dim, 0, 1); + return reshape7({ inputs: { x: input3 }, backend: backend4, attrs: { shape: newShape } }); +} +var expandDimsConfig4 = { + kernelName: ExpandDims2, + backendName: "cpu", + kernelFunc: expandDims8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/RealDiv.js +var realDivImpl2 = createSimpleBinaryKernelImpl2((a, b) => a / b); +var div4 = binaryKernelFunc3(RealDiv2, realDivImpl2); +var realDivConfig4 = { + kernelName: RealDiv2, + backendName: "cpu", + kernelFunc: div4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/fft_utils.js +function fftBatch2(input3, inverse, cpuBackend) { + const inputShape = input3.shape; + const batch = inputShape[0]; + const innerDim = inputShape[1]; + const inputVals = cpuBackend.data.get(input3.dataId); + const real2D = inputVals.complexTensorInfos.real; + const imag2D = inputVals.complexTensorInfos.imag; + const resultShape = [batch, innerDim]; + const resultSize = util_exports2.sizeFromShape(resultShape); + const resultReal = util_exports2.getTypedArrayFromDType("float32", resultSize); + const resultImag = util_exports2.getTypedArrayFromDType("float32", resultSize); + for (let b = 0; b < batch; b++) { + const r = slice6({ + inputs: { x: real2D }, + backend: cpuBackend, + attrs: { begin: [b, 0], size: [1, innerDim] } + }); + const i = slice6({ + inputs: { x: imag2D }, + backend: cpuBackend, + attrs: { begin: [b, 0], size: [1, innerDim] } + }); + const input4 = complex5({ inputs: { real: r, imag: i }, backend: cpuBackend }); + const { real: real7, imag: imag7 } = fftImpl3(input4, inverse, cpuBackend); + const res = backend_util_exports2.mergeRealAndImagArrays(real7, imag7); + for (let d = 0; d < innerDim; d++) { + const c = backend_util_exports2.getComplexWithIndex(res, d); + resultReal[b * innerDim + d] = c.real; + resultImag[b * innerDim + d] = c.imag; + } + cpuBackend.disposeIntermediateTensorInfo(r); + cpuBackend.disposeIntermediateTensorInfo(i); + cpuBackend.disposeIntermediateTensorInfo(input4); + } + const $realInfo = cpuBackend.makeTensorInfo(resultShape, "float32", resultReal); + const $imagInfo = cpuBackend.makeTensorInfo(resultShape, "float32", resultImag); + const result = complex5({ inputs: { real: $realInfo, imag: $imagInfo }, backend: cpuBackend }); + cpuBackend.disposeIntermediateTensorInfo($realInfo); + cpuBackend.disposeIntermediateTensorInfo($imagInfo); + return result; +} +function fftImpl3(input3, inverse, cpuBackend) { + const inputSize8 = util_exports2.sizeFromShape(input3.shape); + const inputVals = cpuBackend.data.get(input3.dataId); + const realVals = cpuBackend.data.get(inputVals.complexTensorInfos.real.dataId).values; + const imagVals = cpuBackend.data.get(inputVals.complexTensorInfos.imag.dataId).values; + if (isExponentOf22(inputSize8)) { + const result = fftRadix22(realVals, imagVals, inputSize8, inverse, cpuBackend); + const resultShape = [input3.shape[0], input3.shape[1]]; + if (inverse) { + const realInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.real); + const imagInfo = cpuBackend.makeTensorInfo(resultShape, "float32", result.imag); + const sizeInfo = cpuBackend.makeTensorInfo([], "float32", util_exports2.createScalarValue(inputSize8, "float32")); + const sizeInfoCopy = identity5({ inputs: { x: sizeInfo }, backend: cpuBackend }); + const divRealInfo = realDivConfig4.kernelFunc({ inputs: { a: realInfo, b: sizeInfo }, backend: cpuBackend }); + const divImagInfo = realDivConfig4.kernelFunc({ inputs: { a: imagInfo, b: sizeInfoCopy }, backend: cpuBackend }); + const divRealVals = cpuBackend.data.get(divRealInfo.dataId).values; + const divImagVals = cpuBackend.data.get(divImagInfo.dataId).values; + cpuBackend.disposeIntermediateTensorInfo(realInfo); + cpuBackend.disposeIntermediateTensorInfo(imagInfo); + cpuBackend.disposeIntermediateTensorInfo(sizeInfo); + cpuBackend.disposeIntermediateTensorInfo(sizeInfoCopy); + cpuBackend.disposeIntermediateTensorInfo(divRealInfo); + cpuBackend.disposeIntermediateTensorInfo(divImagInfo); + return { real: divRealVals, imag: divImagVals }; + } + return result; + } else { + const data = backend_util_exports2.mergeRealAndImagArrays(realVals, imagVals); + const rawOutput = fourierTransformByMatmul2(data, inputSize8, inverse); + return backend_util_exports2.splitRealAndImagArrays(rawOutput); + } +} +function isExponentOf22(size2) { + return (size2 & size2 - 1) === 0; +} +function fftRadix22(realVals, imagVals, size2, inverse, cpuBackend) { + if (size2 === 1) { + return { real: realVals, imag: imagVals }; + } + const data = backend_util_exports2.mergeRealAndImagArrays(realVals, imagVals); + const half = size2 / 2; + const evenComplex = backend_util_exports2.complexWithEvenIndex(data); + const evenRealVals = evenComplex.real; + const evenImagVals = evenComplex.imag; + const evenShape = [evenRealVals.length]; + const evenRealInfo = cpuBackend.makeTensorInfo(evenShape, "float32", evenRealVals); + const evenImagInfo = cpuBackend.makeTensorInfo(evenShape, "float32", evenImagVals); + const evenTensorInfo = complex5({ inputs: { real: evenRealInfo, imag: evenImagInfo }, backend: cpuBackend }); + const oddComplex = backend_util_exports2.complexWithOddIndex(data); + const oddRealVals = oddComplex.real; + const oddImagVals = oddComplex.imag; + const oddShape = [oddRealVals.length]; + const oddRealInfo = cpuBackend.makeTensorInfo(oddShape, "float32", oddRealVals); + const oddImagInfo = cpuBackend.makeTensorInfo(oddShape, "float32", oddImagVals); + const oddTensorInfo = complex5({ inputs: { real: oddRealInfo, imag: oddImagInfo }, backend: cpuBackend }); + const $evenComplex = fftRadix22(evenRealVals, evenImagVals, half, inverse, cpuBackend); + const $evenRealVals = $evenComplex.real; + const $evenImagVals = $evenComplex.imag; + const $evenShape = [$evenRealVals.length]; + const $evenRealInfo = cpuBackend.makeTensorInfo($evenShape, "float32", $evenRealVals); + const $evenImagInfo = cpuBackend.makeTensorInfo($evenShape, "float32", $evenImagVals); + const $evenTensorInfo = complex5({ + inputs: { real: $evenRealInfo, imag: $evenImagInfo }, + backend: cpuBackend + }); + const $oddComplex = fftRadix22(oddRealVals, oddImagVals, half, inverse, cpuBackend); + const $oddRealVals = $oddComplex.real; + const $oddImagVals = $oddComplex.imag; + const $oddShape = [$oddRealVals.length]; + const $oddRealInfo = cpuBackend.makeTensorInfo($oddShape, "float32", $oddRealVals); + const $oddImagInfo = cpuBackend.makeTensorInfo($oddShape, "float32", $oddImagVals); + const $oddTensorInfo = complex5({ inputs: { real: $oddRealInfo, imag: $oddImagInfo }, backend: cpuBackend }); + const e = backend_util_exports2.exponents(size2, inverse); + const eShape = [e.real.length]; + const eRealInfo = cpuBackend.makeTensorInfo(eShape, "float32", e.real); + const eImagInfo = cpuBackend.makeTensorInfo(eShape, "float32", e.imag); + const complexInfo = complex5({ inputs: { real: eRealInfo, imag: eImagInfo }, backend: cpuBackend }); + const exponentInfo = multiply4({ inputs: { a: complexInfo, b: $oddTensorInfo }, backend: cpuBackend }); + const addPart = add7({ + inputs: { a: $evenTensorInfo, b: exponentInfo }, + backend: cpuBackend + }); + const subPart = sub5({ + inputs: { a: $evenTensorInfo, b: exponentInfo }, + backend: cpuBackend + }); + const addPartReal = real5({ inputs: { input: addPart }, backend: cpuBackend }); + const subPartReal = real5({ inputs: { input: subPart }, backend: cpuBackend }); + const addPartImag = imag5({ inputs: { input: addPart }, backend: cpuBackend }); + const subPartImag = imag5({ inputs: { input: subPart }, backend: cpuBackend }); + const $real = concat6({ + inputs: [addPartReal, subPartReal], + backend: cpuBackend, + attrs: { axis: 0 } + }); + const $imag = concat6({ + inputs: [addPartImag, subPartImag], + backend: cpuBackend, + attrs: { axis: 0 } + }); + const $realVals = cpuBackend.data.get($real.dataId).values; + const $imagVals = cpuBackend.data.get($imag.dataId).values; + cpuBackend.disposeIntermediateTensorInfo(evenRealInfo); + cpuBackend.disposeIntermediateTensorInfo(evenImagInfo); + cpuBackend.disposeIntermediateTensorInfo(evenTensorInfo); + cpuBackend.disposeIntermediateTensorInfo(oddRealInfo); + cpuBackend.disposeIntermediateTensorInfo(oddImagInfo); + cpuBackend.disposeIntermediateTensorInfo(oddTensorInfo); + cpuBackend.disposeIntermediateTensorInfo($evenRealInfo); + cpuBackend.disposeIntermediateTensorInfo($evenImagInfo); + cpuBackend.disposeIntermediateTensorInfo($evenTensorInfo); + cpuBackend.disposeIntermediateTensorInfo($oddRealInfo); + cpuBackend.disposeIntermediateTensorInfo($oddImagInfo); + cpuBackend.disposeIntermediateTensorInfo($oddTensorInfo); + cpuBackend.disposeIntermediateTensorInfo(eRealInfo); + cpuBackend.disposeIntermediateTensorInfo(eImagInfo); + cpuBackend.disposeIntermediateTensorInfo(complexInfo); + cpuBackend.disposeIntermediateTensorInfo(exponentInfo); + cpuBackend.disposeIntermediateTensorInfo(addPart); + cpuBackend.disposeIntermediateTensorInfo(subPart); + cpuBackend.disposeIntermediateTensorInfo(addPartReal); + cpuBackend.disposeIntermediateTensorInfo(addPartImag); + cpuBackend.disposeIntermediateTensorInfo(subPartReal); + cpuBackend.disposeIntermediateTensorInfo(subPartImag); + cpuBackend.disposeIntermediateTensorInfo($real); + cpuBackend.disposeIntermediateTensorInfo($imag); + return { real: $realVals, imag: $imagVals }; +} +function fourierTransformByMatmul2(data, size2, inverse) { + const ret = new Float32Array(size2 * 2); + for (let r = 0; r < size2; r++) { + let real7 = 0; + let imag7 = 0; + for (let c = 0; c < size2; c++) { + const e = backend_util_exports2.exponent(r * c, size2, inverse); + const term = backend_util_exports2.getComplexWithIndex(data, c); + real7 += term.real * e.real - term.imag * e.imag; + imag7 += term.real * e.imag + term.imag * e.real; + } + if (inverse) { + real7 /= size2; + imag7 /= size2; + } + backend_util_exports2.assignToTypedArray(ret, real7, imag7, r); + } + return ret; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/FFT.js +function fft5(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const inputSize8 = util_exports2.sizeFromShape(input3.shape); + const innerDimensionSize = input3.shape[input3.shape.length - 1]; + const batch = inputSize8 / innerDimensionSize; + const input2D = reshape7({ + inputs: { x: input3 }, + backend: backend4, + attrs: { shape: [batch, innerDimensionSize] } + }); + const result = fftBatch2(input2D, false, backend4); + const resultReshaped = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: input3.shape } }); + backend4.disposeIntermediateTensorInfo(input2D); + backend4.disposeIntermediateTensorInfo(result); + return resultReshaped; +} +var fftConfig3 = { + kernelName: FFT2, + backendName: "cpu", + kernelFunc: fft5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Fill.js +function fill6(args) { + const { backend: backend4, attrs } = args; + const { shape, value, dtype } = attrs; + const $dtype = dtype || util_exports2.inferDtype(value); + const values = util_exports2.getArrayFromDType($dtype, util_exports2.sizeFromShape(shape)); + fillValues2(values, value, $dtype); + return backend4.makeTensorInfo(shape, $dtype, values); +} +var fillConfig4 = { + kernelName: Fill2, + backendName: "cpu", + kernelFunc: fill6 +}; +function fillValues2(values, value, dtype) { + if (dtype === "string") { + values.fill(value); + } else { + values.fill(value); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/FlipLeftRight.js +var flipLeftRightConfig4 = { + kernelName: FlipLeftRight2, + backendName: "cpu", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { image: image9 } = inputs; + const cpuBackend = backend4; + const output = util_exports2.getTypedArrayFromDType(image9.dtype, util_exports2.sizeFromShape(image9.shape)); + const [batch, imageHeight, imageWidth, numChannels] = image9.shape; + const imageVals = cpuBackend.data.get(image9.dataId).values; + for (let batchIdx = 0; batchIdx < batch; batchIdx++) { + const batchOffset = batchIdx * imageWidth * imageHeight * numChannels; + for (let row = 0; row < imageHeight; row++) { + const rowOffset = row * (imageWidth * numChannels); + for (let col = 0; col < imageWidth; col++) { + const colOffset = col * numChannels; + for (let channel = 0; channel < numChannels; channel++) { + const coordX = Math.round(imageWidth - col - 1); + const outIdx = batchOffset + rowOffset + colOffset + channel; + let outputValue = imageVals[outIdx]; + if (coordX >= 0 && coordX < imageWidth) { + const rotatedColOffset = coordX * numChannels; + const imageIdx = batchOffset + rowOffset + rotatedColOffset + channel; + outputValue = imageVals[imageIdx]; + } + output[outIdx] = outputValue; + } + } + } + } + const dataId = cpuBackend.write(output, image9.shape, image9.dtype); + return { dataId, shape: image9.shape, dtype: image9.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/FloorDiv.js +var floorDivImpl2 = createSimpleBinaryKernelImpl2((a, b) => Math.floor(a / b)); +var floorDiv5 = binaryKernelFunc3(FloorDiv2, floorDivImpl2, null, "int32"); +var floorDivConfig4 = { + kernelName: FloorDiv2, + backendName: "cpu", + kernelFunc: floorDiv5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/FusedConv2D.js +function fusedConv2D2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter, bias, preluActivationWeights } = inputs; + const { strides, pad: pad4, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + let result = conv2D2({ + inputs: { x, filter }, + backend: backend4, + attrs: { strides, pad: pad4, dataFormat, dilations, dimRoundingMode } + }); + if (bias) { + const resultOld = result; + result = add7({ inputs: { a: result, b: bias }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(resultOld); + } + if (activation2) { + const resultOld = result; + result = applyActivation4(backend4, result, activation2, preluActivationWeights, leakyreluAlpha); + backend4.disposeIntermediateTensorInfo(resultOld); + } + return result; +} +var fusedConv2DConfig4 = { + kernelName: FusedConv2D2, + backendName: "cpu", + kernelFunc: fusedConv2D2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/FusedDepthwiseConv2D.js +function fusedDepthwiseConv2D3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter, bias, preluActivationWeights } = inputs; + const { strides, pad: pad4, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + let result = depthwiseConv2dNative3({ + inputs: { x, filter }, + backend: backend4, + attrs: { strides, pad: pad4, dataFormat, dilations, dimRoundingMode } + }); + if (bias) { + const oldResult = result; + result = add7({ inputs: { a: result, b: bias }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(oldResult); + } + if (activation2) { + const oldResult = result; + result = applyActivation4(backend4, result, activation2, preluActivationWeights, leakyreluAlpha); + backend4.disposeIntermediateTensorInfo(oldResult); + } + return result; +} +var fusedDepthwiseConv2DConfig4 = { + kernelName: FusedDepthwiseConv2D2, + backendName: "cpu", + kernelFunc: fusedDepthwiseConv2D3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/GatherNd.js +function gatherNd4(args) { + const { inputs, backend: backend4 } = args; + const { params, indices } = inputs; + const paramsSize = util_exports2.sizeFromShape(params.shape); + const indicesShape = indices.shape; + const sliceRank = indicesShape[indicesShape.length - 1]; + const [resultShape, numSlices, sliceSize, strides] = backend_util_exports2.prepareAndValidate(params, indices); + if (numSlices === 0) { + return backend4.makeTensorInfo(resultShape, params.dtype, []); + } + const indicesData = backend4.data.get(indices.dataId).values; + const paramsBuf = backend4.bufferSync(params); + const outBuf = gatherNdImpl2(indicesData, paramsBuf, params.dtype, numSlices, sliceRank, sliceSize, strides, params.shape, paramsSize); + return backend4.makeTensorInfo(resultShape, params.dtype, outBuf.values); +} +var gatherNdConfig4 = { + kernelName: GatherNd2, + backendName: "cpu", + kernelFunc: gatherNd4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/GatherV2.js +function gatherV24(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, indices } = inputs; + const { axis, batchDims } = attrs; + assertNotComplex3([x, indices], "gatherV2"); + let $batchDims = batchDims; + if (batchDims == null) { + $batchDims = 0; + } + const indicesSize = util_exports2.sizeFromShape(indices.shape); + const parsedAxis = util_exports2.parseAxisParam(axis, x.shape)[0]; + const shapeInfo = backend_util_exports2.segment_util.collectGatherOpShapeInfo(x, indices, parsedAxis, $batchDims); + const flattenX = reshape7({ + inputs: { x }, + backend: backend4, + attrs: { + shape: [ + shapeInfo.batchSize, + shapeInfo.outerSize, + shapeInfo.dimSize, + shapeInfo.sliceSize + ] + } + }); + const flattenIndex = reshape7({ + inputs: { x: indices }, + backend: backend4, + attrs: { shape: [shapeInfo.batchSize, indicesSize / shapeInfo.batchSize] } + }); + const flattenOutputShape = [ + shapeInfo.batchSize, + shapeInfo.outerSize, + indicesSize / shapeInfo.batchSize, + shapeInfo.sliceSize + ]; + const indicesBuf = backend4.bufferSync(flattenIndex); + const xBuf = backend4.bufferSync(flattenX); + const outBuf = gatherV2Impl2(xBuf, indicesBuf, flattenOutputShape); + backend4.disposeIntermediateTensorInfo(flattenX); + backend4.disposeIntermediateTensorInfo(flattenIndex); + return backend4.makeTensorInfo(shapeInfo.outputShape, outBuf.dtype, outBuf.values); +} +var gatherV2Config4 = { + kernelName: GatherV22, + backendName: "cpu", + kernelFunc: gatherV24 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/IFFT.js +function ifft5(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const inputSize8 = util_exports2.sizeFromShape(input3.shape); + const innerDimensionSize = input3.shape[input3.shape.length - 1]; + const batch = inputSize8 / innerDimensionSize; + const input2D = reshape7({ + inputs: { x: input3 }, + backend: backend4, + attrs: { shape: [batch, innerDimensionSize] } + }); + const result = fftBatch2(input2D, true, backend4); + const resultReshaped = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: input3.shape } }); + backend4.disposeIntermediateTensorInfo(input2D); + backend4.disposeIntermediateTensorInfo(result); + return resultReshaped; +} +var ifftConfig3 = { + kernelName: IFFT2, + backendName: "cpu", + kernelFunc: ifft5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/IsFinite.js +var isFinite6 = unaryKernelFunc3(IsFinite2, (xi) => Number.isFinite(xi) ? 1 : 0, "bool"); +var isFiniteConfig3 = { + kernelName: IsFinite2, + backendName: "cpu", + kernelFunc: isFinite6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/IsInf.js +var isInf5 = unaryKernelFunc3(IsInf2, (xi) => Math.abs(xi) === Infinity ? 1 : 0, "bool"); +var isInfConfig3 = { + kernelName: IsInf2, + backendName: "cpu", + kernelFunc: isInf5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/IsNaN.js +var isNaN6 = unaryKernelFunc3(IsNan2, (xi) => Number.isNaN(xi) ? 1 : 0, "bool"); +var isNaNConfig3 = { + kernelName: IsNan2, + backendName: "cpu", + kernelFunc: isNaN6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LinSpace.js +function linSpace3(args) { + const { backend: backend4, attrs } = args; + const { start, stop, num } = attrs; + const outVals = linSpaceImpl2(start, stop, num); + return backend4.makeTensorInfo([outVals.length], "float32", outVals); +} +var linSpaceConfig3 = { + kernelName: LinSpace2, + backendName: "cpu", + kernelFunc: linSpace3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Log1p.js +var log1p5 = unaryKernelFunc3(Log1p2, (xi) => Math.log1p(xi)); +var log1pConfig3 = { + kernelName: Log1p2, + backendName: "cpu", + kernelFunc: log1p5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LogicalAnd.js +var logicalAndImpl2 = createSimpleBinaryKernelImpl2((a, b) => a && b); +var logicalAnd5 = binaryKernelFunc3(LogicalAnd2, logicalAndImpl2, null, "bool"); +var logicalAndConfig4 = { + kernelName: LogicalAnd2, + backendName: "cpu", + kernelFunc: logicalAnd5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LogicalNot.js +var logicalNot5 = unaryKernelFunc3(LogicalNot2, (xi) => xi ? 0 : 1, "bool"); +var logicalNotConfig3 = { + kernelName: LogicalNot2, + backendName: "cpu", + kernelFunc: logicalNot5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LogicalOr.js +var logicalOrImpl2 = createSimpleBinaryKernelImpl2((a, b) => a || b); +var logicalOr5 = binaryKernelFunc3(LogicalOr2, logicalOrImpl2, null, "bool"); +var logicalOrConfig3 = { + kernelName: LogicalOr2, + backendName: "cpu", + kernelFunc: logicalOr5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LRN.js +function lRN2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { depthRadius, bias, alpha, beta } = attrs; + assertNotComplex3(x, "LRN"); + const channels = x.shape[3]; + const maxD = channels - 1; + const xValues = backend4.data.get(x.dataId).values; + const size2 = util_exports2.sizeFromShape(x.shape); + const result = new Float32Array(size2); + function sumAcrossChannels(offset) { + const currentChannel = offset % channels; + let beginSumOffset = offset - currentChannel + Math.max(0, currentChannel - depthRadius); + const endSumOffset = offset - currentChannel + Math.min(currentChannel + depthRadius, maxD); + let sum10 = 0; + for (; beginSumOffset <= endSumOffset; beginSumOffset++) { + const z = xValues[beginSumOffset]; + sum10 += z * z; + } + return sum10; + } + for (let offset = 0; offset < size2; offset++) { + const sum10 = sumAcrossChannels(offset); + const val = xValues[offset] * Math.pow(bias + alpha * sum10, -beta); + result[offset] = val; + } + return backend4.makeTensorInfo(x.shape, x.dtype, result); +} +var lRNConfig2 = { + kernelName: LRN2, + backendName: "cpu", + kernelFunc: lRN2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/LRNGrad.js +function lRNGrad2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, y, dy } = inputs; + const { depthRadius, bias, alpha, beta } = attrs; + assertNotComplex3(dy, "LRNGrad"); + const dySize = util_exports2.sizeFromShape(dy.shape); + const channels = dy.shape[3]; + const dyValues = backend4.data.get(dy.dataId).values; + const xValues = backend4.data.get(x.dataId).values; + const yValues = backend4.data.get(y.dataId).values; + const result = new Float32Array(dySize); + const size2 = dySize; + for (let offset = 0; offset < size2; offset++) { + const currentChannel = offset % channels; + const depthBegin = offset - currentChannel + Math.max(0, currentChannel - depthRadius); + const depthEnd = offset - currentChannel + Math.min(channels, currentChannel + depthRadius + 1); + let norm3 = 0; + for (let k = depthBegin; k < depthEnd; k++) { + norm3 += Math.pow(xValues[k], 2); + } + norm3 = alpha * norm3 + bias; + for (let k = depthBegin; k < depthEnd; k++) { + let dyi = -2 * alpha * beta * xValues[k] * yValues[offset] / norm3; + if (offset === k) { + dyi += Math.pow(norm3, -beta); + } + dyi *= dyValues[offset]; + result[k] += dyi; + } + } + return backend4.makeTensorInfo(dy.shape, x.dtype, result); +} +var lRNGradConfig2 = { + kernelName: LRNGrad2, + backendName: "cpu", + kernelFunc: lRNGrad2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Max.js +function max8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { reductionIndices, keepDims } = attrs; + const cpuBackend = backend4; + let xShape = x.shape; + const xRank = xShape.length; + const origAxes = util_exports2.parseAxisParam(reductionIndices, xShape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + let xVals = cpuBackend.data.get(x.dataId).values; + if (permutedAxes != null) { + const newShape = new Array(xRank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = xShape[permutedAxes[i]]; + } + xVals = transposeImpl3(xVals, xShape, x.dtype, permutedAxes, newShape); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + xShape = newShape; + } + assertNotComplex3(x, "max"); + backend_util_exports2.assertAxesAreInnerMostDims("max", axes, xRank); + const [maxOutShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(xShape, axes); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const result = maxImpl3(xVals, reduceSize, maxOutShape, x.dtype); + const dataId = cpuBackend.write(result, maxOutShape, x.dtype); + let outShape = maxOutShape; + if (keepDims) { + const newShape = backend_util_exports2.expandShapeToKeepDim(maxOutShape, origAxes); + outShape = newShape; + } + return { dataId, shape: outShape, dtype: x.dtype }; +} +var maxConfig4 = { + kernelName: Max2, + backendName: "cpu", + kernelFunc: max8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPool.js +function maxPool6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + assertNotComplex3(x, "maxPool"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = 1; + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + let res; + if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports2.arraysEqual(convInfo.inShape, convInfo.outShape)) { + res = identity5({ inputs: { x }, backend: backend4 }); + } else { + const xValues = backend4.data.get(x.dataId).values; + const strides2 = util_exports2.computeStrides(x.shape); + const buffer3 = pool4(xValues, x.shape, x.dtype, strides2, convInfo, "max"); + res = backend4.makeTensorInfo(convInfo.outShape, x.dtype, buffer3.values); + } + return res; +} +var maxPoolConfig4 = { + kernelName: MaxPool2, + backendName: "cpu", + kernelFunc: maxPool6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPool3D.js +function maxPool3D2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { filterSize, strides, pad: pad4, dimRoundingMode, dataFormat } = attrs; + assertNotComplex3(x, "maxPool3d"); + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, 1, pad4, dimRoundingMode, dataFormat); + const xValues = backend4.data.get(x.dataId).values; + const outBuf = pool3d4(xValues, x.shape, x.dtype, util_exports2.computeStrides(x.shape), convInfo, "max"); + return backend4.makeTensorInfo(outBuf.shape, "float32", outBuf.values); +} +var maxPool3DConfig3 = { + kernelName: MaxPool3D2, + backendName: "cpu", + kernelFunc: maxPool3D2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPool3DGrad.js +function maxPool3DGrad3(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + assertNotComplex3([dy, input3], "maxPool3DGrad"); + const convInfo = backend_util_exports2.computePool3DInfo(input3.shape, filterSize, strides, 1, pad4, dimRoundingMode); + const inputBuf = backend4.bufferSync(input3); + const maxPosBuf = maxPool3dPositions2(inputBuf, convInfo); + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const dx = buffer2(input3.shape, "float32"); + const dyBuf = backend4.bufferSync(dy); + for (let batch = 0; batch < convInfo.batchSize; ++batch) { + for (let channel = 0; channel < convInfo.inChannels; ++channel) { + for (let dxDepth = 0; dxDepth < convInfo.inDepth; ++dxDepth) { + for (let dxRow = 0; dxRow < convInfo.inHeight; ++dxRow) { + for (let dxCol = 0; dxCol < convInfo.inWidth; ++dxCol) { + const dyDepthCorner = dxDepth - padFront; + const dyRowCorner = dxRow - padTop; + const dyColCorner = dxCol - padLeft; + let dotProd = 0; + for (let wDepth = 0; wDepth < effectiveFilterDepth; wDepth += dilationDepth) { + const dyDepth = (dyDepthCorner + wDepth) / strideDepth; + if (dyDepth < 0 || dyDepth >= convInfo.outDepth || Math.floor(dyDepth) !== dyDepth) { + continue; + } + for (let wRow = 0; wRow < effectiveFilterHeight; wRow += dilationHeight) { + const dyRow = (dyRowCorner + wRow) / strideHeight; + if (dyRow < 0 || dyRow >= convInfo.outHeight || Math.floor(dyRow) !== dyRow) { + continue; + } + for (let wCol = 0; wCol < effectiveFilterWidth; wCol += dilationWidth) { + const dyCol = (dyColCorner + wCol) / strideWidth; + if (dyCol < 0 || dyCol >= convInfo.outWidth || Math.floor(dyCol) !== dyCol) { + continue; + } + const maxPos = effectiveFilterDepth * effectiveFilterHeight * effectiveFilterWidth - 1 - maxPosBuf.get(batch, dyDepth, dyRow, dyCol, channel); + const curPos = wDepth * effectiveFilterHeight * effectiveFilterWidth + wRow * effectiveFilterWidth + wCol; + const mask = maxPos === curPos ? 1 : 0; + if (mask === 0) { + continue; + } + const pixel = dyBuf.get(batch, dyDepth, dyRow, dyCol, channel); + dotProd += pixel * mask; + } + } + } + dx.set(dotProd, batch, dxDepth, dxRow, dxCol, channel); + } + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var maxPool3DGradConfig4 = { + kernelName: MaxPool3DGrad2, + backendName: "cpu", + kernelFunc: maxPool3DGrad3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPoolGrad.js +function maxPoolGrad5(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3, output } = inputs; + const x = input3; + assertNotComplex3([input3, output], "maxPoolGrad"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, 1, pad4, dimRoundingMode); + const xValues = backend4.data.get(x.dataId).values; + const maxPosBuf = buffer2(convInfo.outShape, x.dtype, maxPoolPositions2(xValues, x.shape, x.dtype, convInfo).values); + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const dx = buffer2(x.shape, "float32"); + const dyData = backend4.data.get(dy.dataId).values; + const dyBuf = buffer2(dy.shape, "float32", dyData); + for (let b = 0; b < convInfo.batchSize; ++b) { + for (let d = 0; d < convInfo.inChannels; ++d) { + for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) { + const dyRCorner = dxR - padTop; + const dyCCorner = dxC - padLeft; + let dotProd = 0; + for (let wR = 0; wR < effectiveFilterHeight; wR += dilationHeight) { + const dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || Math.floor(dyR) !== dyR) { + continue; + } + for (let wC = 0; wC < effectiveFilterWidth; wC += dilationWidth) { + const dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || Math.floor(dyC) !== dyC) { + continue; + } + const maxPos = effectiveFilterHeight * effectiveFilterWidth - 1 - maxPosBuf.get(b, dyR, dyC, d); + const curPos = wR * effectiveFilterWidth + wC; + const mask = maxPos === curPos ? 1 : 0; + if (mask === 0) { + continue; + } + const pixel = dyBuf.get(b, dyR, dyC, d); + dotProd += pixel * mask; + } + } + dx.set(dotProd, b, dxR, dxC, d); + } + } + } + } + return backend4.makeTensorInfo(dx.shape, dx.dtype, dx.values); +} +var maxPoolGradConfig5 = { + kernelName: MaxPoolGrad2, + backendName: "cpu", + kernelFunc: maxPoolGrad5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPoolWithArgmax_impl.js +function maxPoolWithArgmaxImpl3(xValues, xShape, dtype, includeBatchInIndex, convInfo) { + const strides = util_exports2.computeStrides(xShape); + const maxPools = pool4(xValues, xShape, dtype, strides, convInfo, "max"); + const maxPositions = maxPoolPositions2(xValues, xShape, dtype, convInfo, true, includeBatchInIndex); + return [maxPools.values, maxPositions.values]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MaxPoolWithArgmax.js +var maxPoolWithArgmaxConfig3 = { + kernelName: MaxPoolWithArgmax2, + backendName: "cpu", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { x } = inputs; + const { filterSize, strides, pad: pad4, includeBatchInIndex } = attrs; + const cpuBackend = backend4; + assertNotComplex3(x, "MaxPoolWithArgmax"); + const values = cpuBackend.data.get(x.dataId).values; + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, [1, 1], pad4); + const [pooled, indexes] = maxPoolWithArgmaxImpl3(values, x.shape, x.dtype, includeBatchInIndex, convInfo); + const pooledDataId = cpuBackend.write(pooled, convInfo.outShape, x.dtype); + const indexesDataId = cpuBackend.write(indexes, convInfo.outShape, x.dtype); + return [ + { dataId: pooledDataId, shape: convInfo.outShape, dtype: x.dtype }, + { dataId: indexesDataId, shape: convInfo.outShape, dtype: "int32" } + ]; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Mean.js +function mean5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + const axes = util_exports2.parseAxisParam(axis, x.shape); + const shapes = backend_util_exports2.computeOutAndReduceShapes(x.shape, axes); + const reduceShape = shapes[1]; + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const toDispose = []; + const reduceSizeScalar = backend4.makeTensorInfo([], "float32", new Float32Array([reduceSize])); + toDispose.push(reduceSizeScalar); + const $x = cast8({ inputs: { x }, backend: backend4, attrs: { dtype: "float32" } }); + toDispose.push($x); + const res = div4({ inputs: { a: $x, b: reduceSizeScalar }, backend: backend4 }); + toDispose.push(res); + const result = sum8({ inputs: { x: res }, backend: backend4, attrs: { axis, keepDims } }); + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var meanConfig4 = { + kernelName: Mean2, + backendName: "cpu", + kernelFunc: mean5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Min.js +function min8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + assertNotComplex3(x, "min"); + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + if (permutedAxes != null) { + $x = transpose6({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("min", axes, $x.shape.length); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes($x.shape, axes); + const reduceSize = util_exports2.sizeFromShape(reduceShape); + const vals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(outShape), $x.dtype); + const aVals = backend4.data.get($x.dataId).values; + for (let i = 0; i < vals.length; ++i) { + const offset = i * reduceSize; + let min10 = aVals[offset]; + for (let j = 0; j < reduceSize; ++j) { + const value = aVals[offset + j]; + if (Number.isNaN(value) || value < min10) { + min10 = value; + } + } + vals[i] = min10; + } + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo($x); + } + const result = backend4.makeTensorInfo(outShape, $x.dtype, vals); + if (keepDims) { + const expandedShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + const reshapedResult = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: expandedShape } }); + backend4.disposeIntermediateTensorInfo(result); + return reshapedResult; + } + return result; +} +var minConfig4 = { + kernelName: Min2, + backendName: "cpu", + kernelFunc: min8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/MirrorPad.js +function mirrorPad5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { paddings, mode } = attrs; + assertNotComplex3(x, "mirrorPad"); + const outShape = paddings.map((p3, i) => p3[0] + x.shape[i] + p3[1]); + const start = paddings.map((p3) => p3[0]); + const end = paddings.map((p3, i) => p3[0] + x.shape[i]); + const offset = mode === "reflect" ? 0 : 1; + const xVals = backend4.data.get(x.dataId).values; + const xRank = x.shape.length; + const xStrides = util_exports2.computeStrides(x.shape); + const resultSize = util_exports2.sizeFromShape(outShape); + const resultRank = outShape.length; + const resultStrides = util_exports2.computeStrides(outShape); + const resVals = util_exports2.getTypedArrayFromDType(x.dtype, resultSize); + for (let i = 0; i < resultSize; i++) { + let coords9 = util_exports2.indexToLoc(i, resultRank, resultStrides); + for (let i2 = 0; i2 < resultRank; i2++) { + if (coords9[i2] < start[i2]) { + coords9[i2] = start[i2] * 2 - coords9[i2] - offset; + } else if (coords9[i2] >= end[i2]) { + coords9[i2] = (end[i2] - 1) * 2 - coords9[i2] + offset; + } + } + coords9 = coords9.map((c, i2) => c - start[i2]); + const inIndex = util_exports2.locToIndex(coords9, xRank, xStrides); + resVals[i] = xVals[inIndex]; + } + const outId = backend4.write(resVals, outShape, x.dtype); + return { dataId: outId, shape: outShape, dtype: x.dtype }; +} +var mirrorPadConfig4 = { + kernelName: MirrorPad2, + backendName: "cpu", + kernelFunc: mirrorPad5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Mod.js +var modImpl2 = createSimpleBinaryKernelImpl2((aValue, bValue) => { + const rem = aValue % bValue; + if (aValue < 0 && bValue < 0 || aValue >= 0 && bValue >= 0) { + return rem; + } else { + return (rem + bValue) % bValue; + } +}); +var mod5 = binaryKernelFunc3(Mod2, modImpl2); +var modConfig3 = { + kernelName: Mod2, + backendName: "cpu", + kernelFunc: mod5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Multinomial.js +var seedrandom8 = __toModule(require_seedrandom6()); + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Softmax.js +function softmax7(args) { + const { inputs, backend: backend4, attrs } = args; + const { logits } = inputs; + const { dim } = attrs; + const logitsRank = logits.shape.length; + let $dim = dim; + if ($dim === -1) { + $dim = logitsRank - 1; + } + if ($dim !== logitsRank - 1) { + throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${logitsRank} and dim was ${$dim}`); + } + const axes = util_exports2.parseAxisParam([$dim], logits.shape); + const maxLogit = max8({ + inputs: { x: logits }, + backend: backend4, + attrs: { reductionIndices: axes, keepDims: false } + }); + const expandedShape = backend_util_exports2.expandShapeToKeepDim(maxLogit.shape, axes); + const maxLogitReshaped = reshape7({ inputs: { x: maxLogit }, backend: backend4, attrs: { shape: expandedShape } }); + const a = sub5({ inputs: { a: logits, b: maxLogitReshaped }, backend: backend4 }); + const b = exp5({ inputs: { x: a }, backend: backend4 }); + const sumExp = sum8({ inputs: { x: b }, backend: backend4, attrs: { axis: axes, keepDims: false } }); + const sumReshaped = reshape7({ inputs: { x: sumExp }, backend: backend4, attrs: { shape: expandedShape } }); + const result = div4({ inputs: { a: b, b: sumReshaped }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(maxLogit); + backend4.disposeIntermediateTensorInfo(maxLogitReshaped); + backend4.disposeIntermediateTensorInfo(a); + backend4.disposeIntermediateTensorInfo(b); + backend4.disposeIntermediateTensorInfo(sumExp); + backend4.disposeIntermediateTensorInfo(sumReshaped); + return result; +} +var softmaxConfig4 = { + kernelName: Softmax4, + backendName: "cpu", + kernelFunc: softmax7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Multinomial.js +function multinomial5(args) { + const { inputs, backend: backend4, attrs } = args; + const { logits } = inputs; + const { numSamples, seed, normalized } = attrs; + assertNotComplex3(logits, "multinomial"); + const probabilities = normalized ? logits : softmax7({ inputs: { logits }, backend: backend4, attrs: { dim: -1 } }); + const batchSize = probabilities.shape[0]; + const numEvents = probabilities.shape[1]; + const probVals = backend4.data.get(probabilities.dataId).values; + const resShape = [batchSize, numSamples]; + const resVals = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(resShape), "int32"); + for (let b = 0; b < batchSize; ++b) { + const offset = b * numEvents; + const cdf = new Float32Array(numEvents - 1); + cdf[0] = probVals[offset]; + for (let event = 1; event < cdf.length; ++event) { + cdf[event] = cdf[event - 1] + probVals[offset + event]; + } + const random = seedrandom8.alea(seed.toString()); + const outOffset = b * numSamples; + for (let sampleId = 0; sampleId < numSamples; ++sampleId) { + const r = random(); + resVals[outOffset + sampleId] = cdf.length; + for (let event = 0; event < cdf.length; event++) { + if (r < cdf[event]) { + resVals[outOffset + sampleId] = event; + break; + } + } + } + } + if (!normalized) { + backend4.disposeIntermediateTensorInfo(probabilities); + } + return backend4.makeTensorInfo(resShape, "int32", resVals); +} +var multinomialConfig3 = { + kernelName: Multinomial2, + backendName: "cpu", + kernelFunc: multinomial5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/NonMaxSuppressionV3.js +var nonMaxSuppressionV3Impl5 = kernel_impls_exports2.nonMaxSuppressionV3Impl; +function nonMaxSuppressionV33(args) { + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold } = attrs; + assertNotComplex3(boxes, "NonMaxSuppression"); + const boxesVals = backend4.data.get(boxes.dataId).values; + const scoresVals = backend4.data.get(scores.dataId).values; + const { selectedIndices } = nonMaxSuppressionV3Impl5(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + return backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)); +} +var nonMaxSuppressionV3Config4 = { + kernelName: NonMaxSuppressionV32, + backendName: "cpu", + kernelFunc: nonMaxSuppressionV33 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/NonMaxSuppressionV4.js +var nonMaxSuppressionV4Impl5 = kernel_impls_exports2.nonMaxSuppressionV4Impl; +function nonMaxSuppressionV44(args) { + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize } = attrs; + assertNotComplex3(boxes, "NonMaxSuppressionPadded"); + const boxesVals = backend4.data.get(boxes.dataId).values; + const scoresVals = backend4.data.get(scores.dataId).values; + const { selectedIndices, validOutputs } = nonMaxSuppressionV4Impl5(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize); + return [ + backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)), + backend4.makeTensorInfo([], "int32", new Int32Array([validOutputs])) + ]; +} +var nonMaxSuppressionV4Config4 = { + kernelName: NonMaxSuppressionV42, + backendName: "cpu", + kernelFunc: nonMaxSuppressionV44 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/NonMaxSuppressionV5.js +var nonMaxSuppressionV5Impl5 = kernel_impls_exports2.nonMaxSuppressionV5Impl; +function nonMaxSuppressionV53(args) { + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma } = attrs; + assertNotComplex3(boxes, "NonMaxSuppressionWithScore"); + const boxesVals = backend4.data.get(boxes.dataId).values; + const scoresVals = backend4.data.get(scores.dataId).values; + const maxOutputSizeVal = maxOutputSize; + const iouThresholdVal = iouThreshold; + const scoreThresholdVal = scoreThreshold; + const softNmsSigmaVal = softNmsSigma; + const { selectedIndices, selectedScores } = nonMaxSuppressionV5Impl5(boxesVals, scoresVals, maxOutputSizeVal, iouThresholdVal, scoreThresholdVal, softNmsSigmaVal); + return [ + backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)), + backend4.makeTensorInfo([selectedScores.length], "float32", new Float32Array(selectedScores)) + ]; +} +var nonMaxSuppressionV5Config4 = { + kernelName: NonMaxSuppressionV52, + backendName: "cpu", + kernelFunc: nonMaxSuppressionV53 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/OneHot.js +function oneHot6(args) { + const { inputs, backend: backend4, attrs } = args; + const { indices } = inputs; + const { depth, onValue, offValue } = attrs; + assertNotComplex3(indices, "oneHot"); + const indicesSize = util_exports2.sizeFromShape(indices.shape); + const res = new Float32Array(indicesSize * depth); + res.fill(offValue); + const indicesVal = backend4.data.get(indices.dataId).values; + for (let event = 0; event < indicesSize; ++event) { + if (indicesVal[event] >= 0 && indicesVal[event] < depth) { + res[event * depth + indicesVal[event]] = onValue; + } + } + return backend4.makeTensorInfo([...indices.shape, depth], "int32", res); +} +var oneHotConfig4 = { + kernelName: OneHot2, + backendName: "cpu", + kernelFunc: oneHot6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ZerosLike.js +function zerosLike6(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (x.dtype === "string") { + throw new Error("zerosLike is not supported for string tensors"); + } else if (x.dtype === "complex64") { + const realPart = real5({ inputs: { input: x }, backend: backend4 }); + const r = zerosLike6({ inputs: { x: realPart }, backend: backend4 }); + const imagPart = imag5({ inputs: { input: x }, backend: backend4 }); + const i = zerosLike6({ inputs: { x: imagPart }, backend: backend4 }); + const result = complex5({ inputs: { real: r, imag: i }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(r); + backend4.disposeIntermediateTensorInfo(imagPart); + backend4.disposeIntermediateTensorInfo(i); + return result; + } else { + return fill6({ backend: backend4, attrs: { shape: x.shape, value: 0, dtype: x.dtype } }); + } +} +var zerosLikeConfig4 = { + kernelName: ZerosLike2, + backendName: "cpu", + kernelFunc: zerosLike6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/OnesLike.js +function onesLike6(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (x.dtype === "string") { + throw new Error("onesLike is not supported for string tensors"); + } else if (x.dtype === "complex64") { + const realPart = real5({ inputs: { input: x }, backend: backend4 }); + const r = onesLike6({ inputs: { x: realPart }, backend: backend4 }); + const imagPart = imag5({ inputs: { input: x }, backend: backend4 }); + const i = zerosLike6({ inputs: { x: imagPart }, backend: backend4 }); + const result = complex5({ inputs: { real: r, imag: i }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(r); + backend4.disposeIntermediateTensorInfo(imagPart); + backend4.disposeIntermediateTensorInfo(i); + return result; + } else { + return fill6({ backend: backend4, attrs: { shape: x.shape, value: 1, dtype: x.dtype } }); + } +} +var onesLikeConfig4 = { + kernelName: OnesLike2, + backendName: "cpu", + kernelFunc: onesLike6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Pack.js +function pack4(args) { + const { inputs, backend: backend4, attrs } = args; + const { axis } = attrs; + if (inputs.length === 1) { + return expandDims8({ inputs: { input: inputs[0] }, backend: backend4, attrs: { dim: axis } }); + } + const shape = inputs[0].shape; + const dtype = inputs[0].dtype; + inputs.forEach((t) => { + util_exports2.assertShapesMatch(shape, t.shape, "All tensors passed to stack must have matching shapes"); + util_exports2.assert(dtype === t.dtype, () => "All tensors passed to stack must have matching dtypes"); + }); + const intermediateTensorInfos = []; + const expandedTensors = inputs.map((t) => { + const expandedT = expandDims8({ inputs: { input: t }, backend: backend4, attrs: { dim: axis } }); + intermediateTensorInfos.push(expandedT); + return expandedT; + }); + const result = concat6({ inputs: expandedTensors, backend: backend4, attrs: { axis } }); + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var packConfig4 = { + kernelName: Pack2, + backendName: "cpu", + kernelFunc: pack4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/PadV2.js +function padV23(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { paddings, constantValue } = attrs; + assertNotComplex3(x, "pad"); + const outShape = paddings.map((p3, i) => p3[0] + x.shape[i] + p3[1]); + const start = paddings.map((p3) => p3[0]); + const xVals = backend4.data.get(x.dataId).values; + const xSize = util_exports2.sizeFromShape(x.shape); + const xRank = x.shape.length; + const xStrides = util_exports2.computeStrides(x.shape); + const resultSize = util_exports2.sizeFromShape(outShape); + const resultRank = outShape.length; + const resultStrides = util_exports2.computeStrides(outShape); + const resVals = util_exports2.getTypedArrayFromDType(x.dtype, resultSize); + if (constantValue !== 0) { + resVals.fill(constantValue); + } + for (let i = 0; i < xSize; i++) { + const coords9 = util_exports2.indexToLoc(i, xRank, xStrides); + const outCoords = coords9.map((c, i2) => c + start[i2]); + const outIndex = util_exports2.locToIndex(outCoords, resultRank, resultStrides); + resVals[outIndex] = xVals[i]; + } + const outId = backend4.write(resVals, outShape, x.dtype); + return { dataId: outId, shape: outShape, dtype: x.dtype }; +} +var padV2Config4 = { + kernelName: PadV22, + backendName: "cpu", + kernelFunc: padV23 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Pow.js +var powImpl2 = createSimpleBinaryKernelImpl2((a, b) => Math.pow(a, b)); +var pow5 = binaryKernelFunc3(Pow2, powImpl2); +var powConfig4 = { + kernelName: Pow2, + backendName: "cpu", + kernelFunc: pow5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Range.js +function range8(args) { + const { backend: backend4, attrs } = args; + const { start, stop, dtype, step: step8 } = attrs; + const values = rangeImpl2(start, stop, step8, dtype); + return backend4.makeTensorInfo([values.length], dtype, values); +} +var rangeConfig4 = { + kernelName: Range2, + backendName: "cpu", + kernelFunc: range8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Reciprocal.js +var reciprocal5 = unaryKernelFunc3(Reciprocal2, (xi) => 1 / xi); +var reciprocalConfig3 = { + kernelName: Reciprocal2, + backendName: "cpu", + kernelFunc: reciprocal5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ResizeBilinear.js +function resizeBilinear6(args) { + const { inputs, backend: backend4, attrs } = args; + const { images } = inputs; + const { alignCorners, halfPixelCenters, size: size2 } = attrs; + assertNotComplex3(images, "resizeBilinear"); + const imagesStrides = util_exports2.computeStrides(images.shape); + const [newHeight, newWidth] = size2; + const [batch, oldHeight, oldWidth, numChannels] = images.shape; + const xValues = backend4.data.get(images.dataId).values; + const result = new Float32Array(util_exports2.sizeFromShape([batch, newHeight, newWidth, numChannels])); + const effectiveInputSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutputSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + let outputIdx = 0; + const effectiveRowSizeRatio = effectiveInputSize[0] / effectiveOutputSize[0]; + const effectiveColSizeRatio = effectiveInputSize[1] / effectiveOutputSize[1]; + for (let b = 0; b < batch; b++) { + for (let r = 0; r < newHeight; r++) { + let sourceFracRow; + if (halfPixelCenters) { + sourceFracRow = effectiveRowSizeRatio * (r + 0.5) - 0.5; + } else { + sourceFracRow = effectiveRowSizeRatio * r; + } + const sourceRowFloor = Math.max(0, Math.floor(sourceFracRow)); + const rowFrac = sourceFracRow - sourceRowFloor; + const sourceRowCeil = Math.min(oldHeight - 1, Math.ceil(sourceFracRow)); + const topRowOffset = b * imagesStrides[0] + sourceRowFloor * imagesStrides[1]; + const botRowOffset = b * imagesStrides[0] + sourceRowCeil * imagesStrides[1]; + for (let c = 0; c < newWidth; c++) { + let sourceFracCol; + if (halfPixelCenters) { + sourceFracCol = effectiveColSizeRatio * (c + 0.5) - 0.5; + } else { + sourceFracCol = effectiveColSizeRatio * c; + } + const sourceColFloor = Math.max(0, Math.floor(sourceFracCol)); + const colFrac = sourceFracCol - sourceColFloor; + const sourceColCeil = Math.min(oldWidth - 1, Math.ceil(sourceFracCol)); + const topLeftOffest = topRowOffset + sourceColFloor * imagesStrides[2]; + const botLeftOffset = botRowOffset + sourceColFloor * imagesStrides[2]; + const topRightOffset = topRowOffset + sourceColCeil * imagesStrides[2]; + const botRightOffest = botRowOffset + sourceColCeil * imagesStrides[2]; + for (let d = 0; d < numChannels; d++) { + const topLeft = xValues[topLeftOffest + d]; + const bottomLeft = xValues[botLeftOffset + d]; + const topRight = xValues[topRightOffset + d]; + const bottomRight = xValues[botRightOffest + d]; + const top = topLeft + (topRight - topLeft) * colFrac; + const bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac; + const newValue = top + (bottom - top) * rowFrac; + result[outputIdx++] = newValue; + } + } + } + } + return backend4.makeTensorInfo([batch, newHeight, newWidth, numChannels], "float32", result); +} +var resizeBilinearConfig4 = { + kernelName: ResizeBilinear2, + backendName: "cpu", + kernelFunc: resizeBilinear6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ResizeBilinearGrad.js +function resizeBilinearGrad3(args) { + const { inputs, backend: backend4, attrs } = args; + const { images, dy } = inputs; + const { alignCorners } = attrs; + assertNotComplex3([dy, images], "resizeBilinearGrad"); + const imagesStrides = util_exports2.computeStrides(images.shape); + const [batch, xHeight, xWidth, depth] = images.shape; + const [, yHeight, yWidth] = dy.shape; + const output = new Float32Array(batch * xHeight * xWidth * depth); + const effectiveXSize = [ + alignCorners && yHeight > 1 ? xHeight - 1 : xHeight, + alignCorners && yWidth > 1 ? xWidth - 1 : xWidth + ]; + const effectiveYSize = [ + alignCorners && yHeight > 1 ? yHeight - 1 : yHeight, + alignCorners && yWidth > 1 ? yWidth - 1 : yWidth + ]; + const heightScale = effectiveXSize[0] / effectiveYSize[0]; + const widthScale = effectiveXSize[1] / effectiveYSize[1]; + const dyValues = backend4.data.get(dy.dataId).values; + let offset = 0; + for (let b = 0; b < batch; b++) { + const bOffset = b * imagesStrides[0]; + for (let r = 0; r < yHeight; r++) { + const dxR = r * heightScale; + const topDxRIndex = Math.floor(dxR); + const bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1); + const topDxROffset = bOffset + topDxRIndex * imagesStrides[1]; + const bottomDxROffset = bOffset + bottomDxRIndex * imagesStrides[1]; + const dxRLerp = dxR - topDxRIndex; + const inverseDxRLerp = 1 - dxRLerp; + for (let c = 0; c < yWidth; c++) { + const dxC = c * widthScale; + const leftDxCIndex = Math.floor(dxC); + const rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1); + const dxCLerp = dxC - leftDxCIndex; + const inverseDxCLerp = 1 - dxCLerp; + const topLeftRCOffset = topDxROffset + leftDxCIndex * imagesStrides[2]; + const topRightRCOffset = topDxROffset + rightDxCIndex * imagesStrides[2]; + const bottomLeftRCOffset = bottomDxROffset + leftDxCIndex * imagesStrides[2]; + const bottomRightRCOffset = bottomDxROffset + rightDxCIndex * imagesStrides[2]; + const inverseDxRLerpTimesInverseDxCLerp = inverseDxRLerp * inverseDxCLerp; + const inverseDxRLerpTimesDxCLerp = inverseDxRLerp * dxCLerp; + const dxRLerpTimesInverseDxCLerp = dxRLerp * inverseDxCLerp; + const dxRLerpTimesDxCLerp = dxRLerp * dxCLerp; + for (let d = 0; d < depth; d++) { + const dyVal = dyValues[offset++]; + output[topLeftRCOffset + d] += dyVal * inverseDxRLerpTimesInverseDxCLerp; + output[topRightRCOffset + d] += dyVal * inverseDxRLerpTimesDxCLerp; + output[bottomLeftRCOffset + d] += dyVal * dxRLerpTimesInverseDxCLerp; + output[bottomRightRCOffset + d] += dyVal * dxRLerpTimesDxCLerp; + } + } + } + } + return backend4.makeTensorInfo([batch, xWidth, xHeight, depth], "float32", output); +} +var resizeBilinearGradConfig5 = { + kernelName: ResizeBilinearGrad2, + backendName: "cpu", + kernelFunc: resizeBilinearGrad3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ResizeNearestNeighbor.js +function resizeNearestNeighbor5(args) { + const { inputs, backend: backend4, attrs } = args; + const { images } = inputs; + const { alignCorners, halfPixelCenters, size: size2 } = attrs; + assertNotComplex3(images, "resizeNearestNeighbor"); + const imagesStrides = util_exports2.computeStrides(images.shape); + const [newHeight, newWidth] = size2; + const [batch, oldHeight, oldWidth, numChannels] = images.shape; + const xValues = backend4.data.get(images.dataId).values; + const output = new Float32Array(batch * newHeight * newWidth * numChannels); + const effectiveInputSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutputSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + const effectiveRowSizeRatio = effectiveInputSize[0] / effectiveOutputSize[0]; + const effectiveColSizeRatio = effectiveInputSize[1] / effectiveOutputSize[1]; + let outputOffset = 0; + for (let b = 0; b < batch; b++) { + const batchOffset = b * imagesStrides[0]; + for (let r = 0; r < newHeight; r++) { + const sourceFracRow = halfPixelCenters ? effectiveRowSizeRatio * (r + 0.5) : effectiveRowSizeRatio * r; + let sourceNearestRow = Math.min(oldHeight - 1, alignCorners ? Math.round(sourceFracRow) : Math.floor(sourceFracRow)); + if (halfPixelCenters) { + sourceNearestRow = Math.max(0, sourceNearestRow); + } + const rowOffset = batchOffset + sourceNearestRow * imagesStrides[1]; + for (let c = 0; c < newWidth; c++) { + const sourceFracCol = halfPixelCenters ? effectiveColSizeRatio * (c + 0.5) : effectiveColSizeRatio * c; + let sourceNearestCol = Math.min(oldWidth - 1, alignCorners ? Math.round(sourceFracCol) : Math.floor(sourceFracCol)); + if (halfPixelCenters) { + sourceNearestCol = Math.max(0, sourceNearestCol); + } + const colOffset = rowOffset + sourceNearestCol * imagesStrides[2]; + for (let d = 0; d < numChannels; d++) { + const newVal = xValues[colOffset + d]; + output[outputOffset++] = newVal; + } + } + } + } + return backend4.makeTensorInfo([batch, newHeight, newWidth, numChannels], images.dtype, output); +} +var resizeNearestNeighborConfig3 = { + kernelName: ResizeNearestNeighbor2, + backendName: "cpu", + kernelFunc: resizeNearestNeighbor5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ResizeNearestNeighborGrad.js +function resizeNearestNeighborGrad3(args) { + const { inputs, backend: backend4, attrs } = args; + const { images, dy } = inputs; + const { alignCorners } = attrs; + assertNotComplex3([dy, images], "resizeNearestNeighborGrad"); + const imagesStrides = util_exports2.computeStrides(images.shape); + const dyStrides = util_exports2.computeStrides(dy.shape); + const [batch, xHeight, xWidth, depth] = images.shape; + const [, yHeight, yWidth] = dy.shape; + const output = new Float32Array(batch * xHeight * xWidth * depth); + const dyValues = backend4.data.get(dy.dataId).values; + const effectiveXSize = [ + alignCorners && yHeight > 1 ? xHeight - 1 : xHeight, + alignCorners && yWidth > 1 ? xWidth - 1 : xWidth + ]; + const effectiveYSize = [ + alignCorners && yHeight > 1 ? yHeight - 1 : yHeight, + alignCorners && yWidth > 1 ? yWidth - 1 : yWidth + ]; + const heightScale = effectiveXSize[0] / effectiveYSize[0]; + const widthScale = effectiveXSize[1] / effectiveYSize[1]; + const invHeightScale = 1 / heightScale; + const invWidthScale = 1 / widthScale; + const winHeight = Math.ceil(invHeightScale) * 2 + 2; + const winWidth = Math.ceil(invWidthScale) * 2 + 2; + for (let b = 0; b < batch; b++) { + const batchOffset = b * imagesStrides[0]; + for (let r = 0; r < xHeight; r++) { + const rowOffset = batchOffset + r * imagesStrides[1]; + const startRLerp = Math.floor(r * invHeightScale); + const startDyR = Math.floor(startRLerp - winHeight / 2); + for (let c = 0; c < xWidth; c++) { + const colOffset = rowOffset + c * imagesStrides[2]; + const startCLerp = Math.floor(c * invWidthScale); + const startDyC = Math.floor(startCLerp - winWidth / 2); + for (let d = 0; d < depth; d++) { + let accum = 0; + for (let dyRIndex = 0; dyRIndex < winHeight; dyRIndex++) { + const dyR = dyRIndex + startDyR; + if (dyR < 0 || dyR >= yHeight) { + continue; + } + const dyROffset = batchOffset + dyR * dyStrides[1]; + const sourceFracRow = dyR * heightScale; + const sourceNearestRow = Math.min(xHeight - 1, alignCorners ? Math.round(sourceFracRow) : Math.floor(sourceFracRow)); + if (r !== sourceNearestRow) { + continue; + } + for (let dyCIndex = 0; dyCIndex < winWidth; dyCIndex++) { + const dyC = dyCIndex + startDyC; + if (dyC < 0 || dyC >= yWidth) { + continue; + } + const dyCOffset = dyROffset + dyC * dyStrides[2]; + const sourceFracCol = dyC * widthScale; + const sourceNearestCol = Math.min(xWidth - 1, alignCorners ? Math.round(sourceFracCol) : Math.floor(sourceFracCol)); + if (c === sourceNearestCol) { + accum += dyValues[dyCOffset + d]; + } + } + } + output[colOffset + d] = accum; + } + } + } + } + return backend4.makeTensorInfo(images.shape, images.dtype, output); +} +var resizeNearestNeighborGradConfig5 = { + kernelName: ResizeNearestNeighborGrad2, + backendName: "cpu", + kernelFunc: resizeNearestNeighborGrad3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Reverse.js +function reverse6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { dims } = attrs; + assertNotComplex3(x, "reverse"); + const xRank = x.shape.length; + const $dims = util_exports2.parseAxisParam(dims, x.shape); + if (xRank === 0) { + return identity5({ inputs: { x }, backend: backend4 }); + } + const outBuf = new TensorBuffer2(x.shape, x.dtype); + const xBuf = backend4.bufferSync(x); + for (let i = 0; i < outBuf.size; i++) { + const outLoc = outBuf.indexToLoc(i); + const inLoc = outLoc.slice(); + $dims.forEach((d) => inLoc[d] = x.shape[d] - 1 - inLoc[d]); + outBuf.set(xBuf.get(...inLoc), ...outLoc); + } + return backend4.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values); +} +var reverseConfig4 = { + kernelName: Reverse2, + backendName: "cpu", + kernelFunc: reverse6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/RotateWithOffset.js +var rotateWithOffsetConfig4 = { + kernelName: RotateWithOffset2, + backendName: "cpu", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { image: image9 } = inputs; + const { radians, fillValue, center } = attrs; + const cpuBackend = backend4; + const output = util_exports2.getTypedArrayFromDType(image9.dtype, util_exports2.sizeFromShape(image9.shape)); + const [batch, imageHeight, imageWidth, numChannels] = image9.shape; + const [centerX, centerY] = backend_util_exports2.getImageCenter(center, imageHeight, imageWidth); + const fullOpacityValue = 255; + const sinFactor = Math.sin(radians); + const cosFactor = Math.cos(radians); + const imageVals = cpuBackend.data.get(image9.dataId).values; + for (let batchIdx = 0; batchIdx < batch; batchIdx++) { + const batchOffset = batchIdx * imageWidth * imageHeight * numChannels; + for (let row = 0; row < imageHeight; row++) { + const rowOffset = row * (imageWidth * numChannels); + for (let col = 0; col < imageWidth; col++) { + const colOffset = col * numChannels; + for (let channel = 0; channel < numChannels; channel++) { + const coords9 = [batch, row, col, channel]; + const x = coords9[2]; + const y = coords9[1]; + let coordX = (x - centerX) * cosFactor - (y - centerY) * sinFactor; + let coordY = (x - centerX) * sinFactor + (y - centerY) * cosFactor; + coordX = Math.round(coordX + centerX); + coordY = Math.round(coordY + centerY); + let outputValue = fillValue; + if (typeof fillValue !== "number") { + if (channel === 3) { + outputValue = fullOpacityValue; + } else { + outputValue = fillValue[channel]; + } + } + if (coordX >= 0 && coordX < imageWidth && coordY >= 0 && coordY < imageHeight) { + const rotatedRowOffset = coordY * (imageWidth * numChannels); + const rotatedColOffset = coordX * numChannels; + const imageIdx = batchOffset + rotatedRowOffset + rotatedColOffset + channel; + outputValue = imageVals[imageIdx]; + } + const outIdx = batchOffset + rowOffset + colOffset + channel; + output[outIdx] = outputValue; + } + } + } + } + const dataId = cpuBackend.write(output, image9.shape, image9.dtype); + return { dataId, shape: image9.shape, dtype: image9.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Round.js +var round7 = unaryKernelFunc3(Round2, (xi) => { + const base2 = Math.floor(xi); + if (xi - base2 < 0.5) { + return Math.floor(xi); + } else if (xi - base2 > 0.5) { + return Math.ceil(xi); + } else { + if (base2 % 2 === 0) { + return base2; + } else { + return base2 + 1; + } + } +}); +var roundConfig4 = { + kernelName: Round2, + backendName: "cpu", + kernelFunc: round7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Scatter_impl.js +function scatterImpl2(indices, updates, shape, outputSize2, sliceSize, numUpdates, sliceRank, strides, defaultValue, sumDupeIndices) { + const flattenShape = [outputSize2 / sliceSize, sliceSize]; + const indicesData = indices.values; + const updatesData = updates.values; + if (outputSize2 === 0) { + return buffer2(shape, updates.dtype); + } + const outBuf = buffer2(flattenShape, updates.dtype); + outBuf.values.fill(defaultValue); + for (let i = 0; i < numUpdates; i++) { + const index = []; + let flattenIndex = 0; + for (let j = 0; j < sliceRank; j++) { + const dim = indicesData[i * sliceRank + j]; + index.push(dim); + flattenIndex += dim * strides[j]; + } + if (flattenIndex < 0 || flattenIndex >= outputSize2 / sliceSize) { + throw new Error(`Invalid indices: ${index} does not index into ${shape}`); + } + for (let k = 0; k < sliceSize; k++) { + if (sumDupeIndices) { + outBuf.values[flattenIndex * sliceSize + k] += updatesData[i * sliceSize + k]; + } else { + outBuf.values[flattenIndex * sliceSize + k] = updates.rank === 0 ? updatesData[0] : updatesData[i * sliceSize + k]; + } + } + } + return outBuf; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ScatterNd.js +function scatterNd4(args) { + const { inputs, backend: backend4, attrs } = args; + const { indices, updates } = inputs; + const { shape } = attrs; + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports2.calculateShapes(updates, indices, shape); + const sumDupeIndices = true; + const indicesBuf = backend4.bufferSync(indices); + const updatesBuf = backend4.bufferSync(updates); + const outBuf = scatterImpl2(indicesBuf, updatesBuf, shape, outputSize2, sliceSize, numUpdates, sliceRank, strides, 0, sumDupeIndices); + return backend4.makeTensorInfo(shape, outBuf.dtype, outBuf.values); +} +var scatterNdConfig4 = { + kernelName: ScatterNd2, + backendName: "cpu", + kernelFunc: scatterNd4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Select.js +function select6(args) { + const { inputs, backend: backend4 } = args; + const { condition, t, e } = inputs; + assertNotComplex3([condition, t, e], "select"); + const conditionRank = condition.shape.length; + const values = backend4.data.get(condition.dataId).values; + const tValues = backend4.data.get(t.dataId).values; + const eValues = backend4.data.get(e.dataId).values; + const resultDtype = upcastType2(t.dtype, e.dtype); + const newValues = util_exports2.makeZerosTypedArray(util_exports2.sizeFromShape(t.shape), resultDtype); + let index = 0; + const offset = conditionRank === 0 || conditionRank > 1 || t.shape.length === 1 ? 1 : util_exports2.sizeFromShape(t.shape.slice(1)); + for (let i = 0; i < values.length; i++) { + for (let j = 0; j < offset; j++) { + if (values[i] === 1) { + newValues[index++] = tValues[i]; + } else { + newValues[index++] = eValues[i]; + } + } + } + return backend4.makeTensorInfo(t.shape, resultDtype, newValues); +} +var selectConfig4 = { + kernelName: Select2, + backendName: "cpu", + kernelFunc: select6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Selu.js +var scaleAlpha2 = backend_util_exports2.SELU_SCALEALPHA; +var scale3 = backend_util_exports2.SELU_SCALE; +var selu5 = unaryKernelFunc3(Selu3, (xi) => { + if (xi >= 0) { + return scale3 * xi; + } else { + return scaleAlpha2 * (Math.exp(xi) - 1); + } +}); +var seluConfig3 = { + kernelName: Selu3, + backendName: "cpu", + kernelFunc: selu5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sign.js +var sign5 = unaryKernelFunc3(Sign2, (xi) => { + if (xi < 0) { + return -1; + } else if (xi > 0) { + return 1; + } else { + return 0; + } +}); +var signConfig3 = { + kernelName: Sign2, + backendName: "cpu", + kernelFunc: sign5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sin.js +var sin5 = unaryKernelFunc3(Sin2, (xi) => Math.sin(xi)); +var sinConfig4 = { + kernelName: Sin2, + backendName: "cpu", + kernelFunc: sin5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Sinh.js +var sinh5 = unaryKernelFunc3(Sinh2, (xi) => Math.sinh(xi)); +var sinhConfig3 = { + kernelName: Sinh2, + backendName: "cpu", + kernelFunc: sinh5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Softplus.js +var epsilon4 = 11920928955078125e-23; +var threshold4 = Math.log(epsilon4) + 2; +var softplus5 = unaryKernelFunc3(Softplus3, (xi) => { + const tooLarge = xi > -threshold4; + const tooSmall = xi < threshold4; + const expX = Math.exp(xi); + let result; + if (tooSmall) { + result = expX; + } else if (tooLarge) { + result = xi; + } else { + result = Math.log(1 + expX); + } + return result; +}); +var softplusConfig3 = { + kernelName: Softplus3, + backendName: "cpu", + kernelFunc: softplus5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SpaceToBatchND.js +function spaceToBatchND6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockShape, paddings } = attrs; + assertNotComplex3([x], "spaceToBatchND"); + const prod8 = util_exports2.sizeFromShape(blockShape); + const completePaddings = [[0, 0]]; + completePaddings.push(...paddings); + for (let i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + const paddedX = padV2Config4.kernelFunc({ + inputs: { x }, + backend: backend4, + attrs: { paddings: completePaddings, constantValue: 0 } + }); + const reshapedPaddedShape = backend_util_exports2.getReshaped(paddedX.shape, blockShape, prod8, false); + const permutedReshapedPaddedPermutation = backend_util_exports2.getPermuted(reshapedPaddedShape.length, blockShape.length, false); + const flattenShape = backend_util_exports2.getReshapedPermuted(paddedX.shape, blockShape, prod8, false); + const reshapeInputs = { x: paddedX }; + const reshapeAttrs = { shape: reshapedPaddedShape }; + const paddedXReshaped = reshape7({ inputs: reshapeInputs, backend: backend4, attrs: reshapeAttrs }); + const transposeInputs = { x: paddedXReshaped }; + const transposeAttrs = { perm: permutedReshapedPaddedPermutation }; + const paddedXT = transpose6({ inputs: transposeInputs, backend: backend4, attrs: transposeAttrs }); + const resultReshapeInputs = { x: paddedXT }; + const resultReshapeAttrs = { shape: flattenShape }; + const result = reshape7({ inputs: resultReshapeInputs, backend: backend4, attrs: resultReshapeAttrs }); + backend4.disposeIntermediateTensorInfo(paddedX); + backend4.disposeIntermediateTensorInfo(paddedXReshaped); + backend4.disposeIntermediateTensorInfo(paddedXT); + return result; +} +var spaceToBatchNDConfig4 = { + kernelName: SpaceToBatchND2, + backendName: "cpu", + kernelFunc: spaceToBatchND6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseFillEmptyRows.js +function sparseFillEmptyRows5(args) { + const { inputs, backend: backend4 } = args; + const { indices, values, denseShape, defaultValue } = inputs; + if (denseShape.shape.length !== 1) { + throw new Error(`Dense shape must be a vector, saw: + ${denseShape.shape}`); + } + if (indices.shape.length !== 2) { + throw new Error(`Indices must be a matrix, saw: + ${indices.shape}`); + } + if (values.shape.length !== 1) { + throw new Error(`Values must be a vector, saw: + ${values.shape}`); + } + if (defaultValue.shape.length !== 0) { + throw new Error(`Default value must be a scalar, saw: + ${defaultValue.shape}`); + } + const $indices = backend4.data.get(indices.dataId).values; + const $values = backend4.data.get(values.dataId).values; + const $denseShape = backend4.data.get(denseShape.dataId).values; + const $defaultValue = backend4.data.get(defaultValue.dataId).values[0]; + const [outputIndices, outputIndicesShape, outputValues, emptyRowIndicator, reverseIndexMap] = sparseFillEmptyRowsImpl2($indices, indices.shape, indices.dtype, $values, values.dtype, $denseShape, $defaultValue); + return [ + backend4.makeTensorInfo(outputIndicesShape, indices.dtype, outputIndices), + backend4.makeTensorInfo([outputIndicesShape[0]], values.dtype, outputValues), + backend4.makeTensorInfo([emptyRowIndicator.length], "bool", new Uint8Array(emptyRowIndicator.map((value) => Number(value)))), + backend4.makeTensorInfo([reverseIndexMap.length], indices.dtype, new Int32Array(reverseIndexMap)) + ]; +} +var sparseFillEmptyRowsConfig3 = { + kernelName: SparseFillEmptyRows2, + backendName: "cpu", + kernelFunc: sparseFillEmptyRows5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseReshape.js +function sparseReshape5(args) { + const { inputs, backend: backend4 } = args; + const { inputIndices, inputShape, newShape } = inputs; + if (inputIndices.shape.length !== 2) { + throw new Error(`Input indices should be a matrix but received shape + ${inputIndices.shape}`); + } + if (inputShape.shape.length !== 1) { + throw new Error(`Input shape should be a vector but received shape + ${inputShape.shape}`); + } + if (newShape.shape.length !== 1) { + throw new Error(`Target shape should be a vector but received shape ${newShape.shape}`); + } + const $inputShape = Array.from(backend4.data.get(inputShape.dataId).values); + const $inputIndices = backend4.data.get(inputIndices.dataId).values; + const targetShape = Array.from(backend4.data.get(newShape.dataId).values); + const [newIndices, indicesShape, outputShape] = sparseReshapeImpl2($inputIndices, inputIndices.shape, inputIndices.dtype, $inputShape, targetShape); + return [ + backend4.makeTensorInfo(indicesShape, inputIndices.dtype, newIndices), + backend4.makeTensorInfo([outputShape.length], newShape.dtype, new Int32Array(outputShape)) + ]; +} +var sparseReshapeConfig3 = { + kernelName: SparseReshape2, + backendName: "cpu", + kernelFunc: sparseReshape5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseSegmentMean.js +function sparseSegmentMean5(args) { + const { inputs, backend: backend4 } = args; + const { data, indices, segmentIds } = inputs; + if (data.shape.length < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if (indices.shape.length !== 1) { + throw new Error(`Indices should be a vector but received shape + ${indices.shape}`); + } + if (segmentIds.shape.length !== 1) { + throw new Error(`Segment ids should be a vector but received shape + ${segmentIds.shape}`); + } + const $data = backend4.data.get(data.dataId).values; + const $indices = backend4.data.get(indices.dataId).values; + const $segmentIds = backend4.data.get(segmentIds.dataId).values; + const [outputData, outputDataShape] = sparseSegmentReductionImpl2($data, data.shape, data.dtype, $indices, $segmentIds, true); + return backend4.makeTensorInfo(outputDataShape, data.dtype, outputData); +} +var sparseSegmentMeanConfig3 = { + kernelName: SparseSegmentMean2, + backendName: "cpu", + kernelFunc: sparseSegmentMean5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseSegmentSum.js +function sparseSegmentSum5(args) { + const { inputs, backend: backend4 } = args; + const { data, indices, segmentIds } = inputs; + if (data.shape.length < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if (indices.shape.length !== 1) { + throw new Error(`Indices should be a vector but received shape + ${indices.shape}`); + } + if (segmentIds.shape.length !== 1) { + throw new Error(`Segment ids should be a vector but received shape + ${segmentIds.shape}`); + } + const $data = backend4.data.get(data.dataId).values; + const $indices = backend4.data.get(indices.dataId).values; + const $segmentIds = backend4.data.get(segmentIds.dataId).values; + const [outputData, outputDataShape] = sparseSegmentReductionImpl2($data, data.shape, data.dtype, $indices, $segmentIds); + return backend4.makeTensorInfo(outputDataShape, data.dtype, outputData); +} +var sparseSegmentSumConfig3 = { + kernelName: SparseSegmentSum2, + backendName: "cpu", + kernelFunc: sparseSegmentSum5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SparseToDense.js +function sparseToDense5(args) { + const { inputs, backend: backend4, attrs } = args; + const { sparseIndices, sparseValues, defaultValue } = inputs; + const { outputShape } = attrs; + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports2.calculateShapes(sparseValues, sparseIndices, outputShape); + const sumDupeIndices = false; + const indicesBuf = backend4.bufferSync(sparseIndices); + const updatesBuf = backend4.bufferSync(sparseValues); + const $defaultValue = backend4.data.get(defaultValue.dataId).values[0]; + const outBuf = scatterImpl2(indicesBuf, updatesBuf, outputShape, outputSize2, sliceSize, numUpdates, sliceRank, strides, $defaultValue, sumDupeIndices); + return backend4.makeTensorInfo(outputShape, outBuf.dtype, outBuf.values); +} +var sparseToDenseConfig3 = { + kernelName: SparseToDense2, + backendName: "cpu", + kernelFunc: sparseToDense5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/SplitV.js +function splitV4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { numOrSizeSplits, axis } = attrs; + const $axis = util_exports2.parseAxisParam(axis, x.shape)[0]; + const splitSizes = backend_util_exports2.prepareSplitSize(x, numOrSizeSplits, $axis); + const begin = new Array(x.shape.length).fill(0); + const size2 = x.shape.slice(); + return splitSizes.map((s) => { + const sliceSize = [...size2]; + sliceSize[$axis] = s; + const sliceT = slice6({ inputs: { x }, backend: backend4, attrs: { begin, size: sliceSize } }); + begin[$axis] += s; + return sliceT; + }); +} +var splitVConfig4 = { + kernelName: SplitV2, + backendName: "cpu", + kernelFunc: splitV4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Square.js +var squareConfig4 = { + kernelName: Square2, + backendName: "cpu", + kernelFunc: ({ inputs, backend: backend4 }) => { + const { x } = inputs; + const cpuBackend = backend4; + assertNotComplex3(x, "square"); + const values = cpuBackend.data.get(x.dataId).values; + const newValues = new Float32Array(values.length); + for (let i = 0; i < values.length; ++i) { + const value = values[i]; + newValues[i] = value * value; + } + const dataId = cpuBackend.write(newValues, x.shape, x.dtype); + return { dataId, shape: x.shape, dtype: x.dtype }; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Step.js +var step6 = unaryKernelFunc3(Step2, (xi, attrs) => { + const stepAttrs = attrs; + if (isNaN(xi)) { + return NaN; + } else { + return xi > 0 ? 1 : stepAttrs.alpha; + } +}); +var stepConfig4 = { + kernelName: Step2, + backendName: "cpu", + kernelFunc: step6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StridedSlice.js +function stridedSlice6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask } = attrs; + assertNotComplex3(x, "stridedSlice"); + const { nonStrided, $begin, $strides, size: size2, newShape, outShape } = slice_util_exports2.sliceInfo(x.shape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); + const $x = reshape7({ inputs: { x }, backend: backend4, attrs: { shape: newShape } }); + let result; + if (nonStrided) { + const sliced = slice6({ inputs: { x: $x }, backend: backend4, attrs: { begin: $begin, size: size2 } }); + result = reshape7({ inputs: { x: sliced }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo(sliced); + } else if (outShape.some((axis) => axis === 0)) { + result = backend4.makeTensorInfo(outShape, x.dtype, []); + } else { + const xBuf = backend4.bufferSync($x); + const outBuf = stridedSliceImpl2(outShape, xBuf, $strides, $begin); + result = backend4.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values); + } + const resultReshaped = reshape7({ inputs: { x: result }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo($x); + backend4.disposeIntermediateTensorInfo(result); + return resultReshaped; +} +var stridedSliceConfig4 = { + kernelName: StridedSlice2, + backendName: "cpu", + kernelFunc: stridedSlice6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringNGrams.js +function stringNGrams5(args) { + const { inputs, backend: backend4, attrs } = args; + const { separator, nGramWidths, leftPad, rightPad: rightPad3, padWidth, preserveShortSequences } = attrs; + const { data, dataSplits } = inputs; + const $data = backend4.data.get(data.dataId).values; + const $dataSplits = backend4.data.get(dataSplits.dataId).values; + const [nGrams, nGramsSplits] = stringNGramsImpl2($data, $dataSplits, separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences); + return [ + backend4.makeTensorInfo([nGrams.length], "string", nGrams), + backend4.makeTensorInfo(dataSplits.shape, "int32", nGramsSplits) + ]; +} +var stringNGramsConfig3 = { + kernelName: StringNGrams2, + backendName: "cpu", + kernelFunc: stringNGrams5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringSplit.js +function stringSplit5(args) { + const { inputs, backend: backend4, attrs } = args; + const { skipEmpty } = attrs; + const { input: input3, delimiter } = inputs; + if (input3.dtype !== "string") { + throw new Error("Input must be of datatype string"); + } + if (input3.shape.length !== 1) { + throw new Error(`Input must be a vector, got shape: ${input3.shape}`); + } + if (delimiter.shape.length !== 0) { + throw new Error(`Delimiter must be a scalar, got shape: ${delimiter.shape}`); + } + const $input = backend4.data.get(input3.dataId).values; + const $delimiter = backend4.data.get(delimiter.dataId).values[0]; + const [indices, values, shape] = stringSplitImpl2($input, $delimiter, skipEmpty); + const outputSize2 = values.length; + return [ + backend4.makeTensorInfo([outputSize2, 2], "int32", indices), + backend4.makeTensorInfo([outputSize2], "string", values), + backend4.makeTensorInfo([2], "int32", new Int32Array(shape)) + ]; +} +var stringSplitConfig3 = { + kernelName: StringSplit2, + backendName: "cpu", + kernelFunc: stringSplit5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/StringToHashBucketFast.js +function stringToHashBucketFast5(args) { + const { inputs, backend: backend4, attrs } = args; + const { numBuckets } = attrs; + const { input: input3 } = inputs; + if (input3.dtype !== "string") { + throw new Error("Input must be of datatype string"); + } + if (numBuckets <= 0) { + throw new Error(`Number of buckets must be at least 1`); + } + const $input = backend4.data.get(input3.dataId).values; + const output = stringToHashBucketFastImpl2($input, numBuckets); + return backend4.makeTensorInfo(input3.shape, "int32", output); +} +var stringToHashBucketFastConfig3 = { + kernelName: StringToHashBucketFast2, + backendName: "cpu", + kernelFunc: stringToHashBucketFast5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Tan.js +var tan5 = unaryKernelFunc3(Tan2, (xi) => Math.tan(xi)); +var tanConfig4 = { + kernelName: Tan2, + backendName: "cpu", + kernelFunc: tan5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Tanh.js +var tanh7 = unaryKernelFunc3(Tanh3, (xi) => Math.tanh(xi)); +var tanhConfig4 = { + kernelName: Tanh3, + backendName: "cpu", + kernelFunc: tanh7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Tile.js +function tile8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { reps } = attrs; + assertNotComplex3(x, "tile"); + const outBuf = tileImpl2(backend4.bufferSync(x), reps); + return backend4.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values); +} +var tileConfig4 = { + kernelName: Tile2, + backendName: "cpu", + kernelFunc: tile8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/TopK.js +function topK3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { k, sorted } = attrs; + assertNotComplex3(x, "topk"); + const xVals = backend4.data.get(x.dataId).values; + const [allTopKVals, allTopKIndices] = topKImpl2(xVals, x.shape, x.dtype, k, sorted); + return [ + backend4.makeTensorInfo(allTopKVals.shape, allTopKVals.dtype, allTopKVals.values), + backend4.makeTensorInfo(allTopKIndices.shape, allTopKIndices.dtype, allTopKIndices.values) + ]; +} +var topKConfig4 = { + kernelName: TopK2, + backendName: "cpu", + kernelFunc: topK3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Transform.js +function transform6(args) { + const { inputs, attrs, backend: backend4 } = args; + const { image: image9, transforms } = inputs; + const { interpolation, fillMode, fillValue, outputShape } = attrs; + const [batch, imageHeight, imageWidth, numChannels] = image9.shape; + const [outHeight, outWidth] = outputShape != null ? outputShape : [imageHeight, imageWidth]; + const outShape = [batch, outHeight, outWidth, numChannels]; + const strides = util_exports2.computeStrides(image9.shape); + const batchStride = strides[0]; + const rowStride = strides[1]; + const colStride = strides[2]; + const outVals = util_exports2.getTypedArrayFromDType(image9.dtype, util_exports2.sizeFromShape(outShape)); + outVals.fill(fillValue); + const imageVals = backend4.data.get(image9.dataId).values; + const transformVals = backend4.data.get(transforms.dataId).values; + for (let b = 0; b < batch; ++b) { + const transform8 = transforms.shape[0] === 1 ? transformVals : transformVals.subarray(b * 8, b * 8 + 8); + for (let outY = 0; outY < outHeight; ++outY) { + for (let outX = 0; outX < outWidth; ++outX) { + for (let channel = 0; channel < numChannels; ++channel) { + let val; + const projection = transform8[6] * outX + transform8[7] * outY + 1; + if (projection === 0) { + continue; + } + const inX = (transform8[0] * outX + transform8[1] * outY + transform8[2]) / projection; + const inY = (transform8[3] * outX + transform8[4] * outY + transform8[5]) / projection; + const x = mapCoord2(inX, imageWidth, fillMode); + const y = mapCoord2(inY, imageHeight, fillMode); + switch (interpolation) { + case "nearest": + val = nearestInterpolation2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, b, y, x, channel, fillValue); + break; + case "bilinear": + val = bilinearInterpolation2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, b, y, x, channel, fillValue); + break; + default: + throw new Error(`Error in Transform: Expect 'nearest' or 'bilinear', but got ${interpolation}`); + } + const ind = b * batchStride + outY * rowStride + outX * colStride + channel; + outVals[ind] = val; + } + } + } + return backend4.makeTensorInfo(outShape, image9.dtype, outVals); + } + const dataId = backend4.write(outVals, outShape, image9.dtype); + return { dataId, shape: image9.shape, dtype: image9.dtype }; +} +var transformConfig4 = { + kernelName: Transform2, + backendName: "cpu", + kernelFunc: transform6 +}; +function mapCoord2(outCoord, len, mode) { + switch (mode) { + case "reflect": + return mapCoordReflect2(outCoord, len); + case "wrap": + return mapCoordWrap2(outCoord, len); + case "nearest": + return mapCoordNearest2(outCoord, len); + case "constant": + default: + return mapCoordConstant2(outCoord, len); + } +} +function mapCoordReflect2(outCoord, len) { + let inCoord = outCoord; + if (inCoord < 0) { + if (len <= 1) { + inCoord = 0; + } else { + const sz2 = 2 * len; + if (inCoord < sz2) { + inCoord = sz2 * Math.trunc(-inCoord / sz2) + inCoord; + } + inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1; + } + } else if (inCoord > len - 1) { + if (len <= 1) { + inCoord = 0; + } else { + const sz2 = 2 * len; + inCoord -= sz2 * Math.trunc(inCoord / sz2); + if (inCoord >= len) { + inCoord = sz2 - inCoord - 1; + } + } + } + return util_exports2.clamp(0, inCoord, len - 1); +} +function mapCoordWrap2(outCoord, len) { + let inCoord = outCoord; + if (inCoord < 0) { + if (len <= 1) { + inCoord = 0; + } else { + const sz = len - 1; + inCoord += len * (Math.trunc(-inCoord / sz) + 1); + } + } else if (inCoord > len - 1) { + if (len <= 1) { + inCoord = 0; + } else { + const sz = len - 1; + inCoord -= len * Math.trunc(inCoord / sz); + } + } + return util_exports2.clamp(0, inCoord, len - 1); +} +function mapCoordConstant2(outCoord, len) { + return outCoord; +} +function mapCoordNearest2(outCoord, len) { + return util_exports2.clamp(0, outCoord, len - 1); +} +function readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, y, x, channel, fillValue) { + const ind = batch * batchStride + y * rowStride + x * colStride + channel; + if (0 <= y && y < imageHeight && 0 <= x && x < imageWidth) { + return imageVals[ind]; + } else { + return fillValue; + } +} +function nearestInterpolation2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, y, x, channel, fillValue) { + const $y = Math.round(y); + const $x = Math.round(x); + return readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, $y, $x, channel, fillValue); +} +function bilinearInterpolation2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, y, x, channel, fillValue) { + const yFloor = Math.floor(y); + const xFloor = Math.floor(x); + const yCeil = yFloor + 1; + const xCeil = xFloor + 1; + const valueYFloor = (xCeil - x) * readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, yFloor, xFloor, channel, fillValue) + (x - xFloor) * readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, yFloor, xCeil, channel, fillValue); + const valueYCeil = (xCeil - x) * readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, yCeil, xFloor, channel, fillValue) + (x - xFloor) * readWithFillValue2(imageVals, imageHeight, imageWidth, batchStride, rowStride, colStride, batch, yCeil, xCeil, channel, fillValue); + return (yCeil - y) * valueYFloor + (y - yFloor) * valueYCeil; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Unique.js +function unique7(args) { + const { inputs, attrs, backend: backend4 } = args; + const { axis } = attrs; + const { x } = inputs; + assertNotComplex3(x, "unique"); + const values = backend4.data.get(x.dataId).values; + const { outputValues, outputShape, indices } = uniqueImpl2(values, axis, x.shape, x.dtype); + return [ + backend4.makeTensorInfo(outputShape, x.dtype, outputValues), + backend4.makeTensorInfo([indices.length], "int32", indices) + ]; +} +var uniqueConfig3 = { + kernelName: Unique2, + backendName: "cpu", + kernelFunc: unique7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Unpack.js +function unpack4(args) { + const { inputs, backend: backend4, attrs } = args; + const { value } = inputs; + let { axis } = attrs; + if (axis < 0) { + axis += value.shape.length; + } + const valueRank = value.shape.length; + const num = value.shape[axis]; + const outShape = new Array(valueRank - 1); + let outIndex = 0; + for (let i = 0; i < valueRank; i++) { + if (i !== axis) { + outShape[outIndex++] = value.shape[i]; + } + } + const begin = new Array(valueRank).fill(0); + const size2 = value.shape.slice(); + size2[axis] = 1; + const res = new Array(num); + for (let i = 0; i < res.length; i++) { + begin[axis] = i; + const tempRes = slice6({ inputs: { x: value }, backend: backend4, attrs: { begin, size: size2 } }); + res[i] = reshape7({ inputs: { x: tempRes }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo(tempRes); + } + return res; +} +var unpackConfig4 = { + kernelName: Unpack2, + backendName: "cpu", + kernelFunc: unpack4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/UnsortedSegmentSum.js +function unsortedSegmentSum5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, segmentIds } = inputs; + const { numSegments } = attrs; + assertNotComplex3(x, "unsortedSegmentSum"); + const xRank = x.shape.length; + const segmentIdsRank = segmentIds.shape.length; + const res = []; + const intermediates = []; + const numIters = xRank - segmentIdsRank; + let $segmentIds = segmentIds; + for (let i = 0; i < numIters; ++i) { + const expanded = expandDims8({ inputs: { input: $segmentIds }, backend: backend4, attrs: { dim: i + 1 } }); + $segmentIds = expanded; + intermediates.push(expanded); + } + for (let i = 0; i < numSegments; ++i) { + const scalarValue = util_exports2.createScalarValue(i, "int32"); + const segmentId = backend4.makeTensorInfo([], "int32", scalarValue); + const mask = equal5({ inputs: { a: segmentId, b: $segmentIds }, backend: backend4 }); + const maskCasted = cast8({ inputs: { x: mask }, backend: backend4, attrs: { dtype: "float32" } }); + const mul3 = multiply4({ inputs: { a: maskCasted, b: x }, backend: backend4 }); + const sumTensorInfo = sum8({ inputs: { x: mul3 }, backend: backend4, attrs: { axis: 0, keepDims: false } }); + res.push(sumTensorInfo); + intermediates.push(segmentId); + intermediates.push(mask); + intermediates.push(maskCasted); + intermediates.push(mul3); + intermediates.push(sumTensorInfo); + } + const result = pack4({ inputs: res, backend: backend4, attrs: { axis: 0 } }); + intermediates.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var unsortedSegmentSumConfig3 = { + kernelName: UnsortedSegmentSum2, + backendName: "cpu", + kernelFunc: unsortedSegmentSum5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-cpu@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.js +var kernelConfigs4 = [ + _fusedMatMulConfig3, + absConfig4, + acosConfig3, + acoshConfig3, + addConfig4, + addNConfig4, + allConfig4, + anyConfig4, + argMaxConfig4, + argMinConfig3, + asinConfig3, + asinhConfig3, + atanConfig3, + atan2Config3, + atanhConfig3, + avgPoolConfig4, + avgPool3DConfig3, + avgPool3DGradConfig4, + avgPoolGradConfig5, + batchMatMulConfig4, + batchNormConfig3, + batchToSpaceNDConfig4, + bincountConfig3, + broadcastArgsConfig2, + castConfig4, + ceilConfig4, + clipConfig2, + complexConfig3, + complexAbsConfig3, + concatConfig4, + conv2DBackpropFilterConfig3, + conv2DBackpropInputConfig4, + conv2DConfig4, + conv3DBackpropFilterV2Config3, + conv3DBackpropInputV2Config2, + conv3DConfig3, + cosConfig4, + coshConfig4, + cropAndResizeConfig4, + cumsumConfig4, + denseBincountConfig3, + depthToSpaceConfig4, + depthwiseConv2dNativeConfig4, + depthwiseConv2dNativeBackpropFilterConfig3, + depthwiseConv2dNativeBackpropInputConfig3, + diagConfig3, + dilation2dConfig2, + dilation2dBackpropInputConfig2, + dilation2dBackpropFilterConfig2, + realDivConfig4, + einsumConfig3, + eluConfig4, + eluGradConfig5, + equalConfig4, + erfConfig3, + expConfig4, + expandDimsConfig4, + expm1Config3, + fftConfig3, + fillConfig4, + flipLeftRightConfig4, + floorConfig4, + floorDivConfig4, + fusedConv2DConfig4, + fusedDepthwiseConv2DConfig4, + gatherNdConfig4, + gatherV2Config4, + greaterConfig4, + greaterEqualConfig4, + identityConfig4, + ifftConfig3, + imagConfig3, + isFiniteConfig3, + isInfConfig3, + isNaNConfig3, + leakyReluConfig4, + lessConfig4, + lessEqualConfig4, + linSpaceConfig3, + logConfig4, + log1pConfig3, + logicalAndConfig4, + logicalNotConfig3, + logicalOrConfig3, + lRNConfig2, + lRNGradConfig2, + maximumConfig4, + maxPoolConfig4, + maxPool3DConfig3, + maxPool3DGradConfig4, + maxPoolGradConfig5, + maxPoolWithArgmaxConfig3, + maxConfig4, + meanConfig4, + minConfig4, + minimumConfig4, + mirrorPadConfig4, + modConfig3, + multinomialConfig3, + multiplyConfig4, + negConfig4, + nonMaxSuppressionV3Config4, + nonMaxSuppressionV4Config4, + nonMaxSuppressionV5Config4, + notEqualConfig4, + oneHotConfig4, + onesLikeConfig4, + packConfig4, + padV2Config4, + powConfig4, + preluConfig4, + prodConfig4, + rangeConfig4, + realConfig3, + reciprocalConfig3, + reluConfig4, + relu6Config4, + reshapeConfig4, + resizeBilinearConfig4, + resizeBilinearGradConfig5, + resizeNearestNeighborConfig3, + resizeNearestNeighborGradConfig5, + reverseConfig4, + rotateWithOffsetConfig4, + roundConfig4, + rsqrtConfig4, + scatterNdConfig4, + selectConfig4, + seluConfig3, + sigmoidConfig4, + signConfig3, + sinConfig4, + sinhConfig3, + sliceConfig4, + softmaxConfig4, + softplusConfig3, + spaceToBatchNDConfig4, + sparseFillEmptyRowsConfig3, + sparseReshapeConfig3, + sparseSegmentMeanConfig3, + sparseSegmentSumConfig3, + sparseToDenseConfig3, + splitVConfig4, + sqrtConfig4, + squareConfig4, + squaredDifferenceConfig4, + stepConfig4, + stridedSliceConfig4, + stringNGramsConfig3, + stringSplitConfig3, + stringToHashBucketFastConfig3, + subConfig4, + sumConfig4, + tanConfig4, + tanhConfig4, + tileConfig4, + topKConfig4, + transposeConfig4, + transformConfig4, + uniqueConfig3, + unpackConfig4, + unsortedSegmentSumConfig3, + zerosLikeConfig4 +]; +for (const kernelConfig of kernelConfigs4) { + registerKernel2(kernelConfig); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/canvas_util.js +var contexts2 = {}; +var WEBGL_ATTRIBUTES2 = { + alpha: false, + antialias: false, + premultipliedAlpha: false, + preserveDrawingBuffer: false, + depth: false, + stencil: false, + failIfMajorPerformanceCaveat: true +}; +function setWebGLContext2(webGLVersion, gl) { + contexts2[webGLVersion] = gl; +} +function getWebGLContext2(webGLVersion) { + if (!(webGLVersion in contexts2)) { + const newCtx = getWebGLRenderingContext2(webGLVersion); + if (newCtx !== null) { + contexts2[webGLVersion] = newCtx; + } else { + console.log("Could not get context for WebGL version", webGLVersion); + return null; + } + } + const gl = contexts2[webGLVersion]; + if (gl.isContextLost()) { + delete contexts2[webGLVersion]; + return getWebGLContext2(webGLVersion); + } + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.STENCIL_TEST); + gl.disable(gl.BLEND); + gl.disable(gl.DITHER); + gl.disable(gl.POLYGON_OFFSET_FILL); + gl.disable(gl.SAMPLE_COVERAGE); + gl.enable(gl.SCISSOR_TEST); + gl.enable(gl.CULL_FACE); + gl.cullFace(gl.BACK); + return contexts2[webGLVersion]; +} +function createCanvas2(webGLVersion) { + if (typeof OffscreenCanvas !== "undefined" && webGLVersion === 2) { + return new OffscreenCanvas(300, 150); + } else if (typeof document !== "undefined") { + return document.createElement("canvas"); + } else { + throw new Error("Cannot create a canvas in this context"); + } +} +function getWebGLRenderingContext2(webGLVersion) { + if (webGLVersion !== 1 && webGLVersion !== 2) { + throw new Error("Cannot get WebGL rendering context, WebGL is disabled."); + } + const canvas3 = createCanvas2(webGLVersion); + canvas3.addEventListener("webglcontextlost", (ev) => { + ev.preventDefault(); + delete contexts2[webGLVersion]; + }, false); + if (webGLVersion === 1) { + return canvas3.getContext("webgl", WEBGL_ATTRIBUTES2) || canvas3.getContext("experimental-webgl", WEBGL_ATTRIBUTES2); + } + return canvas3.getContext("webgl2", WEBGL_ATTRIBUTES2); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/tex_util.js +var PackingScheme2; +(function(PackingScheme3) { + PackingScheme3[PackingScheme3["DENSE"] = 0] = "DENSE"; + PackingScheme3[PackingScheme3["SHARED_BATCH"] = 1] = "SHARED_BATCH"; +})(PackingScheme2 || (PackingScheme2 = {})); +var TextureUsage2; +(function(TextureUsage3) { + TextureUsage3[TextureUsage3["RENDER"] = 0] = "RENDER"; + TextureUsage3[TextureUsage3["UPLOAD"] = 1] = "UPLOAD"; + TextureUsage3[TextureUsage3["PIXELS"] = 2] = "PIXELS"; + TextureUsage3[TextureUsage3["DOWNLOAD"] = 3] = "DOWNLOAD"; +})(TextureUsage2 || (TextureUsage2 = {})); +var PhysicalTextureType2; +(function(PhysicalTextureType3) { + PhysicalTextureType3[PhysicalTextureType3["UNPACKED_FLOAT16"] = 0] = "UNPACKED_FLOAT16"; + PhysicalTextureType3[PhysicalTextureType3["UNPACKED_FLOAT32"] = 1] = "UNPACKED_FLOAT32"; + PhysicalTextureType3[PhysicalTextureType3["PACKED_4X1_UNSIGNED_BYTE"] = 2] = "PACKED_4X1_UNSIGNED_BYTE"; + PhysicalTextureType3[PhysicalTextureType3["PACKED_2X2_FLOAT32"] = 3] = "PACKED_2X2_FLOAT32"; + PhysicalTextureType3[PhysicalTextureType3["PACKED_2X2_FLOAT16"] = 4] = "PACKED_2X2_FLOAT16"; +})(PhysicalTextureType2 || (PhysicalTextureType2 = {})); +function getUnpackedMatrixTextureShapeWidthHeight2(rows, columns) { + return [columns, rows]; +} +function getUnpackedArraySizeFromMatrixSize2(matrixSize, channelsPerTexture) { + return matrixSize * channelsPerTexture; +} +function getDenseTexShape2(shape) { + const size2 = util_exports2.sizeFromShape(shape); + const texelsNeeded = Math.ceil(size2 / 4); + return util_exports2.sizeToSquarishShape(texelsNeeded); +} +function getPackedMatrixTextureShapeWidthHeight2(rows, columns) { + return [ + Math.max(1, Math.ceil(columns / 2)), + Math.max(1, Math.ceil(rows / 2)) + ]; +} +function getPackedRGBAArraySizeFromMatrixShape2(rows, columns) { + const [w, h] = getPackedMatrixTextureShapeWidthHeight2(rows, columns); + return w * h * 4; +} +function getTextureConfig2(gl, textureHalfFloatExtension) { + const glany = gl; + let internalFormatFloat; + let internalFormatHalfFloat; + let internalFormatPackedHalfFloat; + let internalFormatPackedFloat; + let textureFormatFloat; + let downloadTextureFormat; + let downloadUnpackNumChannels; + let defaultNumChannels; + let textureTypeHalfFloat; + let textureTypeFloat; + if (env3().getNumber("WEBGL_VERSION") === 2) { + internalFormatFloat = glany.R32F; + internalFormatHalfFloat = glany.R16F; + internalFormatPackedHalfFloat = glany.RGBA16F; + internalFormatPackedFloat = glany.RGBA32F; + textureFormatFloat = glany.RED; + downloadUnpackNumChannels = 4; + defaultNumChannels = 1; + textureTypeHalfFloat = glany.HALF_FLOAT; + textureTypeFloat = glany.FLOAT; + } else { + internalFormatFloat = gl.RGBA; + internalFormatHalfFloat = gl.RGBA; + internalFormatPackedHalfFloat = gl.RGBA; + internalFormatPackedFloat = glany.RGBA; + textureFormatFloat = gl.RGBA; + downloadUnpackNumChannels = 4; + defaultNumChannels = 4; + textureTypeHalfFloat = textureHalfFloatExtension != null ? textureHalfFloatExtension.HALF_FLOAT_OES : null; + textureTypeFloat = gl.FLOAT; + } + downloadTextureFormat = gl.RGBA; + return { + internalFormatFloat, + internalFormatHalfFloat, + internalFormatPackedHalfFloat, + internalFormatPackedFloat, + textureFormatFloat, + downloadTextureFormat, + downloadUnpackNumChannels, + defaultNumChannels, + textureTypeHalfFloat, + textureTypeFloat + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/webgl_util.js +function callAndCheck2(gl, func3) { + const returnValue = func3(); + if (env3().getBool("DEBUG")) { + checkWebGLError2(gl); + } + return returnValue; +} +function checkWebGLError2(gl) { + const error = gl.getError(); + if (error !== gl.NO_ERROR) { + throw new Error("WebGL Error: " + getWebGLErrorMessage2(gl, error)); + } +} +var MIN_FLOAT162 = 596e-10; +var MAX_FLOAT162 = 65504; +function canBeRepresented2(num) { + if (env3().getBool("WEBGL_RENDER_FLOAT32_ENABLED") || num === 0 || MIN_FLOAT162 < Math.abs(num) && Math.abs(num) < MAX_FLOAT162) { + return true; + } + return false; +} +function getWebGLErrorMessage2(gl, status) { + switch (status) { + case gl.NO_ERROR: + return "NO_ERROR"; + case gl.INVALID_ENUM: + return "INVALID_ENUM"; + case gl.INVALID_VALUE: + return "INVALID_VALUE"; + case gl.INVALID_OPERATION: + return "INVALID_OPERATION"; + case gl.INVALID_FRAMEBUFFER_OPERATION: + return "INVALID_FRAMEBUFFER_OPERATION"; + case gl.OUT_OF_MEMORY: + return "OUT_OF_MEMORY"; + case gl.CONTEXT_LOST_WEBGL: + return "CONTEXT_LOST_WEBGL"; + default: + return `Unknown error code ${status}`; + } +} +function getExtensionOrThrow2(gl, extensionName) { + return throwIfNull2(gl, () => gl.getExtension(extensionName), 'Extension "' + extensionName + '" not supported on this browser.'); +} +function createVertexShader3(gl, vertexShaderSource) { + const vertexShader = throwIfNull2(gl, () => gl.createShader(gl.VERTEX_SHADER), "Unable to create vertex WebGLShader."); + callAndCheck2(gl, () => gl.shaderSource(vertexShader, vertexShaderSource)); + callAndCheck2(gl, () => gl.compileShader(vertexShader)); + if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) { + console.log(gl.getShaderInfoLog(vertexShader)); + throw new Error("Failed to compile vertex shader."); + } + return vertexShader; +} +function createFragmentShader2(gl, fragmentShaderSource) { + const fragmentShader = throwIfNull2(gl, () => gl.createShader(gl.FRAGMENT_SHADER), "Unable to create fragment WebGLShader."); + callAndCheck2(gl, () => gl.shaderSource(fragmentShader, fragmentShaderSource)); + callAndCheck2(gl, () => gl.compileShader(fragmentShader)); + if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) { + logShaderSourceAndInfoLog2(fragmentShaderSource, gl.getShaderInfoLog(fragmentShader)); + throw new Error("Failed to compile fragment shader."); + } + return fragmentShader; +} +var lineNumberRegex2 = /ERROR: [0-9]+:([0-9]+):/g; +function logShaderSourceAndInfoLog2(shaderSource, shaderInfoLog) { + const lineNumberRegexResult = lineNumberRegex2.exec(shaderInfoLog); + if (lineNumberRegexResult == null) { + console.log(`Couldn't parse line number in error: ${shaderInfoLog}`); + console.log(shaderSource); + return; + } + const lineNumber = +lineNumberRegexResult[1]; + const shaderLines = shaderSource.split("\n"); + const pad4 = shaderLines.length.toString().length + 2; + const linesWithLineNumbers = shaderLines.map((line, lineNumber2) => util_exports2.rightPad((lineNumber2 + 1).toString(), pad4) + line); + let maxLineLength = 0; + for (let i = 0; i < linesWithLineNumbers.length; i++) { + maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength); + } + const beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1); + const errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber); + const afterErrorLines = linesWithLineNumbers.slice(lineNumber); + console.log(beforeErrorLines.join("\n")); + console.log(shaderInfoLog.split("\n")[0]); + console.log(`%c ${util_exports2.rightPad(errorLine[0], maxLineLength)}`, "border:1px solid red; background-color:#e3d2d2; color:#a61717"); + console.log(afterErrorLines.join("\n")); +} +function createProgram2(gl) { + return throwIfNull2(gl, () => gl.createProgram(), "Unable to create WebGLProgram."); +} +function linkProgram2(gl, program) { + callAndCheck2(gl, () => gl.linkProgram(program)); + if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error("Failed to link vertex and fragment shaders."); + } +} +function validateProgram2(gl, program) { + callAndCheck2(gl, () => gl.validateProgram(program)); + if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error("Shader program validation failed."); + } +} +function createStaticVertexBuffer2(gl, data) { + const buffer3 = throwIfNull2(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); + callAndCheck2(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer3)); + callAndCheck2(gl, () => gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW)); + return buffer3; +} +function createStaticIndexBuffer2(gl, data) { + const buffer3 = throwIfNull2(gl, () => gl.createBuffer(), "Unable to create WebGLBuffer"); + callAndCheck2(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer3)); + callAndCheck2(gl, () => gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW)); + return buffer3; +} +function createTexture2(gl) { + return throwIfNull2(gl, () => gl.createTexture(), "Unable to create WebGLTexture."); +} +function validateTextureSize2(width, height) { + const maxTextureSize = env3().getNumber("WEBGL_MAX_TEXTURE_SIZE"); + if (width <= 0 || height <= 0) { + const requested = `[${width}x${height}]`; + throw new Error("Requested texture size " + requested + " is invalid."); + } + if (width > maxTextureSize || height > maxTextureSize) { + const requested = `[${width}x${height}]`; + const max10 = `[${maxTextureSize}x${maxTextureSize}]`; + throw new Error("Requested texture size " + requested + " greater than WebGL maximum on this browser / GPU " + max10 + "."); + } +} +function createFramebuffer2(gl) { + return throwIfNull2(gl, () => gl.createFramebuffer(), "Unable to create WebGLFramebuffer."); +} +function bindVertexBufferToProgramAttribute2(gl, program, attribute, buffer3, arrayEntriesPerItem, itemStrideInBytes, itemOffsetInBytes) { + const loc = gl.getAttribLocation(program, attribute); + if (loc === -1) { + return false; + } + callAndCheck2(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer3)); + callAndCheck2(gl, () => gl.vertexAttribPointer(loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes, itemOffsetInBytes)); + callAndCheck2(gl, () => gl.enableVertexAttribArray(loc)); + return true; +} +function bindTextureUnit2(gl, texture, textureUnit) { + validateTextureUnit2(gl, textureUnit); + callAndCheck2(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit)); + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture)); +} +function getProgramUniformLocationOrThrow2(gl, program, uniformName) { + return throwIfNull2(gl, () => gl.getUniformLocation(program, uniformName), 'uniform "' + uniformName + '" not present in program.'); +} +function getProgramUniformLocation2(gl, program, uniformName) { + return gl.getUniformLocation(program, uniformName); +} +function bindTextureToProgramUniformSampler2(gl, texture, uniformSamplerLocation, textureUnit) { + callAndCheck2(gl, () => bindTextureUnit2(gl, texture, textureUnit)); + callAndCheck2(gl, () => gl.uniform1i(uniformSamplerLocation, textureUnit)); +} +function bindColorTextureToFramebuffer2(gl, texture, framebuffer) { + callAndCheck2(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)); + callAndCheck2(gl, () => gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0)); +} +function unbindColorTextureFromFramebuffer2(gl, framebuffer) { + callAndCheck2(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)); + callAndCheck2(gl, () => gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0)); +} +function validateFramebuffer2(gl) { + const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if (status !== gl.FRAMEBUFFER_COMPLETE) { + throw new Error("Error binding framebuffer: " + getFramebufferErrorMessage2(gl, status)); + } +} +function getFramebufferErrorMessage2(gl, status) { + switch (status) { + case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT"; + case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"; + case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS"; + case gl.FRAMEBUFFER_UNSUPPORTED: + return "FRAMEBUFFER_UNSUPPORTED"; + default: + return `unknown error ${status}`; + } +} +function throwIfNull2(gl, returnTOrNull, failureMessage) { + const tOrNull = callAndCheck2(gl, () => returnTOrNull()); + if (tOrNull == null) { + throw new Error(failureMessage); + } + return tOrNull; +} +function validateTextureUnit2(gl, textureUnit) { + const maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1; + const glTextureUnit = textureUnit + gl.TEXTURE0; + if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) { + const textureUnitRange = `[gl.TEXTURE0, gl.TEXTURE${maxTextureUnit}]`; + throw new Error(`textureUnit must be in ${textureUnitRange}.`); + } +} +function getBatchDim2(shape, dimsToSkip = 2) { + return util_exports2.sizeFromShape(shape.slice(0, shape.length - dimsToSkip)); +} +function getRowsCols2(shape) { + if (shape.length === 0) { + throw Error("Cannot get rows and columns of an empty shape array."); + } + return [ + shape.length > 1 ? shape[shape.length - 2] : 1, + shape[shape.length - 1] + ]; +} +function getShapeAs3D2(shape) { + let shapeAs3D = [1, 1, 1]; + const isScalar = shape.length === 0 || shape.length === 1 && shape[0] === 1; + if (!isScalar) { + shapeAs3D = [getBatchDim2(shape), ...getRowsCols2(shape)]; + } + return shapeAs3D; +} +function getTextureShapeFromLogicalShape2(logShape, isPacked = false) { + let maxTexSize = env3().getNumber("WEBGL_MAX_TEXTURE_SIZE"); + if (isPacked) { + maxTexSize = maxTexSize * 2; + logShape = logShape.map((d, i) => i >= logShape.length - 2 ? util_exports2.nearestLargerEven(logShape[i]) : logShape[i]); + if (logShape.length === 1) { + logShape = [2, logShape[0]]; + } + } + if (logShape.length !== 2) { + const squeezeResult = util_exports2.squeezeShape(logShape); + logShape = squeezeResult.newShape; + } + let size2 = util_exports2.sizeFromShape(logShape); + if (logShape.length <= 1 && size2 <= maxTexSize) { + return [1, size2]; + } else if (logShape.length === 2 && logShape[0] <= maxTexSize && logShape[1] <= maxTexSize) { + return logShape; + } else if (logShape.length === 3 && logShape[0] * logShape[1] <= maxTexSize && logShape[2] <= maxTexSize) { + return [logShape[0] * logShape[1], logShape[2]]; + } else if (logShape.length === 3 && logShape[0] <= maxTexSize && logShape[1] * logShape[2] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2]]; + } else if (logShape.length === 4 && logShape[0] * logShape[1] * logShape[2] <= maxTexSize && logShape[3] <= maxTexSize) { + return [logShape[0] * logShape[1] * logShape[2], logShape[3]]; + } else if (logShape.length === 4 && logShape[0] <= maxTexSize && logShape[1] * logShape[2] * logShape[3] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2] * logShape[3]]; + } else { + if (isPacked) { + const batchDim = getBatchDim2(logShape); + let rows = 2, cols = 2; + if (logShape.length) { + [rows, cols] = getRowsCols2(logShape); + } + size2 = batchDim * (rows / 2) * (cols / 2); + return util_exports2.sizeToSquarishShape(size2).map((d) => d * 2); + } + return util_exports2.sizeToSquarishShape(size2); + } +} +function isEven2(n) { + return n % 2 === 0; +} +function isReshapeFree2(shape1, shape2) { + shape1 = shape1.slice(-2); + shape2 = shape2.slice(-2); + if (util_exports2.arraysEqual(shape1, shape2)) { + return true; + } + if (!shape1.length || !shape2.length) { + return true; + } + if (shape1[0] === 0 || shape1[1] === 0 || shape2[0] === 0 || shape2[1] === 0) { + return true; + } + if (shape1.length !== shape2.length) { + const shape1Cols = shape1.slice(-1)[0]; + const shape2Cols = shape2.slice(-1)[0]; + if (shape1Cols === shape2Cols) { + return true; + } + if (isEven2(shape1Cols) && isEven2(shape2Cols) && (shape1[0] === 1 || shape2[0] === 1)) { + return true; + } + } + return shape1[1] === shape2[1] && isEven2(shape1[0]) && isEven2(shape2[0]); +} +var MAX_TEXTURE_SIZE2; +var MAX_TEXTURES_IN_SHADER2; +function getWebGLMaxTextureSize2(webGLVersion) { + if (MAX_TEXTURE_SIZE2 == null) { + const gl = getWebGLContext2(webGLVersion); + MAX_TEXTURE_SIZE2 = gl.getParameter(gl.MAX_TEXTURE_SIZE); + } + return MAX_TEXTURE_SIZE2; +} +function getMaxTexturesInShader2(webGLVersion) { + if (MAX_TEXTURES_IN_SHADER2 == null) { + const gl = getWebGLContext2(webGLVersion); + MAX_TEXTURES_IN_SHADER2 = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); + } + return Math.min(16, MAX_TEXTURES_IN_SHADER2); +} +function getWebGLDisjointQueryTimerVersion2(webGLVersion) { + if (webGLVersion === 0) { + return 0; + } + let queryTimerVersion; + const gl = getWebGLContext2(webGLVersion); + if (hasExtension2(gl, "EXT_disjoint_timer_query_webgl2") && webGLVersion === 2) { + queryTimerVersion = 2; + } else if (hasExtension2(gl, "EXT_disjoint_timer_query")) { + queryTimerVersion = 1; + } else { + queryTimerVersion = 0; + } + return queryTimerVersion; +} +function hasExtension2(gl, extensionName) { + const ext = gl.getExtension(extensionName); + return ext != null; +} +function isWebGLVersionEnabled2(webGLVersion) { + try { + const gl = getWebGLContext2(webGLVersion); + if (gl != null) { + return true; + } + } catch (e) { + console.log("Error when getting WebGL context: ", e); + return false; + } + return false; +} +function isCapableOfRenderingToFloatTexture2(webGLVersion) { + if (webGLVersion === 0) { + return false; + } + const gl = getWebGLContext2(webGLVersion); + if (webGLVersion === 1) { + if (!hasExtension2(gl, "OES_texture_float")) { + return false; + } + } else { + if (!hasExtension2(gl, "EXT_color_buffer_float")) { + return false; + } + } + const isFrameBufferComplete = createFloatTextureAndBindToFramebuffer2(gl); + return isFrameBufferComplete; +} +function isDownloadFloatTextureEnabled2(webGLVersion) { + if (webGLVersion === 0) { + return false; + } + const gl = getWebGLContext2(webGLVersion); + if (webGLVersion === 1) { + if (!hasExtension2(gl, "OES_texture_float")) { + return false; + } + if (!hasExtension2(gl, "WEBGL_color_buffer_float")) { + return false; + } + } else { + if (hasExtension2(gl, "EXT_color_buffer_float")) { + return createFloatTextureAndBindToFramebuffer2(gl); + } + const COLOR_BUFFER_HALF_FLOAT = "EXT_color_buffer_half_float"; + if (hasExtension2(gl, COLOR_BUFFER_HALF_FLOAT)) { + const textureHalfFloatExtension = gl.getExtension(COLOR_BUFFER_HALF_FLOAT); + return createHalfFloatTextureAndBindToFramebuffer2(gl, textureHalfFloatExtension); + } + return false; + } + const isFrameBufferComplete = createFloatTextureAndBindToFramebuffer2(gl); + return isFrameBufferComplete; +} +function createFloatTextureAndBindToFramebuffer2(gl) { + const texConfig = getTextureConfig2(gl); + const texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + const width = 1; + const height = 1; + gl.texImage2D(gl.TEXTURE_2D, 0, texConfig.internalFormatFloat, width, height, 0, texConfig.textureFormatFloat, texConfig.textureTypeFloat, null); + const frameBuffer = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + const isFrameBufferComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE; + gl.bindTexture(gl.TEXTURE_2D, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteTexture(texture); + gl.deleteFramebuffer(frameBuffer); + return isFrameBufferComplete; +} +function createHalfFloatTextureAndBindToFramebuffer2(gl, textureHalfFloatExtension) { + const texConfig = getTextureConfig2(gl, textureHalfFloatExtension); + const texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + const width = 1; + const height = 1; + gl.texImage2D(gl.TEXTURE_2D, 0, texConfig.internalFormatHalfFloat, width, height, 0, texConfig.textureFormatFloat, texConfig.textureTypeHalfFloat, null); + const frameBuffer = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + const isFrameBufferComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE; + gl.bindTexture(gl.TEXTURE_2D, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteTexture(texture); + gl.deleteFramebuffer(frameBuffer); + return isFrameBufferComplete; +} +function isWebGLFenceEnabled2(webGLVersion) { + if (webGLVersion !== 2) { + return false; + } + const gl = getWebGLContext2(webGLVersion); + const isEnabled = gl.fenceSync != null; + return isEnabled; +} +function assertNotComplex4(tensor3, opName) { + if (!Array.isArray(tensor3)) { + tensor3 = [tensor3]; + } + tensor3.forEach((t) => { + if (t != null) { + util_exports2.assert(t.dtype !== "complex64", () => `${opName} does not support complex64 tensors in the WebGL backend.`); + } + }); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/flags_webgl.js +var ENV7 = env3(); +ENV7.registerFlag("HAS_WEBGL", () => ENV7.getNumber("WEBGL_VERSION") > 0); +ENV7.registerFlag("WEBGL_VERSION", () => { + if (isWebGLVersionEnabled2(2)) { + return 2; + } else if (isWebGLVersionEnabled2(1)) { + return 1; + } + return 0; +}); +ENV7.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS", () => false); +ENV7.registerFlag("WEBGL_BUFFER_SUPPORTED", () => ENV7.get("WEBGL_VERSION") === 2); +ENV7.registerFlag("WEBGL_CPU_FORWARD", () => true); +ENV7.registerFlag("WEBGL_FORCE_F16_TEXTURES", () => false); +ENV7.registerFlag("WEBGL_PACK", () => ENV7.getBool("HAS_WEBGL")); +ENV7.registerFlag("WEBGL_PACK_NORMALIZATION", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_CLIP", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_DEPTHWISECONV", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_BINARY_OPERATIONS", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_UNARY_OPERATIONS", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_PACK_REDUCE", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_LAZILY_UNPACK", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_CONV_IM2COL", () => ENV7.getBool("WEBGL_PACK")); +ENV7.registerFlag("WEBGL_MAX_TEXTURE_SIZE", () => getWebGLMaxTextureSize2(ENV7.getNumber("WEBGL_VERSION"))); +ENV7.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER", () => getMaxTexturesInShader2(ENV7.getNumber("WEBGL_VERSION"))); +ENV7.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION", () => { + const webGLVersion = ENV7.getNumber("WEBGL_VERSION"); + if (webGLVersion === 0) { + return 0; + } + return getWebGLDisjointQueryTimerVersion2(webGLVersion); +}); +ENV7.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE", () => ENV7.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 && !device_util_exports2.isMobile()); +ENV7.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE", () => isCapableOfRenderingToFloatTexture2(ENV7.getNumber("WEBGL_VERSION"))); +ENV7.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED", () => { + return ENV7.getBool("WEBGL_FORCE_F16_TEXTURES") ? false : ENV7.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"); +}); +ENV7.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED", () => isDownloadFloatTextureEnabled2(ENV7.getNumber("WEBGL_VERSION"))); +ENV7.registerFlag("WEBGL_FENCE_API_ENABLED", () => isWebGLFenceEnabled2(ENV7.getNumber("WEBGL_VERSION"))); +ENV7.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM", () => { + const useUniforms = ENV7.getBool("WEBGL_RENDER_FLOAT32_ENABLED"); + return useUniforms ? 4 : 0; +}); +ENV7.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD", () => { + return -1; +}, (threshold5) => { + if (threshold5 < 0 && threshold5 !== -1) { + throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${threshold5}.`); + } +}); +ENV7.registerFlag("WEBGL_FLUSH_THRESHOLD", () => { + return device_util_exports2.isMobile() && ENV7.getBool("IS_CHROME") ? 1 : -1; +}, (threshold5) => { + if (threshold5 < 0 && threshold5 !== -1) { + throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${threshold5}.`); + } +}); +ENV7.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD", () => 128); +ENV7.registerFlag("WEBGL_USE_SHAPES_UNIFORMS", () => false); +ENV7.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD", () => 1e5); +ENV7.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD", () => 128); + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/glsl_version.js +function getGlslDifferences2() { + let version16; + let attribute; + let varyingVs; + let varyingFs; + let texture2D; + let output; + let defineOutput; + let defineSpecialNaN; + let defineSpecialInf; + let defineRound; + if (env3().getNumber("WEBGL_VERSION") === 2) { + version16 = "#version 300 es"; + attribute = "in"; + varyingVs = "out"; + varyingFs = "in"; + texture2D = "texture"; + output = "outputColor"; + defineOutput = "out vec4 outputColor;"; + defineSpecialNaN = ` + bool isnan_custom(float val) { + return (val > 0.0 || val < 0.0) ? false : val != 0.0; + } + + bvec4 isnan_custom(vec4 val) { + return bvec4(isnan_custom(val.x), + isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w)); + } + + #define isnan(value) isnan_custom(value) + `; + defineSpecialInf = ``; + defineRound = ` + #define round(value) newRound(value) + int newRound(float value) { + return int(floor(value + 0.5)); + } + + ivec4 newRound(vec4 value) { + return ivec4(floor(value + vec4(0.5))); + } + `; + } else { + version16 = ""; + attribute = "attribute"; + varyingVs = "varying"; + varyingFs = "varying"; + texture2D = "texture2D"; + output = "gl_FragColor"; + defineOutput = ""; + defineSpecialNaN = ` + #define isnan(value) isnan_custom(value) + bool isnan_custom(float val) { + return (val > 0. || val < 1. || val == 0.) ? false : true; + } + bvec4 isnan_custom(vec4 val) { + return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); + } + `; + defineSpecialInf = ` + uniform float INFINITY; + + bool isinf(float val) { + return abs(val) == INFINITY; + } + bvec4 isinf(vec4 val) { + return equal(abs(val), vec4(INFINITY)); + } + `; + defineRound = ` + int round(float value) { + return int(floor(value + 0.5)); + } + + ivec4 round(vec4 value) { + return ivec4(floor(value + vec4(0.5))); + } + `; + } + return { + version: version16, + attribute, + varyingVs, + varyingFs, + texture2D, + output, + defineOutput, + defineSpecialNaN, + defineSpecialInf, + defineRound + }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler_util.js +function getLogicalCoordinatesFromFlatIndex2(coords9, shape, index = "index") { + const strides = util_exports2.computeStrides(shape); + return strides.map((stride, i) => { + const line1 = `int ${coords9[i]} = ${index} / ${stride}`; + const line2 = i === strides.length - 1 ? `int ${coords9[i + 1]} = ${index} - ${coords9[i]} * ${stride}` : `index -= ${coords9[i]} * ${stride}`; + return `${line1}; ${line2};`; + }).join(""); +} +function getOutputLogicalCoordinatesFromFlatIndexByUniform2(coords9, shape, index = "index") { + const strides = util_exports2.computeStrides(shape); + return strides.map((_, i) => { + const line1 = `int ${coords9[i]} = ${index} / outShapeStrides[${i}]`; + const line2 = i === strides.length - 1 ? `int ${coords9[i + 1]} = ${index} - ${coords9[i]} * outShapeStrides[${i}]` : `index -= ${coords9[i]} * outShapeStrides[${i}]`; + return `${line1}; ${line2};`; + }).join(""); +} +function symbolicallyComputeStrides2(indicesArr, variableName) { + const numCoords = indicesArr.length; + const shape = indicesArr.map((d) => `${variableName}[${d}]`); + const strides = new Array(numCoords - 1); + strides[numCoords - 2] = shape[numCoords - 1]; + for (let i = numCoords - 3; i >= 0; --i) { + strides[i] = `(${strides[i + 1]} * ${shape[i + 1]})`; + } + return strides; +} +function getLogicalCoordinatesFromFlatIndexByUniform2(coords9, variableName, index = "index") { + const indicesArray = coords9.map((_, i) => i); + const strides = symbolicallyComputeStrides2(indicesArray, variableName); + return strides.map((_, i) => { + const line1 = `int ${coords9[i]} = ${index} / ${strides[i]}`; + const line2 = i === strides.length - 1 ? `int ${coords9[i + 1]} = ${index} - ${coords9[i]} * ${strides[i]}` : `index -= ${coords9[i]} * ${strides[i]}`; + return `${line1}; ${line2};`; + }).join(""); +} +function getFlatIndexFrom3D2(shape) { + const strides = util_exports2.computeStrides(shape).map((d) => d.toString()); + return ` + int getFlatIndex(ivec3 coords) { + return coords.x * ${strides[0]} + coords.y * ${strides[1]} + coords.z; + } +`; +} +function getFlatIndexFrom3DOutput2() { + return ` + int getFlatIndex(ivec3 coords) { + return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; + } +`; +} +var ENCODE_FLOAT_SNIPPET2 = ` + const float FLOAT_MAX = 1.70141184e38; + const float FLOAT_MIN = 1.17549435e-38; + + lowp vec4 encode_float(highp float v) { + if (isnan(v)) { + return vec4(255, 255, 255, 255); + } + + highp float av = abs(v); + + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; + } + + highp vec4 c = vec4(0,0,0,0); + + highp float e = floor(log2(av)); + highp float m = exp2(fract(log2(av))) - 1.0; + + c[2] = floor(128.0 * m); + m -= c[2] / 128.0; + c[1] = floor(32768.0 * m); + m -= c[1] / 32768.0; + c[0] = floor(8388608.0 * m); + + highp float ebias = e + 127.0; + c[3] = floor(ebias / 2.0); + ebias -= c[3] * 2.0; + c[2] += floor(ebias) * 128.0; + + c[3] += 128.0 * step(0.0, -v); + + return c / 255.0; + } +`; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/shader_compiler.js +var { getBroadcastDims: getBroadcastDims4 } = backend_util_exports2; +function makeShader2(inputsInfo, outputShape, program) { + const prefixSnippets = []; + inputsInfo.forEach((x) => { + const size2 = util_exports2.sizeFromShape(x.shapeInfo.logicalShape); + if (x.shapeInfo.isUniform) { + prefixSnippets.push(`uniform float ${x.name}${size2 > 1 ? `[${size2}]` : ""};`); + } else { + prefixSnippets.push(`uniform sampler2D ${x.name};`); + prefixSnippets.push(`uniform int offset${x.name};`); + } + if (program.enableShapeUniforms) { + const { uniformShape } = getUniformInfoFromShape2(program.packedInputs, x.shapeInfo.logicalShape, x.shapeInfo.texShape); + switch (uniformShape.length) { + case 1: + prefixSnippets.push(`uniform int ${x.name}Shape;`); + break; + case 2: + prefixSnippets.push(`uniform ivec2 ${x.name}Shape;`); + break; + case 3: + prefixSnippets.push(`uniform ivec3 ${x.name}Shape;`); + break; + case 4: + prefixSnippets.push(`uniform ivec4 ${x.name}Shape;`); + break; + default: + break; + } + prefixSnippets.push(`uniform ivec2 ${x.name}TexShape;`); + } + }); + if (program.enableShapeUniforms) { + switch (outputShape.logicalShape.length) { + case 1: + prefixSnippets.push(`uniform int outShape;`); + break; + case 2: + prefixSnippets.push(`uniform ivec2 outShape;`); + prefixSnippets.push(`uniform int outShapeStrides;`); + break; + case 3: + prefixSnippets.push(`uniform ivec3 outShape;`); + prefixSnippets.push(`uniform ivec2 outShapeStrides;`); + break; + case 4: + prefixSnippets.push(`uniform ivec4 outShape;`); + prefixSnippets.push(`uniform ivec3 outShapeStrides;`); + break; + default: + break; + } + prefixSnippets.push(`uniform ivec2 outTexShape;`); + } + if (program.customUniforms) { + program.customUniforms.forEach((d) => { + prefixSnippets.push(`uniform ${d.type} ${d.name}${d.arrayIndex ? `[${d.arrayIndex}]` : ""};`); + }); + } + const inputPrefixSnippet = prefixSnippets.join("\n"); + const inputSamplingSnippet = inputsInfo.map((x) => getInputSamplingSnippet2(x, outputShape, program.packedInputs, program.enableShapeUniforms)).join("\n"); + const outTexShape = outputShape.texShape; + const glsl = getGlslDifferences2(); + const floatTextureSampleSnippet = getFloatTextureSampleSnippet2(glsl); + let outputSamplingSnippet; + let floatTextureSetOutputSnippet; + let shaderPrefix = getShaderPrefix2(glsl); + if (outputShape.isPacked) { + outputSamplingSnippet = getPackedOutputSamplingSnippet2(outputShape.logicalShape, outTexShape, program.enableShapeUniforms); + floatTextureSetOutputSnippet = getFloatTextureSetRGBASnippet2(glsl); + } else { + outputSamplingSnippet = getOutputSamplingSnippet2(outputShape.logicalShape, outTexShape, program.enableShapeUniforms); + floatTextureSetOutputSnippet = getFloatTextureSetRSnippet2(glsl); + } + if (program.packedInputs) { + shaderPrefix += SHADER_PACKED_PREFIX2; + } + const source = [ + shaderPrefix, + floatTextureSampleSnippet, + floatTextureSetOutputSnippet, + inputPrefixSnippet, + outputSamplingSnippet, + inputSamplingSnippet, + program.userCode + ].join("\n"); + return source; +} +function getSamplerFromInInfo2(inInfo, enableShapeUniforms = false) { + const shape = inInfo.shapeInfo.logicalShape; + switch (shape.length) { + case 0: + return getSamplerScalar2(inInfo, enableShapeUniforms); + case 1: + return getSampler1D2(inInfo, enableShapeUniforms); + case 2: + return getSampler2D2(inInfo, enableShapeUniforms); + case 3: + return getSampler3D2(inInfo, enableShapeUniforms); + case 4: + return getSampler4D2(inInfo, enableShapeUniforms); + case 5: + return getSampler5D2(inInfo); + case 6: + return getSampler6D2(inInfo); + default: + throw new Error(`${shape.length}-D input sampling is not yet supported`); + } +} +function getPackedSamplerFromInInfo2(inInfo, enableShapeUniforms) { + const shape = inInfo.shapeInfo.logicalShape; + switch (shape.length) { + case 0: + return getPackedSamplerScalar2(inInfo); + case 1: + return getPackedSampler1D2(inInfo, enableShapeUniforms); + case 2: + return getPackedSampler2D2(inInfo, enableShapeUniforms); + case 3: + return getPackedSampler3D2(inInfo, enableShapeUniforms); + default: + return getPackedSamplerND2(inInfo, enableShapeUniforms); + } +} +function getInputSamplingSnippet2(inInfo, outShapeInfo, usesPackedTextures = false, enableShapeUniforms) { + let res = ""; + if (usesPackedTextures) { + res += getPackedSamplerFromInInfo2(inInfo, enableShapeUniforms); + } else { + res += getSamplerFromInInfo2(inInfo, enableShapeUniforms); + } + const inShape = inInfo.shapeInfo.logicalShape; + const outShape = outShapeInfo.logicalShape; + if (inShape.length <= outShape.length) { + if (usesPackedTextures) { + res += getPackedSamplerAtOutputCoords2(inInfo, outShapeInfo); + } else { + res += getSamplerAtOutputCoords2(inInfo, outShapeInfo); + } + } + return res; +} +function getPackedOutputSamplingSnippet2(outShape, outTexShape, enableShapeUniforms) { + switch (outShape.length) { + case 0: + return getOutputScalarCoords2(); + case 1: + return getOutputPacked1DCoords2(outShape, outTexShape, enableShapeUniforms); + case 2: + return getOutputPacked2DCoords2(outShape, outTexShape, enableShapeUniforms); + case 3: + return getOutputPacked3DCoords2(outShape, outTexShape, enableShapeUniforms); + default: + return getOutputPackedNDCoords2(outShape, outTexShape, enableShapeUniforms); + } +} +function getOutputSamplingSnippet2(outShape, outTexShape, enableShapeUniforms) { + switch (outShape.length) { + case 0: + return getOutputScalarCoords2(); + case 1: + return getOutput1DCoords2(outShape, outTexShape, enableShapeUniforms); + case 2: + return getOutput2DCoords2(outShape, outTexShape, enableShapeUniforms); + case 3: + return getOutput3DCoords2(outShape, outTexShape, enableShapeUniforms); + case 4: + return getOutput4DCoords2(outShape, outTexShape, enableShapeUniforms); + case 5: + return getOutput5DCoords2(outShape, outTexShape); + case 6: + return getOutput6DCoords2(outShape, outTexShape); + default: + throw new Error(`${outShape.length}-D output sampling is not yet supported`); + } +} +function getFloatTextureSampleSnippet2(glsl) { + return ` + float sampleTexture(sampler2D textureSampler, vec2 uv) { + return ${glsl.texture2D}(textureSampler, uv).r; + } + `; +} +function getFloatTextureSetRSnippet2(glsl) { + return ` + void setOutput(float val) { + ${glsl.output} = vec4(val, 0, 0, 0); + } + `; +} +function getFloatTextureSetRGBASnippet2(glsl) { + return ` + void setOutput(vec4 val) { + ${glsl.output} = val; + } + `; +} +function getShaderPrefix2(glsl) { + const SHADER_PREFIX = `${glsl.version} + precision highp float; + precision highp int; + precision highp sampler2D; + ${glsl.varyingFs} vec2 resultUV; + ${glsl.defineOutput} + const vec2 halfCR = vec2(0.5, 0.5); + + struct ivec5 + { + int x; + int y; + int z; + int w; + int u; + }; + + struct ivec6 + { + int x; + int y; + int z; + int w; + int u; + int v; + }; + + uniform float NAN; + ${glsl.defineSpecialNaN} + ${glsl.defineSpecialInf} + ${glsl.defineRound} + + int imod(int x, int y) { + return x - y * (x / y); + } + + int idiv(int a, int b, float sign) { + int res = a / b; + int mod = imod(a, b); + if (sign < 0. && mod != 0) { + res -= 1; + } + return res; + } + + //Based on the work of Dave Hoskins + //https://www.shadertoy.com/view/4djSRW + #define HASHSCALE1 443.8975 + float random(float seed){ + vec2 p = resultUV * seed; + vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); + } + + ${SAMPLE_1D_SNIPPET2} + ${SAMPLE_2D_SNIPPET2} + ${SAMPLE_3D_SNIPPET2} + `; + return SHADER_PREFIX; +} +var SAMPLE_1D_SNIPPET2 = ` +vec2 uvFromFlat(int texNumR, int texNumC, int index) { + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { + int texelIndex = index / 2; + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`; +var SAMPLE_2D_SNIPPET2 = ` +vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, + int texNumC, int row, int col) { + int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`; +var SAMPLE_3D_SNIPPET2 = ` +vec2 packedUVfrom3D(int texNumR, int texNumC, + int texelsInBatch, int texelsInLogicalRow, int b, + int row, int col) { + int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); +} +`; +var SHADER_PACKED_PREFIX2 = ` + float getChannel(vec4 frag, vec2 innerDims) { + vec2 modCoord = mod(innerDims, 2.); + return modCoord.x == 0. ? + (modCoord.y == 0. ? frag.r : frag.g) : + (modCoord.y == 0. ? frag.b : frag.a); + } + float getChannel(vec4 frag, int dim) { + float modCoord = mod(float(dim), 2.); + return modCoord == 0. ? frag.r : frag.g; + } +`; +function getOutputScalarCoords2() { + return ` + int getOutputCoords() { + return 0; + } + `; +} +function getOutputPacked1DCoords2(shape, texShape, enableShapeUniforms) { + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + if (packedTexShape[0] === 1) { + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); + } + `; + } + return ` + int getOutputCoords() { + return 2 * int(resultUV.x * ${packedTexShape[1]}.0); + } + `; + } + if (packedTexShape[1] === 1) { + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); + } + `; + } + return ` + int getOutputCoords() { + return 2 * int(resultUV.y * ${packedTexShape[0]}.0); + } + `; + } + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y); + } + `; + } + return ` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${packedTexShape[0]}, ${packedTexShape[1]})); + return 2 * (resTexRC.x * ${packedTexShape[1]} + resTexRC.y); + } + `; +} +function getOutput1DCoords2(shape, texShape, enableShapeUniforms) { + if (texShape[0] === 1) { + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + return int(resultUV.x * float(outTexShape[1])); + } + `; + } + return ` + int getOutputCoords() { + return int(resultUV.x * ${texShape[1]}.0); + } + `; + } + if (texShape[1] === 1) { + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + return int(resultUV.y * float(outTexShape[0])); + } + `; + } + return ` + int getOutputCoords() { + return int(resultUV.y * ${texShape[0]}.0); + } + `; + } + if (enableShapeUniforms) { + return ` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + return resTexRC.x * outTexShape[1] + resTexRC.y; + } + `; + } + return ` + int getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + return resTexRC.x * ${texShape[1]} + resTexRC.y; + } + `; +} +function getOutputPacked3DCoords2(shape, texShape, enableShapeUniforms) { + if (enableShapeUniforms) { + return ` + ivec3 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0)); + int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + int index = resTexRC.x * packedTexShape[1] + resTexRC.y; + + int b = index / texelsInBatch; + index -= b * texelsInBatch; + + int r = 2 * (index / texelsInLogicalRow); + int c = imod(index, texelsInLogicalRow) * 2; + + return ivec3(b, r, c); + } + `; + } + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + const texelsInLogicalRow = Math.ceil(shape[2] / 2); + const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[1] / 2); + return ` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${packedTexShape[0]}, ${packedTexShape[1]})); + int index = resTexRC.x * ${packedTexShape[1]} + resTexRC.y; + + int b = index / ${texelsInBatch}; + index -= b * ${texelsInBatch}; + + int r = 2 * (index / ${texelsInLogicalRow}); + int c = imod(index, ${texelsInLogicalRow}) * 2; + + return ivec3(b, r, c); + } + `; +} +function getOutput3DCoords2(shape, texShape, enableShapeUniforms) { + if (enableShapeUniforms) { + const coordsFromIndexSnippet2 = getOutputLogicalCoordinatesFromFlatIndexByUniform2(["r", "c", "d"], shape); + return ` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + ${coordsFromIndexSnippet2} + return ivec3(r, c, d); + } +`; + } + const coordsFromIndexSnippet = getLogicalCoordinatesFromFlatIndex2(["r", "c", "d"], shape); + return ` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + ${coordsFromIndexSnippet} + return ivec3(r, c, d); + } + `; +} +function getOutputPackedNDCoords2(shape, texShape, enableShapeUniforms) { + if (enableShapeUniforms) { + return ` + ivec4 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + int index = resTexRC.x * packedTexShape[1] + resTexRC.y; + + int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0)); + int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0)); + int texelsInBatchN = texelsInBatch * outShape[1]; + + int b2 = index / texelsInBatchN; + index -= b2 * texelsInBatchN; + + int b = index / texelsInBatch; + index -= b * texelsInBatch; + + int r = 2 * (index / texelsInLogicalRow); + int c = imod(index, texelsInLogicalRow) * 2; + + return ivec4(b2, b, r, c); + } + `; + } + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + const texelsInLogicalRow = Math.ceil(shape[shape.length - 1] / 2); + const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[shape.length - 2] / 2); + let texelsInBatchN = texelsInBatch; + let batches = ``; + let coords9 = "b, r, c"; + for (let b = 2; b < shape.length - 1; b++) { + texelsInBatchN *= shape[shape.length - b - 1]; + batches = ` + int b${b} = index / ${texelsInBatchN}; + index -= b${b} * ${texelsInBatchN}; + ` + batches; + coords9 = `b${b}, ` + coords9; + } + return ` + ivec${shape.length} getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${packedTexShape[0]}, ${packedTexShape[1]})); + int index = resTexRC.x * ${packedTexShape[1]} + resTexRC.y; + + ${batches} + + int b = index / ${texelsInBatch}; + index -= b * ${texelsInBatch}; + + int r = 2 * (index / ${texelsInLogicalRow}); + int c = imod(index, ${texelsInLogicalRow}) * 2; + + return ivec${shape.length}(${coords9}); + } + `; +} +function getOutput4DCoords2(shape, texShape, enableShapeUniforms) { + if (enableShapeUniforms) { + const coordsFromIndexSnippet2 = getOutputLogicalCoordinatesFromFlatIndexByUniform2(["r", "c", "d", "d2"], shape); + return ` + ivec4 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + ${coordsFromIndexSnippet2} + return ivec4(r, c, d, d2); + } + `; + } + const coordsFromIndexSnippet = getLogicalCoordinatesFromFlatIndex2(["r", "c", "d", "d2"], shape); + return ` + ivec4 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + ${coordsFromIndexSnippet} + return ivec4(r, c, d, d2); + } + `; +} +function getOutput5DCoords2(shape, texShape) { + const coordsFromIndexSnippet = getLogicalCoordinatesFromFlatIndex2(["r", "c", "d", "d2", "d3"], shape); + return ` + ivec5 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * vec2(${texShape[0]}, + ${texShape[1]})); + + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + + ${coordsFromIndexSnippet} + + ivec5 outShape = ivec5(r, c, d, d2, d3); + return outShape; + } + `; +} +function getOutput6DCoords2(shape, texShape) { + const coordsFromIndexSnippet = getLogicalCoordinatesFromFlatIndex2(["r", "c", "d", "d2", "d3", "d4"], shape); + return ` + ivec6 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + + ${coordsFromIndexSnippet} + + ivec6 result = ivec6(r, c, d, d2, d3, d4); + return result; + } + `; +} +function getOutputPacked2DCoords2(shape, texShape, enableShapeUniforms) { + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + if (util_exports2.arraysEqual(shape, texShape)) { + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); + } + `; + } + return ` + ivec2 getOutputCoords() { + return 2 * ivec2(resultUV.yx * vec2(${packedTexShape[0]}, ${packedTexShape[1]})); + } + `; + } + const texelsInLogicalRow = Math.ceil(shape[1] / 2); + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); + int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0)); + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(packedTexShape[0], packedTexShape[1])); + + int index = resTexRC.x * packedTexShape[1] + resTexRC.y; + int r = 2 * (index / texelsInLogicalRow); + int c = imod(index, texelsInLogicalRow) * 2; + + return ivec2(r, c); + } + `; + } + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${packedTexShape[0]}, ${packedTexShape[1]})); + + int index = resTexRC.x * ${packedTexShape[1]} + resTexRC.y; + int r = 2 * (index / ${texelsInLogicalRow}); + int c = imod(index, ${texelsInLogicalRow}) * 2; + + return ivec2(r, c); + } + `; +} +function getOutput2DCoords2(shape, texShape, enableShapeUniforms) { + if (util_exports2.arraysEqual(shape, texShape)) { + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); + } + `; + } + return ` + ivec2 getOutputCoords() { + return ivec2(resultUV.yx * vec2(${texShape[0]}, ${texShape[1]})); + } + `; + } + if (shape[1] === 1) { + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + return ivec2(index, 0); + } + `; + } + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + return ivec2(index, 0); + } + `; + } + if (shape[0] === 1) { + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + return ivec2(0, index); + } + `; + } + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + return ivec2(0, index); + } + `; + } + if (enableShapeUniforms) { + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(outTexShape[0], outTexShape[1])); + int index = resTexRC.x * outTexShape[1] + resTexRC.y; + int r = index / outShape[1]; + int c = index - r * outShape[1]; + return ivec2(r, c); + } + `; + } + return ` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(resultUV.yx * + vec2(${texShape[0]}, ${texShape[1]})); + int index = resTexRC.x * ${texShape[1]} + resTexRC.y; + int r = index / ${shape[1]}; + int c = index - r * ${shape[1]}; + return ivec2(r, c); + } + `; +} +function getFlatOffsetUniformName2(texName) { + return `offset${texName}`; +} +function getPackedSamplerScalar2(inputInfo) { + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const glsl = getGlslDifferences2(); + return ` + vec4 ${funcName}() { + return ${glsl.texture2D}(${texName}, halfCR); + } + `; +} +function getSamplerScalar2(inputInfo, enableShapeUniforms) { + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + if (inputInfo.shapeInfo.isUniform) { + return `float ${funcName}() {return ${texName};}`; + } + const [texNumR, texNumC] = inputInfo.shapeInfo.texShape; + if (texNumR === 1 && texNumC === 1) { + return ` + float ${funcName}() { + return sampleTexture(${texName}, halfCR); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + if (enableShapeUniforms) { + return ` + float ${funcName}() { + vec2 uv = uvFromFlat(${texName}TexShape[0], ${texName}TexShape[1], ${offset}); + return sampleTexture(${texName}, uv); + } + `; + } + const [tNumR, tNumC] = inputInfo.shapeInfo.texShape; + return ` + float ${funcName}() { + vec2 uv = uvFromFlat(${tNumR}, ${tNumC}, ${offset}); + return sampleTexture(${texName}, uv); + } + `; +} +function getPackedSampler1D2(inputInfo, enableShapeUniforms) { + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const texShape = inputInfo.shapeInfo.texShape; + const glsl = getGlslDifferences2(); + if (enableShapeUniforms) { + return ` + vec4 ${funcName}(int index) { + ivec2 packedTexShape = ivec2(ceil(float(${texName}TexShape[0]) / 2.0), ceil(float(${texName}TexShape[1]) / 2.0)); + vec2 uv = packedUVfrom1D( + packedTexShape[0], packedTexShape[1], index); + return ${glsl.texture2D}(${texName}, uv); + } + `; + } + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + return ` + vec4 ${funcName}(int index) { + vec2 uv = packedUVfrom1D( + ${packedTexShape[0]}, ${packedTexShape[1]}, index); + return ${glsl.texture2D}(${texName}, uv); + } + `; +} +function getSampler1D2(inputInfo, enableShapeUniforms) { + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int index) { + ${getUniformSampler2(inputInfo)} + } + `; + } + const texShape = inputInfo.shapeInfo.texShape; + const tNumR = texShape[0]; + const tNumC = texShape[1]; + if (tNumC === 1 && tNumR === 1) { + return ` + float ${funcName}(int index) { + return sampleTexture(${texName}, halfCR); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + if (tNumC === 1) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int index) { + vec2 uv = vec2(0.5, (float(index + ${offset}) + 0.5) / float(${texName}TexShape[0])); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int index) { + vec2 uv = vec2(0.5, (float(index + ${offset}) + 0.5) / ${tNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (tNumR === 1) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int index) { + vec2 uv = vec2((float(index + ${offset}) + 0.5) / float(${texName}TexShape[1]), 0.5); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int index) { + vec2 uv = vec2((float(index + ${offset}) + 0.5) / ${tNumC}.0, 0.5); + return sampleTexture(${texName}, uv); + } + `; + } + if (enableShapeUniforms) { + return ` + float ${funcName}(int index) { + vec2 uv = uvFromFlat(${texName}TexShape[0], ${texName}TexShape[1], index + ${offset}); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int index) { + vec2 uv = uvFromFlat(${tNumR}, ${tNumC}, index + ${offset}); + return sampleTexture(${texName}, uv); + } + `; +} +function getPackedSampler2D2(inputInfo, enableShapeUniforms) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const texShape = inputInfo.shapeInfo.texShape; + const texNumR = texShape[0]; + const texNumC = texShape[1]; + const glsl = getGlslDifferences2(); + if (texShape != null && util_exports2.arraysEqual(shape, texShape)) { + if (enableShapeUniforms) { + return ` + vec4 ${funcName}(int row, int col) { + vec2 uv = (vec2(col, row) + halfCR) / vec2(${texName}TexShape[1], ${texName}TexShape[0]); + + return ${glsl.texture2D}(${texName}, uv); + } + `; + } + return ` + vec4 ${funcName}(int row, int col) { + vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0); + + return ${glsl.texture2D}(${texName}, uv); + } + `; + } + if (enableShapeUniforms) { + return ` + vec4 ${funcName}(int row, int col) { + ivec2 packedTexShape = ivec2(ceil(float(${texName}TexShape[0]) / 2.0), ceil(float(${texName}TexShape[1]) / 2.0)); + int valuesPerRow = int(ceil(float(${texName}Shape[1]) / 2.0)); + vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col); + return ${glsl.texture2D}(${texName}, uv); + } + `; + } + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + const valuesPerRow = Math.ceil(shape[1] / 2); + return ` + vec4 ${funcName}(int row, int col) { + vec2 uv = packedUVfrom2D(${valuesPerRow}, ${packedTexShape[0]}, ${packedTexShape[1]}, row, col); + return ${glsl.texture2D}(${texName}, uv); + } + `; +} +function getSampler2D2(inputInfo, enableShapeUniforms) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const texShape = inputInfo.shapeInfo.texShape; + if (texShape != null && util_exports2.arraysEqual(shape, texShape)) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col) { + vec2 uv = (vec2(col, row) + halfCR) / vec2(${texName}TexShape[1], ${texName}TexShape[0]); + return sampleTexture(${texName}, uv); + } + `; + } + const texNumR2 = texShape[0]; + const texNumC2 = texShape[1]; + return ` + float ${funcName}(int row, int col) { + vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC2}.0, ${texNumR2}.0); + return sampleTexture(${texName}, uv); + } + `; + } + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + const squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + const newInputInfo = squeezeInputInfo2(inputInfo, squeezedShape); + const params = ["row", "col"]; + return ` + ${getSamplerFromInInfo2(newInputInfo, enableShapeUniforms)} + float ${funcName}(int row, int col) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int row, int col) { + int index = round(dot(vec2(row, col), vec2(${shape[1]}, 1))); + ${getUniformSampler2(inputInfo)} + } + `; + } + const texNumR = texShape[0]; + const texNumC = texShape[1]; + const offset = getFlatOffsetUniformName2(texName); + if (texNumC === 1) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col) { + float index = dot(vec3(row, col, ${offset}), vec3(${texName}Shape[1], 1, 1)); + vec2 uv = vec2(0.5, (index + 0.5) / float(${texName}TexShape[0])); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col) { + float index = dot(vec3(row, col, ${offset}), vec3(${shape[1]}, 1, 1)); + vec2 uv = vec2(0.5, (index + 0.5) / ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (texNumR === 1) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col) { + float index = dot(vec3(row, col, ${offset}), vec3(${texName}Shape[1], 1, 1)); + vec2 uv = vec2((index + 0.5) / float(${texName}TexShape[1]), 0.5); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col) { + float index = dot(vec3(row, col, ${offset}), vec3(${shape[1]}, 1, 1)); + vec2 uv = vec2((index + 0.5) / ${texNumC}.0, 0.5); + return sampleTexture(${texName}, uv); + } + `; + } + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${texName}Shape[1] + col + ${offset}; + vec2 uv = uvFromFlat(${texName}TexShape[0], ${texName}TexShape[1], index); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${shape[1]} + col + ${offset}; + vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index); + return sampleTexture(${texName}, uv); + } +`; +} +function getPackedSampler3D2(inputInfo, enableShapeUniforms) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const texShape = inputInfo.shapeInfo.texShape; + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + if (shape[0] === 1) { + const squeezedShape = shape.slice(1); + const keptDims = [1, 2]; + const newInputInfo = squeezeInputInfo2(inputInfo, squeezedShape); + const params = ["b", "row", "col"]; + return ` + ${getPackedSamplerFromInInfo2(newInputInfo, enableShapeUniforms)} + vec4 ${funcName}(int b, int row, int col) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + const glsl = getGlslDifferences2(); + if (enableShapeUniforms) { + return ` + vec4 ${funcName}(int b, int row, int col) { + ivec2 packedTexShape = ivec2(ceil(float(${texName}TexShape[0]) / 2.0), ceil(float(${texName}TexShape[1]) / 2.0)); + int valuesPerRow = int(ceil(float(${texName}Shape[2]) / 2.0)); + int texelsInBatch = valuesPerRow * int(ceil(float(${texName}Shape[1]) / 2.0)); + vec2 uv = packedUVfrom3D( + packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col); + return ${glsl.texture2D}(${texName}, uv); + } + `; + } + const texNumR = packedTexShape[0]; + const texNumC = packedTexShape[1]; + const valuesPerRow = Math.ceil(shape[2] / 2); + const texelsInBatch = valuesPerRow * Math.ceil(shape[1] / 2); + return ` + vec4 ${funcName}(int b, int row, int col) { + vec2 uv = packedUVfrom3D( + ${texNumR}, ${texNumC}, ${texelsInBatch}, ${valuesPerRow}, b, row, col); + return ${glsl.texture2D}(${texName}, uv); + } + `; +} +function getSampler3D2(inputInfo, enableShapeUniforms) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const stride0 = shape[1] * shape[2]; + const stride1 = shape[2]; + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + const squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + const newInputInfo = squeezeInputInfo2(inputInfo, squeezedShape); + const params = ["row", "col", "depth"]; + return ` + ${getSamplerFromInInfo2(newInputInfo, enableShapeUniforms)} + float ${funcName}(int row, int col, int depth) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int row, int col, int depth) { + int index = round(dot(vec3(row, col, depth), + vec3(${stride0}, ${stride1}, 1))); + ${getUniformSampler2(inputInfo)} + } + `; + } + const texShape = inputInfo.shapeInfo.texShape; + const texNumR = texShape[0]; + const texNumC = texShape[1]; + const flatOffset = inputInfo.shapeInfo.flatOffset; + if (texNumC === stride0 && flatOffset == null) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth) { + int stride1 = ${texName}Shape[2]; + float texR = float(row); + float texC = dot(vec2(col, depth), vec2(stride1, 1)); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texName}TexShape[1], ${texName}TexShape[0]); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth) { + float texR = float(row); + float texC = dot(vec2(col, depth), vec2(${stride1}, 1)); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (texNumC === stride1 && flatOffset == null) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth) { + float texR = dot(vec2(row, col), vec2(${texName}Shape[1], 1)); + float texC = float(depth); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texName}TexShape[1], ${texName}TexShape[0]); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth) { + float texR = dot(vec2(row, col), vec2(${shape[1]}, 1)); + float texC = float(depth); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth) { + // Explicitly use integer operations as dot() only works on floats. + int stride0 = ${texName}Shape[1] * ${texName}Shape[2]; + int stride1 = ${texName}Shape[2]; + int index = row * ${stride0} + col * ${stride1} + depth + ${offset}; + vec2 uv = uvFromFlat(${texName}TexShape[0], ${texName}TexShape[1], index); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${stride0} + col * ${stride1} + depth + ${offset}; + vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index); + return sampleTexture(${texName}, uv); + } + `; +} +function getPackedSamplerND2(inputInfo, enableShapeUniforms) { + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const glsl = getGlslDifferences2(); + if (enableShapeUniforms) { + return ` + vec4 ${funcName}(int b2, int b, int row, int col) { + int valuesPerRow = int(ceil(float(${texName}Shape[3]) / 2.0)); + int texelsInBatch = valuesPerRow * int(ceil(float(${texName}Shape[2]) / 2.0)); + int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2); + texelsInBatch *= ${texName}Shape[1]; + index = b2 * texelsInBatch + index; + ivec2 packedTexShape = ivec2(ceil(float(${texName}TexShape[0]) / 2.0), ceil(float(${texName}TexShape[1]) / 2.0)); + int texR = index / packedTexShape[1]; + int texC = index - texR * packedTexShape[1]; + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${glsl.texture2D}(${texName}, uv); + } + `; + } + const shape = inputInfo.shapeInfo.logicalShape; + const rank = shape.length; + const texShape = inputInfo.shapeInfo.texShape; + const packedTexShape = [Math.ceil(texShape[0] / 2), Math.ceil(texShape[1] / 2)]; + const texNumR = packedTexShape[0]; + const texNumC = packedTexShape[1]; + const valuesPerRow = Math.ceil(shape[rank - 1] / 2); + let texelsInBatch = valuesPerRow * Math.ceil(shape[rank - 2] / 2); + let params = `int b, int row, int col`; + let index = `b * ${texelsInBatch} + (row / 2) * ${valuesPerRow} + (col / 2)`; + for (let b = 2; b < rank - 1; b++) { + params = `int b${b}, ` + params; + texelsInBatch *= shape[rank - b - 1]; + index = `b${b} * ${texelsInBatch} + ` + index; + } + return ` + vec4 ${funcName}(${params}) { + int index = ${index}; + int texR = index / ${texNumC}; + int texC = index - texR * ${texNumC}; + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}, ${texNumR}); + return ${glsl.texture2D}(${texName}, uv); + } + `; +} +function getSampler4D2(inputInfo, enableShapeUniforms) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const stride2 = shape[3]; + const stride1 = shape[2] * stride2; + const stride0 = shape[1] * stride1; + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + if (newShape.length < shape.length) { + const newInputInfo = squeezeInputInfo2(inputInfo, newShape); + const params = ["row", "col", "depth", "depth2"]; + return ` + ${getSamplerFromInInfo2(newInputInfo, enableShapeUniforms)} + float ${funcName}(int row, int col, int depth, int depth2) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + int index = round(dot(vec4(row, col, depth, depth2), + vec4(${stride0}, ${stride1}, ${stride2}, 1))); + ${getUniformSampler2(inputInfo)} + } + `; + } + const flatOffset = inputInfo.shapeInfo.flatOffset; + const texShape = inputInfo.shapeInfo.texShape; + const texNumR = texShape[0]; + const texNumC = texShape[1]; + const stride2Str = `int stride2 = ${texName}Shape[3];`; + const stride1Str = `int stride1 = ${texName}Shape[2] * stride2;`; + const stride0Str = `int stride0 = ${texName}Shape[1] * stride1;`; + if (texNumC === stride0 && flatOffset == null) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + ${stride2Str} + ${stride1Str} + float texR = float(row); + float texC = + dot(vec3(col, depth, depth2), + vec3(stride1, stride2, 1)); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texName}TexShape[1], ${texName}TexShape[0]); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + float texR = float(row); + float texC = + dot(vec3(col, depth, depth2), + vec3(${stride1}, ${stride2}, 1)); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (texNumC === stride2 && flatOffset == null) { + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + float texR = dot(vec3(row, col, depth), + vec3(${texName}Shape[1] * ${texName}Shape[2], ${texName}Shape[2], 1)); + float texC = float(depth2); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texName}TexShape[1], ${texName}TexShape[0]); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + float texR = dot(vec3(row, col, depth), + vec3(${shape[1] * shape[2]}, ${shape[2]}, 1)); + float texC = float(depth2); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + if (enableShapeUniforms) { + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + // Explicitly use integer operations as dot() only works on floats. + ${stride2Str} + ${stride1Str} + ${stride0Str} + int index = row * stride0 + col * stride1 + + depth * stride2 + depth2; + vec2 uv = uvFromFlat(${texName}TexShape[0], ${texName}TexShape[1], index + ${offset}); + return sampleTexture(${texName}, uv); + } + `; + } + return ` + float ${funcName}(int row, int col, int depth, int depth2) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${stride0} + col * ${stride1} + + depth * ${stride2} + depth2; + vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index + ${offset}); + return sampleTexture(${texName}, uv); + } + `; +} +function getSampler5D2(inputInfo) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const stride3 = shape[4]; + const stride2 = shape[3] * stride3; + const stride1 = shape[2] * stride2; + const stride0 = shape[1] * stride1; + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + if (newShape.length < shape.length) { + const newInputInfo = squeezeInputInfo2(inputInfo, newShape); + const params = ["row", "col", "depth", "depth2", "depth3"]; + return ` + ${getSamplerFromInInfo2(newInputInfo)} + float ${funcName}(int row, int col, int depth, int depth2, int depth3) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int row, int col, int depth, int depth2, int depth3) { + float index = dot( + vec4(row, col, depth, depth2), + vec4(${stride0}, ${stride1}, ${stride2}, ${stride3})) + + depth3; + ${getUniformSampler2(inputInfo)} + } + `; + } + const flatOffset = inputInfo.shapeInfo.flatOffset; + const texShape = inputInfo.shapeInfo.texShape; + const texNumR = texShape[0]; + const texNumC = texShape[1]; + if (texNumC === stride0 && flatOffset == null) { + return ` + float ${funcName}(int row, int col, int depth, int depth2, int depth3) { + int texR = row; + float texC = dot(vec4(col, depth, depth2, depth3), + vec4(${stride1}, ${stride2}, ${stride3}, 1)); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (texNumC === stride3 && flatOffset == null) { + return ` + float ${funcName}(int row, int col, int depth, int depth2, int depth3) { + float texR = dot( + vec4(row, col, depth, depth2), + vec4(${shape[1] * shape[2] * shape[3]}, + ${shape[2] * shape[3]}, ${shape[3]}, 1)); + int texC = depth3; + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + return ` + float ${funcName}(int row, int col, int depth, int depth2, int depth3) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} + + depth2 * ${stride3} + depth3 + ${offset}; + vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index); + return sampleTexture(${texName}, uv); + } + `; +} +function getSampler6D2(inputInfo) { + const shape = inputInfo.shapeInfo.logicalShape; + const texName = inputInfo.name; + const funcName = "get" + texName.charAt(0).toUpperCase() + texName.slice(1); + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + if (newShape.length < shape.length) { + const newInputInfo = squeezeInputInfo2(inputInfo, newShape); + const params = ["row", "col", "depth", "depth2", "depth3", "depth4"]; + return ` + ${getSamplerFromInInfo2(newInputInfo)} + float ${funcName}(int row, int col, int depth, + int depth2, int depth3, int depth4) { + return ${funcName}(${getSqueezedParams2(params, keptDims)}); + } + `; + } + const stride4 = shape[5]; + const stride3 = shape[4] * stride4; + const stride2 = shape[3] * stride3; + const stride1 = shape[2] * stride2; + const stride0 = shape[1] * stride1; + if (inputInfo.shapeInfo.isUniform) { + return ` + float ${funcName}(int row, int col, int depth, + int depth2, int depth3, int depth4) { + int index = round(dot( + vec4(row, col, depth, depth2), + vec4(${stride0}, ${stride1}, ${stride2}, ${stride3})) + + dot( + vec2(depth3, depth4), + vec2(${stride4}, 1))); + ${getUniformSampler2(inputInfo)} + } + `; + } + const flatOffset = inputInfo.shapeInfo.flatOffset; + const texShape = inputInfo.shapeInfo.texShape; + const texNumR = texShape[0]; + const texNumC = texShape[1]; + if (texNumC === stride0 && flatOffset == null) { + return ` + float ${funcName}(int row, int col, int depth, + int depth2, int depth3, int depth4) { + int texR = row; + float texC = dot(vec4(col, depth, depth2, depth3), + vec4(${stride1}, ${stride2}, ${stride3}, ${stride4})) + + float(depth4); + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + if (texNumC === stride4 && flatOffset == null) { + return ` + float ${funcName}(int row, int col, int depth, + int depth2, int depth3, int depth4) { + float texR = dot(vec4(row, col, depth, depth2), + vec4(${shape[1] * shape[2] * shape[3] * shape[4]}, + ${shape[2] * shape[3] * shape[4]}, + ${shape[3] * shape[4]}, + ${shape[4]})) + float(depth3); + int texC = depth4; + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${texNumC}.0, ${texNumR}.0); + return sampleTexture(${texName}, uv); + } + `; + } + const offset = getFlatOffsetUniformName2(texName); + return ` + float ${funcName}(int row, int col, int depth, + int depth2, int depth3, int depth4) { + // Explicitly use integer operations as dot() only works on floats. + int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} + + depth2 * ${stride3} + depth3 * ${stride4} + depth4 + ${offset}; + vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index); + return sampleTexture(${texName}, uv); + } + `; +} +function getUniformSampler2(inputInfo) { + const texName = inputInfo.name; + const inSize = util_exports2.sizeFromShape(inputInfo.shapeInfo.logicalShape); + if (inSize < 2) { + return `return ${texName};`; + } + return ` + for (int i = 0; i < ${inSize}; i++) { + if (i == index) { + return ${texName}[i]; + } + } + `; +} +function getPackedSamplerAtOutputCoords2(inputInfo, outShapeInfo) { + const texName = inputInfo.name; + const texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1); + const funcName = "get" + texFuncSnippet + "AtOutCoords"; + const inRank = inputInfo.shapeInfo.logicalShape.length; + const outRank = outShapeInfo.logicalShape.length; + const broadcastDims = getBroadcastDims4(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + const type = getCoordsDataType2(outRank); + const rankDiff = outRank - inRank; + let coordsSnippet; + const fields = ["x", "y", "z", "w", "u", "v"]; + if (inRank === 0) { + coordsSnippet = ""; + } else if (outRank < 2 && broadcastDims.length >= 1) { + coordsSnippet = "coords = 0;"; + } else { + coordsSnippet = broadcastDims.map((d) => `coords.${fields[d + rankDiff]} = 0;`).join("\n"); + } + let unpackedCoordsSnippet = ""; + if (outRank < 2 && inRank > 0) { + unpackedCoordsSnippet = "coords"; + } else { + unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape.map((s, i) => `coords.${fields[i + rankDiff]}`).join(", "); + } + let output = `return outputValue;`; + const inSize = util_exports2.sizeFromShape(inputInfo.shapeInfo.logicalShape); + const isInputScalar = inSize === 1; + const outSize = util_exports2.sizeFromShape(outShapeInfo.logicalShape); + const isOutputScalar = outSize === 1; + if (inRank === 1 && !isInputScalar && !isOutputScalar) { + output = ` + return vec4(outputValue.xy, outputValue.xy); + `; + } else if (isInputScalar && !isOutputScalar) { + if (outRank === 1) { + output = ` + return vec4(outputValue.x, outputValue.x, 0., 0.); + `; + } else { + output = ` + return vec4(outputValue.x); + `; + } + } else if (broadcastDims.length) { + const rows = inRank - 2; + const cols = inRank - 1; + if (broadcastDims.indexOf(rows) > -1 && broadcastDims.indexOf(cols) > -1) { + output = `return vec4(outputValue.x);`; + } else if (broadcastDims.indexOf(rows) > -1) { + output = `return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);`; + } else if (broadcastDims.indexOf(cols) > -1) { + output = `return vec4(outputValue.xx, outputValue.zz);`; + } + } + return ` + vec4 ${funcName}() { + ${type} coords = getOutputCoords(); + ${coordsSnippet} + vec4 outputValue = get${texFuncSnippet}(${unpackedCoordsSnippet}); + ${output} + } + `; +} +function getSamplerAtOutputCoords2(inputInfo, outShapeInfo) { + const texName = inputInfo.name; + const texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1); + const funcName = "get" + texFuncSnippet + "AtOutCoords"; + const outTexShape = outShapeInfo.texShape; + const inTexShape = inputInfo.shapeInfo.texShape; + const inRank = inputInfo.shapeInfo.logicalShape.length; + const outRank = outShapeInfo.logicalShape.length; + if (!inputInfo.shapeInfo.isUniform && inRank === outRank && inputInfo.shapeInfo.flatOffset == null && util_exports2.arraysEqual(inTexShape, outTexShape)) { + return ` + float ${funcName}() { + return sampleTexture(${texName}, resultUV); + } + `; + } + const type = getCoordsDataType2(outRank); + const broadcastDims = getBroadcastDims4(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + const rankDiff = outRank - inRank; + let coordsSnippet; + const fields = ["x", "y", "z", "w", "u", "v"]; + if (inRank === 0) { + coordsSnippet = ""; + } else if (outRank < 2 && broadcastDims.length >= 1) { + coordsSnippet = "coords = 0;"; + } else { + coordsSnippet = broadcastDims.map((d) => `coords.${fields[d + rankDiff]} = 0;`).join("\n"); + } + let unpackedCoordsSnippet = ""; + if (outRank < 2 && inRank > 0) { + unpackedCoordsSnippet = "coords"; + } else { + unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape.map((s, i) => `coords.${fields[i + rankDiff]}`).join(", "); + } + return ` + float ${funcName}() { + ${type} coords = getOutputCoords(); + ${coordsSnippet} + return get${texFuncSnippet}(${unpackedCoordsSnippet}); + } + `; +} +function getCoordsDataType2(rank) { + if (rank <= 1) { + return "int"; + } else if (rank === 2) { + return "ivec2"; + } else if (rank === 3) { + return "ivec3"; + } else if (rank === 4) { + return "ivec4"; + } else if (rank === 5) { + return "ivec5"; + } else if (rank === 6) { + return "ivec6"; + } else { + throw Error(`GPU for rank ${rank} is not yet supported`); + } +} +function getUniformInfoFromShape2(isPacked, shape, texShape) { + const { newShape, keptDims } = util_exports2.squeezeShape(shape); + const rank = shape.length; + const useSqueezePackedShape = isPacked && rank === 3 && shape[0] === 1; + const squeezeShape3 = useSqueezePackedShape ? shape.slice(1) : newShape; + const useSqueezeShape = !isPacked && rank > 1 && !util_exports2.arraysEqual(shape, texShape) && newShape.length < rank || useSqueezePackedShape; + const uniformShape = useSqueezeShape ? squeezeShape3 : shape; + return { useSqueezeShape, uniformShape, keptDims }; +} +function squeezeInputInfo2(inInfo, squeezedShape) { + const newInputInfo = JSON.parse(JSON.stringify(inInfo)); + newInputInfo.shapeInfo.logicalShape = squeezedShape; + return newInputInfo; +} +function getSqueezedParams2(params, keptDims) { + return keptDims.map((d) => params[d]).join(", "); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_math.js +function compileProgram2(gpgpu, program, inputs, output) { + const inputInfos = inputs.map((input3, i) => { + const shapeInfo = { + logicalShape: input3.shape, + texShape: input3.isUniform ? null : input3.texData.texShape, + isUniform: input3.isUniform, + isPacked: input3.isUniform ? false : input3.texData.isPacked, + flatOffset: null + }; + if (input3.texData != null && input3.texData.slice != null && input3.texData.slice.flatOffset > 0) { + shapeInfo.flatOffset = input3.texData.slice.flatOffset; + } + return { name: program.variableNames[i], shapeInfo }; + }); + const inShapeInfos = inputInfos.map((x) => x.shapeInfo); + const outShapeInfo = { + logicalShape: output.shape, + texShape: output.texData.texShape, + isUniform: false, + isPacked: output.texData.isPacked, + flatOffset: null + }; + const source = makeShader2(inputInfos, outShapeInfo, program); + const webGLProgram = gpgpu.createProgram(source); + let infLoc = null; + const nanLoc = gpgpu.getUniformLocation(webGLProgram, "NAN", false); + if (env3().getNumber("WEBGL_VERSION") === 1) { + infLoc = gpgpu.getUniformLocation(webGLProgram, "INFINITY", false); + } + const shouldThrow = false; + const uniformLocations = {}; + const inShapesLocations = {}; + const inTexShapesLocations = {}; + for (let i = 0; i < program.variableNames.length; i++) { + const varName = program.variableNames[i]; + uniformLocations[varName] = gpgpu.getUniformLocation(webGLProgram, varName, shouldThrow); + uniformLocations[`offset${varName}`] = gpgpu.getUniformLocation(webGLProgram, `offset${varName}`, shouldThrow); + if (program.enableShapeUniforms) { + inShapesLocations[`${varName}Shape`] = gpgpu.getUniformLocation(webGLProgram, `${varName}Shape`, shouldThrow); + inTexShapesLocations[`${varName}TexShape`] = gpgpu.getUniformLocation(webGLProgram, `${varName}TexShape`, shouldThrow); + } + } + let outShapeLocation; + let outTexShapeLocation; + let outShapeStridesLocation; + if (program.enableShapeUniforms) { + outShapeLocation = gpgpu.getUniformLocation(webGLProgram, "outShape", shouldThrow); + outShapeStridesLocation = gpgpu.getUniformLocation(webGLProgram, "outShapeStrides", shouldThrow); + outTexShapeLocation = gpgpu.getUniformLocation(webGLProgram, "outTexShape", shouldThrow); + } + const customUniformLocations = []; + if (program.customUniforms) { + program.customUniforms.forEach((d, i) => { + customUniformLocations[i] = gpgpu.getUniformLocation(webGLProgram, d.name, shouldThrow); + }); + } + return { + program, + source, + webGLProgram, + uniformLocations, + customUniformLocations, + inShapeInfos, + outShapeInfo, + infLoc, + nanLoc, + inShapesLocations, + inTexShapesLocations, + outShapeLocation, + outShapeStridesLocation, + outTexShapeLocation + }; +} +function validateBinaryAndProgram2(shapeInfos, inputs) { + if (shapeInfos.length !== inputs.length) { + throw Error(`Binary was compiled with ${shapeInfos.length} inputs, but was executed with ${inputs.length} inputs`); + } + shapeInfos.forEach((s, i) => { + const shapeA = s.logicalShape; + const input3 = inputs[i]; + const shapeB = input3.shape; + if (!util_exports2.arraysEqual(shapeA, shapeB)) { + throw Error(`Binary was compiled with different shapes than the current args. Shapes ${shapeA} and ${shapeB} must match`); + } + if (s.isUniform && input3.isUniform) { + return; + } + const texShapeA = s.texShape; + const texShapeB = input3.isUniform ? null : input3.texData.texShape; + if (!util_exports2.arraysEqual(texShapeA, texShapeB)) { + throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${texShapeA} and ${texShapeB} must match`); + } + }); +} +function runProgram2(gpgpu, binary, inputs, output, customUniformValues) { + if (!binary.program.enableShapeUniforms) { + validateBinaryAndProgram2(binary.inShapeInfos, inputs); + validateBinaryAndProgram2([binary.outShapeInfo], [output]); + } + const outTex = output.texData.texture; + const outTexShape = output.texData.texShape; + if (output.texData.isPacked) { + gpgpu.setOutputPackedMatrixTexture(outTex, outTexShape[0], outTexShape[1]); + } else { + gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]); + } + gpgpu.setProgram(binary.webGLProgram); + if (env3().getNumber("WEBGL_VERSION") === 1) { + if (binary.infLoc !== null) { + gpgpu.gl.uniform1f(binary.infLoc, Infinity); + } + } + if (binary.nanLoc !== null) { + gpgpu.gl.uniform1f(binary.nanLoc, NaN); + } + inputs.forEach((input3, i) => { + const varName = binary.program.variableNames[i]; + const varLoc = binary.uniformLocations[varName]; + const varOffsetLoc = binary.uniformLocations[`offset${varName}`]; + const varShapeLoc = binary.inShapesLocations[`${varName}Shape`]; + const varTexShapeLoc = binary.inTexShapesLocations[`${varName}TexShape`]; + if (varShapeLoc) { + const { uniformShape } = getUniformInfoFromShape2(binary.program.packedInputs, input3.shape, input3.texData.texShape); + switch (uniformShape.length) { + case 1: + gpgpu.gl.uniform1iv(varShapeLoc, new Int32Array(uniformShape)); + break; + case 2: + gpgpu.gl.uniform2iv(varShapeLoc, new Int32Array(uniformShape)); + break; + case 3: + gpgpu.gl.uniform3iv(varShapeLoc, new Int32Array(uniformShape)); + break; + case 4: + gpgpu.gl.uniform4iv(varShapeLoc, new Int32Array(uniformShape)); + break; + default: + break; + } + } + if (varTexShapeLoc) { + gpgpu.gl.uniform2i(varTexShapeLoc, input3.texData.texShape[0], input3.texData.texShape[1]); + } + if (varLoc == null) { + return; + } + if (input3.isUniform) { + if (util_exports2.sizeFromShape(input3.shape) < 2) { + gpgpu.gl.uniform1f(varLoc, input3.uniformValues[0]); + } else { + let vals = input3.uniformValues; + if (!(vals instanceof Float32Array)) { + vals = new Float32Array(vals); + } + gpgpu.gl.uniform1fv(varLoc, vals); + } + return; + } + if (input3.texData.slice != null && varOffsetLoc != null) { + gpgpu.gl.uniform1i(varOffsetLoc, input3.texData.slice.flatOffset); + } + gpgpu.setInputMatrixTexture(input3.texData.texture, varLoc, i); + }); + const outShapeLoc = binary.outShapeLocation; + if (outShapeLoc) { + switch (output.shape.length) { + case 1: + gpgpu.gl.uniform1iv(outShapeLoc, new Int32Array(output.shape)); + break; + case 2: + gpgpu.gl.uniform2iv(outShapeLoc, new Int32Array(output.shape)); + break; + case 3: + gpgpu.gl.uniform3iv(outShapeLoc, new Int32Array(output.shape)); + break; + case 4: + gpgpu.gl.uniform4iv(outShapeLoc, new Int32Array(output.shape)); + break; + default: + break; + } + } + if (binary.outShapeStridesLocation) { + const strides = util_exports2.computeStrides(output.shape); + switch (output.shape.length) { + case 2: + gpgpu.gl.uniform1iv(binary.outShapeStridesLocation, new Int32Array(strides)); + break; + case 3: + gpgpu.gl.uniform2iv(binary.outShapeStridesLocation, new Int32Array(strides)); + break; + case 4: + gpgpu.gl.uniform3iv(binary.outShapeStridesLocation, new Int32Array(strides)); + break; + default: + break; + } + } + if (binary.outTexShapeLocation) { + gpgpu.gl.uniform2i(binary.outTexShapeLocation, output.texData.texShape[0], output.texData.texShape[1]); + } + if (binary.program.customUniforms && customUniformValues) { + binary.program.customUniforms.forEach((d, i) => { + const customLoc = binary.customUniformLocations[i]; + const customValue = customUniformValues[i]; + if (d.type === "float") { + gpgpu.gl.uniform1fv(customLoc, customValue); + } else if (d.type === "vec2") { + gpgpu.gl.uniform2fv(customLoc, customValue); + } else if (d.type === "vec3") { + gpgpu.gl.uniform3fv(customLoc, customValue); + } else if (d.type === "vec4") { + gpgpu.gl.uniform4fv(customLoc, customValue); + } else if (d.type === "int") { + gpgpu.gl.uniform1iv(customLoc, customValue); + } else if (d.type === "ivec2") { + gpgpu.gl.uniform2iv(customLoc, customValue); + } else if (d.type === "ivec3") { + gpgpu.gl.uniform3iv(customLoc, customValue); + } else if (d.type === "ivec4") { + gpgpu.gl.uniform4iv(customLoc, customValue); + } else { + throw Error(`uniform type ${d.type} is not supported yet.`); + } + }); + } + gpgpu.executeProgram(); +} +function makeShaderKey2(program, inputs, output) { + let keyInputs = ""; + inputs.concat(output).forEach((x) => { + const hasOffset = x.texData != null && x.texData.slice != null && x.texData.slice.flatOffset > 0; + if (program.enableShapeUniforms && !x.isUniform) { + const xTexShape = x.texData.texShape; + const { useSqueezeShape, uniformShape, keptDims } = getUniformInfoFromShape2(program.packedInputs, x.shape, xTexShape); + let rank1 = "", rank2 = "", rank34 = ""; + if (uniformShape.length === 1 && program.packedInputs) { + const packedTexShape = [Math.ceil(xTexShape[0] / 2), Math.ceil(xTexShape[1] / 2)]; + rank1 = `${packedTexShape[0] > 1}_${packedTexShape[1] > 1}`; + } else if (uniformShape.length === 2 && !program.packedInputs) { + rank2 = `${uniformShape[0] > 1}_${uniformShape[1] > 1}`; + } else if (uniformShape.length > 2 && !program.packedInputs) { + const strides = util_exports2.computeStrides(uniformShape); + rank34 = `${strides[0] === xTexShape[1]}_${strides[strides.length - 1] === xTexShape[1]}`; + } + const xRank = x.shape.length; + const isLogicalShapTexShapeEqual = uniformShape.length === 2 && util_exports2.arraysEqual(x.shape, xTexShape); + const isScalar = util_exports2.sizeFromShape(x.shape) === 1; + const broadcastDims = backend_util_exports2.getBroadcastDims(x.shape, output.shape); + const isInOutTexShapeEqual = !program.packedInputs && xRank === output.shape.length && util_exports2.arraysEqual(xTexShape, output.texData.texShape); + const isTexShapeGreaterThanOne = program.packedInputs || uniformShape.length > 2 ? "" : `${xTexShape[0] > 1}_${xTexShape[1] > 1}`; + keyInputs += `${xRank}_${isInOutTexShapeEqual}_${useSqueezeShape ? keptDims : ""}_${uniformShape.length}_${isScalar}_${broadcastDims}_${isLogicalShapTexShapeEqual}_${rank1}_${rank2}_${rank34}_${isTexShapeGreaterThanOne}_${hasOffset}`; + } else { + const texShape = x.isUniform ? "uniform" : x.texData.texShape; + keyInputs += `${x.shape}_${texShape}_${hasOffset}`; + } + }); + const keyUserCode = program.userCode; + let key = program.constructor.name; + key += "_" + keyInputs + "_" + keyUserCode + `${env3().getNumber("WEBGL_VERSION")}`; + return key; +} +function useShapeUniforms2(rank) { + return env3().getBool("WEBGL_USE_SHAPES_UNIFORMS") && rank <= 4; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/decode_matrix_gpu.js +var DecodeMatrixProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = false; + this.packedOutput = true; + this.outPackingScheme = PackingScheme2.DENSE; + this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + this.userCode = ` + ivec3 outCoordsFromFlatIndex(int index) { + ${this.enableShapeUniforms ? getOutputLogicalCoordinatesFromFlatIndexByUniform2(["r", "c", "d"], outputShape) : getLogicalCoordinatesFromFlatIndex2(["r", "c", "d"], outputShape)} + return ivec3(r, c, d); + } + + void main() { + ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); + int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); + + vec4 result = vec4(0.); + + for (int i=0; i<4; i++) { + int flatIndex = index + i; + ivec3 rc = outCoordsFromFlatIndex(flatIndex); + result[i] = getA(rc.x, rc.y, rc.z); + } + + ${glsl.output} = result; + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/decode_matrix_packed_gpu.js +var DecodeMatrixPackedProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.outPackingScheme = PackingScheme2.DENSE; + this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + this.userCode = ` + ivec3 outCoordsFromFlatIndex(int index) { + ${this.enableShapeUniforms ? getOutputLogicalCoordinatesFromFlatIndexByUniform2(["r", "c", "d"], outputShape) : getLogicalCoordinatesFromFlatIndex2(["r", "c", "d"], outputShape)} + return ivec3(r, c, d); + } + + void main() { + ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); + int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); + + vec4 result = vec4(0.); + + for (int i=0; i<4; i++) { + int flatIndex = index + i; + ivec3 rc = outCoordsFromFlatIndex(flatIndex); + result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); + } + + ${glsl.output} = result; + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/encode_float_gpu.js +var EncodeFloatProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.outTexUsage = TextureUsage2.DOWNLOAD; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.userCode = ` + ${ENCODE_FLOAT_SNIPPET2} + + void main() { + float x = getAAtOutCoords(); + ${glsl.output} = encode_float(x); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/encode_float_packed_gpu.js +var EncodeFloatPackedProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = false; + this.outTexUsage = TextureUsage2.DOWNLOAD; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.userCode = ` + ${ENCODE_FLOAT_SNIPPET2} + + void main() { + ivec3 coords = getOutputCoords(); + float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); + ${glsl.output} = encode_float(x); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/encode_matrix_gpu.js +var EncodeMatrixProgram2 = class { + constructor(outputShape, inputIsUnsignedByte = false) { + this.variableNames = ["A"]; + this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + let output = `result`; + if (inputIsUnsignedByte) { + output = `floor(result * 255. + 0.5)`; + } + this.userCode = ` + ${this.enableShapeUniforms ? getFlatIndexFrom3DOutput2() : getFlatIndexFrom3D2(outputShape)} + + void main() { + ivec3 coords = getOutputCoords(); + + int flatIndex = getFlatIndex(coords); + int offset = imod(flatIndex, 4); + + flatIndex = idiv(flatIndex, 4, 1.); + + int r = flatIndex / texShape[1]; + int c = imod(flatIndex, texShape[1]); + vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]); + vec4 values = ${glsl.texture2D}(A, uv); + + float result; + + if(offset == 0) { + result = values[0]; + } else if(offset == 1) { + result = values[1]; + } else if(offset == 2) { + result = values[2]; + } else { + result = values[3]; + } + + ${glsl.output} = vec4(${output}, 0., 0., 0.); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/encode_matrix_packed_gpu.js +var EncodeMatrixPackedProgram2 = class { + constructor(outputShape, inputIsUnsignedByte = false) { + this.variableNames = ["A"]; + this.packedInputs = false; + this.packedOutput = true; + this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + const glsl = getGlslDifferences2(); + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + let mainLoop = ""; + let output = "result"; + if (inputIsUnsignedByte) { + output = "floor(result * 255. + 0.5)"; + } + for (let row = 0; row <= 1; row++) { + for (let col = 0; col <= 1; col++) { + const channel = row * 2 + col; + mainLoop += ` + localCoords = coords; + if(localCoords[2] + ${col} < ${this.enableShapeUniforms ? "outShape[2]" : `${outputShape[2]}`}) { + localCoords[2] += ${col}; + if (localCoords[1] + ${row} < ${this.enableShapeUniforms ? "outShape[1]" : `${outputShape[1]}`}) { + localCoords[1] += ${row}; + + flatIndex = getFlatIndex(localCoords); + offset = imod(flatIndex, 4); + + flatIndex = idiv(flatIndex, 4, 1.); + + int r = flatIndex / texShape[1]; + int c = imod(flatIndex, texShape[1]); + vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]); + values = ${glsl.texture2D}(A, uv); + + if (offset == 0) { + result[${channel}] = values[0]; + } else if (offset == 1) { + result[${channel}] = values[1]; + } else if (offset == 2) { + result[${channel}] = values[2]; + } else { + result[${channel}] = values[3]; + } + } + } + `; + } + } + this.userCode = ` + ${this.enableShapeUniforms ? getFlatIndexFrom3DOutput2() : getFlatIndexFrom3D2(outputShape)} + + void main() { + ivec3 coords = getOutputCoords(); + + vec4 result = vec4(0.); + int flatIndex, r, c, offset; + ivec3 localCoords; + vec2 uv; + vec4 values; + + ${mainLoop} + + ${glsl.output} = ${output}; + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_util.js +function createVertexShader4(gl) { + const glsl = getGlslDifferences2(); + const vertexShaderSource = `${glsl.version} + precision highp float; + ${glsl.attribute} vec3 clipSpacePos; + ${glsl.attribute} vec2 uv; + ${glsl.varyingVs} vec2 resultUV; + + void main() { + gl_Position = vec4(clipSpacePos, 1); + resultUV = uv; + }`; + return createVertexShader3(gl, vertexShaderSource); +} +function createVertexBuffer2(gl) { + const vertexArray = new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); + return createStaticVertexBuffer2(gl, vertexArray); +} +function createIndexBuffer2(gl) { + const triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]); + return createStaticIndexBuffer2(gl, triangleVertexIndices); +} +function createAndConfigureTexture2(gl, width, height, internalFormat, textureFormat, textureType) { + validateTextureSize2(width, height); + const texture = createTexture2(gl); + const tex2d = gl.TEXTURE_2D; + callAndCheck2(gl, () => gl.bindTexture(tex2d, texture)); + callAndCheck2(gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)); + callAndCheck2(gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)); + callAndCheck2(gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST)); + callAndCheck2(gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST)); + callAndCheck2(gl, () => gl.texImage2D(tex2d, 0, internalFormat, width, height, 0, textureFormat, textureType, null)); + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, null)); + return texture; +} +function getInternalFormatForFloat32MatrixTexture2(textureConfig) { + return textureConfig.internalFormatFloat; +} +function createFloat32MatrixTexture2(gl, rows, columns, textureConfig) { + const [width, height] = getUnpackedMatrixTextureShapeWidthHeight2(rows, columns); + return createAndConfigureTexture2(gl, width, height, getInternalFormatForFloat32MatrixTexture2(textureConfig), textureConfig.textureFormatFloat, gl.FLOAT); +} +function getInternalFormatForFloat16MatrixTexture2(textureConfig) { + return textureConfig.internalFormatHalfFloat; +} +function createFloat16MatrixTexture2(gl, rows, columns, textureConfig) { + const [width, height] = getUnpackedMatrixTextureShapeWidthHeight2(rows, columns); + return createAndConfigureTexture2(gl, width, height, getInternalFormatForFloat16MatrixTexture2(textureConfig), textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat); +} +function getInternalFormatForUnsignedBytesMatrixTexture2(textureConfig) { + return textureConfig.downloadTextureFormat; +} +function createUnsignedBytesMatrixTexture2(gl, rows, columns, textureConfig) { + const [width, height] = getUnpackedMatrixTextureShapeWidthHeight2(rows, columns); + return createAndConfigureTexture2(gl, width, height, getInternalFormatForUnsignedBytesMatrixTexture2(textureConfig), gl.RGBA, gl.UNSIGNED_BYTE); +} +function getInternalFormatForPackedMatrixTexture2(textureConfig) { + return textureConfig.internalFormatPackedFloat; +} +function createPackedMatrixTexture2(gl, rows, columns, textureConfig) { + const [width, height] = getPackedMatrixTextureShapeWidthHeight2(rows, columns); + return createAndConfigureTexture2(gl, width, height, getInternalFormatForPackedMatrixTexture2(textureConfig), gl.RGBA, gl.FLOAT); +} +function getInternalFormatForFloat16PackedMatrixTexture2(textureConfig) { + return textureConfig.internalFormatPackedHalfFloat; +} +function createFloat16PackedMatrixTexture2(gl, rows, columns, textureConfig) { + const [width, height] = getPackedMatrixTextureShapeWidthHeight2(rows, columns); + return createAndConfigureTexture2(gl, width, height, getInternalFormatForFloat16PackedMatrixTexture2(textureConfig), gl.RGBA, textureConfig.textureTypeHalfFloat); +} +function bindVertexProgramAttributeStreams2(gl, program, vertexBuffer) { + const posOffset = 0; + const uvOffset = 3 * 4; + const stride = 3 * 4 + 2 * 4; + callAndCheck2(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)); + const success = bindVertexBufferToProgramAttribute2(gl, program, "clipSpacePos", vertexBuffer, 3, stride, posOffset); + return success && bindVertexBufferToProgramAttribute2(gl, program, "uv", vertexBuffer, 2, stride, uvOffset); +} +function uploadDenseMatrixToTexture2(gl, texture, width, height, data, textureConfig) { + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture)); + let dataForUpload, texelDataType, internalFormat; + if (data instanceof Uint8Array) { + dataForUpload = new Uint8Array(width * height * 4); + texelDataType = gl.UNSIGNED_BYTE; + internalFormat = gl.RGBA; + } else { + dataForUpload = new Float32Array(width * height * 4); + texelDataType = gl.FLOAT; + internalFormat = textureConfig.internalFormatPackedFloat; + } + dataForUpload.set(data); + callAndCheck2(gl, () => gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, width, height, 0, gl.RGBA, texelDataType, dataForUpload)); + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, null)); +} +function uploadPixelDataToTexture2(gl, texture, pixels) { + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture)); + if (pixels.data instanceof Uint8Array) { + callAndCheck2(gl, () => gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, pixels.width, pixels.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels.data)); + } else { + callAndCheck2(gl, () => gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels)); + } + callAndCheck2(gl, () => gl.bindTexture(gl.TEXTURE_2D, null)); +} +function createBufferFromOutputTexture2(gl2, rows, columns, textureConfig) { + const buffer3 = gl2.createBuffer(); + callAndCheck2(gl2, () => gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer3)); + const bytesPerFloat = 4; + const valuesPerTexel = 4; + const bufferSizeBytes = bytesPerFloat * valuesPerTexel * rows * columns; + callAndCheck2(gl2, () => gl2.bufferData(gl2.PIXEL_PACK_BUFFER, bufferSizeBytes, gl2.STREAM_READ)); + callAndCheck2(gl2, () => gl2.readPixels(0, 0, columns, rows, gl2.RGBA, gl2.FLOAT, 0)); + callAndCheck2(gl2, () => gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null)); + return buffer3; +} +function downloadFloat32MatrixFromBuffer2(gl, buffer3, size2) { + const gl2 = gl; + const downloadTarget = new Float32Array(size2); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer3); + gl2.getBufferSubData(gl2.PIXEL_PACK_BUFFER, 0, downloadTarget); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null); + return downloadTarget; +} +function downloadByteEncodedFloatMatrixFromOutputTexture2(gl, rows, columns, textureConfig) { + const [w, h] = getUnpackedMatrixTextureShapeWidthHeight2(rows, columns); + const numChannels = 4; + const downloadTarget = new Uint8Array(getUnpackedArraySizeFromMatrixSize2(rows * columns, numChannels)); + callAndCheck2(gl, () => gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE, downloadTarget)); + return new Float32Array(downloadTarget.buffer); +} +function downloadPackedMatrixFromBuffer2(gl, buffer3, batch, rows, cols, physicalRows, physicalCols, textureConfig) { + const gl2 = gl; + const downloadTarget = new Float32Array(getPackedRGBAArraySizeFromMatrixShape2(physicalRows, physicalCols)); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer3); + gl2.getBufferSubData(gl2.PIXEL_PACK_BUFFER, 0, downloadTarget); + gl2.bindBuffer(gl2.PIXEL_PACK_BUFFER, null); + return downloadTarget; +} +function downloadMatrixFromPackedOutputTexture2(gl, physicalRows, physicalCols) { + const packedRGBA = new Float32Array(physicalRows * physicalCols * 4); + callAndCheck2(gl, () => gl.readPixels(0, 0, physicalCols, physicalRows, gl.RGBA, gl.FLOAT, packedRGBA)); + return packedRGBA; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/gpgpu_context.js +var GPGPUContext2 = class { + constructor(gl) { + this.outputTexture = null; + this.program = null; + this.disposed = false; + this.vertexAttrsAreBound = false; + this.itemsToPoll = []; + const glVersion = env3().getNumber("WEBGL_VERSION"); + if (gl != null) { + this.gl = gl; + setWebGLContext2(glVersion, gl); + } else { + this.gl = getWebGLContext2(glVersion); + } + let COLOR_BUFFER_FLOAT = "WEBGL_color_buffer_float"; + const COLOR_BUFFER_HALF_FLOAT = "EXT_color_buffer_half_float"; + if (env3().getNumber("WEBGL_VERSION") === 1) { + const TEXTURE_FLOAT = "OES_texture_float"; + const TEXTURE_HALF_FLOAT = "OES_texture_half_float"; + this.textureFloatExtension = getExtensionOrThrow2(this.gl, TEXTURE_FLOAT); + if (hasExtension2(this.gl, TEXTURE_HALF_FLOAT)) { + this.textureHalfFloatExtension = getExtensionOrThrow2(this.gl, TEXTURE_HALF_FLOAT); + } else if (env3().get("WEBGL_FORCE_F16_TEXTURES")) { + throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true."); + } + this.colorBufferFloatExtension = this.gl.getExtension(COLOR_BUFFER_FLOAT); + if (hasExtension2(this.gl, COLOR_BUFFER_HALF_FLOAT)) { + this.colorBufferHalfFloatExtension = getExtensionOrThrow2(this.gl, COLOR_BUFFER_HALF_FLOAT); + } else if (env3().get("WEBGL_FORCE_F16_TEXTURES")) { + throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true."); + } + } else { + COLOR_BUFFER_FLOAT = "EXT_color_buffer_float"; + if (hasExtension2(this.gl, COLOR_BUFFER_FLOAT)) { + this.colorBufferFloatExtension = this.gl.getExtension(COLOR_BUFFER_FLOAT); + } else if (hasExtension2(this.gl, COLOR_BUFFER_HALF_FLOAT)) { + this.colorBufferHalfFloatExtension = this.gl.getExtension(COLOR_BUFFER_HALF_FLOAT); + } else { + throw new Error("GL context does not support color renderable floats"); + } + } + this.vertexBuffer = createVertexBuffer2(this.gl); + this.indexBuffer = createIndexBuffer2(this.gl); + this.framebuffer = createFramebuffer2(this.gl); + this.textureConfig = getTextureConfig2(this.gl, this.textureHalfFloatExtension); + } + get debug() { + return env3().getBool("DEBUG"); + } + dispose() { + if (this.disposed) { + return; + } + if (this.program != null) { + console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."); + } + if (this.outputTexture != null) { + console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing."); + } + const gl = this.gl; + callAndCheck2(gl, () => gl.finish()); + callAndCheck2(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null)); + callAndCheck2(gl, () => gl.deleteFramebuffer(this.framebuffer)); + callAndCheck2(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, null)); + callAndCheck2(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null)); + callAndCheck2(gl, () => gl.deleteBuffer(this.indexBuffer)); + this.disposed = true; + } + createFloat32MatrixTexture(rows, columns) { + this.throwIfDisposed(); + return createFloat32MatrixTexture2(this.gl, rows, columns, this.textureConfig); + } + createFloat16MatrixTexture(rows, columns) { + this.throwIfDisposed(); + return createFloat16MatrixTexture2(this.gl, rows, columns, this.textureConfig); + } + createUnsignedBytesMatrixTexture(rows, columns) { + this.throwIfDisposed(); + return createUnsignedBytesMatrixTexture2(this.gl, rows, columns, this.textureConfig); + } + uploadPixelDataToTexture(texture, pixels) { + this.throwIfDisposed(); + uploadPixelDataToTexture2(this.gl, texture, pixels); + } + uploadDenseMatrixToTexture(texture, width, height, data) { + this.throwIfDisposed(); + uploadDenseMatrixToTexture2(this.gl, texture, width, height, data, this.textureConfig); + } + createFloat16PackedMatrixTexture(rows, columns) { + this.throwIfDisposed(); + return createFloat16PackedMatrixTexture2(this.gl, rows, columns, this.textureConfig); + } + createPackedMatrixTexture(rows, columns) { + this.throwIfDisposed(); + return createPackedMatrixTexture2(this.gl, rows, columns, this.textureConfig); + } + deleteMatrixTexture(texture) { + this.throwIfDisposed(); + if (this.outputTexture === texture) { + unbindColorTextureFromFramebuffer2(this.gl, this.framebuffer); + this.outputTexture = null; + } + callAndCheck2(this.gl, () => this.gl.deleteTexture(texture)); + } + downloadByteEncodedFloatMatrixFromOutputTexture(texture, rows, columns) { + return this.downloadMatrixDriver(texture, () => downloadByteEncodedFloatMatrixFromOutputTexture2(this.gl, rows, columns, this.textureConfig)); + } + downloadPackedMatrixFromBuffer(buffer3, batch, rows, columns, physicalRows, physicalCols) { + return downloadPackedMatrixFromBuffer2(this.gl, buffer3, batch, rows, columns, physicalRows, physicalCols, this.textureConfig); + } + downloadFloat32MatrixFromBuffer(buffer3, size2) { + return downloadFloat32MatrixFromBuffer2(this.gl, buffer3, size2); + } + createBufferFromTexture(texture, rows, columns) { + this.bindTextureToFrameBuffer(texture); + const result = createBufferFromOutputTexture2(this.gl, rows, columns, this.textureConfig); + this.unbindTextureToFrameBuffer(); + return result; + } + createAndWaitForFence() { + const fenceContext = this.createFence(this.gl); + return this.pollFence(fenceContext); + } + createFence(gl) { + let query; + let isFencePassed; + if (env3().getBool("WEBGL_FENCE_API_ENABLED")) { + const gl2 = gl; + const sync = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0); + gl.flush(); + isFencePassed = () => { + const status = gl2.clientWaitSync(sync, 0, 0); + return status === gl2.ALREADY_SIGNALED || status === gl2.CONDITION_SATISFIED; + }; + query = sync; + } else if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0) { + query = this.beginQuery(); + this.endQuery(); + isFencePassed = () => this.isQueryAvailable(query, env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); + } else { + isFencePassed = () => true; + } + return { query, isFencePassed }; + } + downloadMatrixFromPackedTexture(texture, physicalRows, physicalCols) { + return this.downloadMatrixDriver(texture, () => downloadMatrixFromPackedOutputTexture2(this.gl, physicalRows, physicalCols)); + } + createProgram(fragmentShaderSource) { + this.throwIfDisposed(); + const gl = this.gl; + const fragmentShader = createFragmentShader2(gl, fragmentShaderSource); + if (this.vertexShader == null) { + this.vertexShader = createVertexShader4(gl); + } + const program = createProgram2(gl); + callAndCheck2(gl, () => gl.attachShader(program, this.vertexShader)); + callAndCheck2(gl, () => gl.attachShader(program, fragmentShader)); + linkProgram2(gl, program); + if (this.debug) { + validateProgram2(gl, program); + } + if (!this.vertexAttrsAreBound) { + this.setProgram(program); + this.vertexAttrsAreBound = bindVertexProgramAttributeStreams2(gl, this.program, this.vertexBuffer); + } + return program; + } + deleteProgram(program) { + this.throwIfDisposed(); + if (program === this.program) { + this.program = null; + } + if (program != null) { + callAndCheck2(this.gl, () => this.gl.deleteProgram(program)); + } + } + setProgram(program) { + this.throwIfDisposed(); + this.program = program; + if (this.program != null && this.debug) { + validateProgram2(this.gl, this.program); + } + callAndCheck2(this.gl, () => this.gl.useProgram(program)); + } + getUniformLocation(program, uniformName, shouldThrow = true) { + this.throwIfDisposed(); + if (shouldThrow) { + return getProgramUniformLocationOrThrow2(this.gl, program, uniformName); + } else { + return getProgramUniformLocation2(this.gl, program, uniformName); + } + } + getAttributeLocation(program, attribute) { + this.throwIfDisposed(); + return callAndCheck2(this.gl, () => this.gl.getAttribLocation(program, attribute)); + } + getUniformLocationNoThrow(program, uniformName) { + this.throwIfDisposed(); + return this.gl.getUniformLocation(program, uniformName); + } + setInputMatrixTexture(inputMatrixTexture, uniformLocation, textureUnit) { + this.throwIfDisposed(); + this.throwIfNoProgram(); + bindTextureToProgramUniformSampler2(this.gl, inputMatrixTexture, uniformLocation, textureUnit); + } + setOutputMatrixTexture(outputMatrixTexture, rows, columns) { + this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows); + } + setOutputPackedMatrixTexture(outputPackedMatrixTexture, rows, columns) { + this.throwIfDisposed(); + const [width, height] = getPackedMatrixTextureShapeWidthHeight2(rows, columns); + this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height); + } + setOutputMatrixWriteRegion(startRow, numRows, startColumn, numColumns) { + this.setOutputMatrixWriteRegionDriver(startColumn, startRow, numColumns, numRows); + } + setOutputPackedMatrixWriteRegion(startRow, numRows, startColumn, numColumns) { + throw new Error("setOutputPackedMatrixWriteRegion not implemented."); + } + debugValidate() { + if (this.program != null) { + validateProgram2(this.gl, this.program); + } + validateFramebuffer2(this.gl); + } + executeProgram() { + this.throwIfDisposed(); + this.throwIfNoProgram(); + const gl = this.gl; + if (this.debug) { + this.debugValidate(); + } + callAndCheck2(gl, () => gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)); + } + blockUntilAllProgramsCompleted() { + this.throwIfDisposed(); + callAndCheck2(this.gl, () => this.gl.finish()); + } + getQueryTimerExtension() { + if (this.disjointQueryTimerExtension == null) { + this.disjointQueryTimerExtension = getExtensionOrThrow2(this.gl, env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2 ? "EXT_disjoint_timer_query_webgl2" : "EXT_disjoint_timer_query"); + } + return this.disjointQueryTimerExtension; + } + getQueryTimerExtensionWebGL2() { + return this.getQueryTimerExtension(); + } + getQueryTimerExtensionWebGL1() { + return this.getQueryTimerExtension(); + } + beginQuery() { + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2) { + const gl2 = this.gl; + const ext2 = this.getQueryTimerExtensionWebGL2(); + const query2 = gl2.createQuery(); + gl2.beginQuery(ext2.TIME_ELAPSED_EXT, query2); + return query2; + } + const ext = this.getQueryTimerExtensionWebGL1(); + const query = ext.createQueryEXT(); + ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); + return query; + } + endQuery() { + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2) { + const gl2 = this.gl; + const ext2 = this.getQueryTimerExtensionWebGL2(); + gl2.endQuery(ext2.TIME_ELAPSED_EXT); + return; + } + const ext = this.getQueryTimerExtensionWebGL1(); + ext.endQueryEXT(ext.TIME_ELAPSED_EXT); + } + async waitForQueryAndGetTime(query) { + await util_exports2.repeatedTry(() => this.disposed || this.isQueryAvailable(query, env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))); + return this.getQueryTime(query, env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); + } + getQueryTime(query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return null; + } + if (queryTimerVersion === 2) { + const gl2 = this.gl; + const timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT); + return timeElapsedNanos / 1e6; + } else { + const ext = this.getQueryTimerExtensionWebGL1(); + const timeElapsedNanos = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT); + return timeElapsedNanos / 1e6; + } + } + isQueryAvailable(query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return true; + } + if (queryTimerVersion === 2) { + const gl2 = this.gl; + const ext = this.getQueryTimerExtensionWebGL2(); + const available = gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } else { + const ext = this.getQueryTimerExtensionWebGL1(); + const available = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } + } + pollFence(fenceContext) { + return new Promise((resolve) => { + this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve()); + }); + } + pollItems() { + const index = linearSearchLastTrue2(this.itemsToPoll.map((x) => x.isDoneFn)); + for (let i = 0; i <= index; ++i) { + const { resolveFn } = this.itemsToPoll[i]; + resolveFn(); + } + this.itemsToPoll = this.itemsToPoll.slice(index + 1); + } + addItemToPoll(isDoneFn, resolveFn) { + this.itemsToPoll.push({ isDoneFn, resolveFn }); + if (this.itemsToPoll.length > 1) { + return; + } + util_exports2.repeatedTry(() => { + this.pollItems(); + return this.itemsToPoll.length === 0; + }); + } + bindTextureToFrameBuffer(texture) { + this.throwIfDisposed(); + bindColorTextureToFramebuffer2(this.gl, texture, this.framebuffer); + if (this.debug) { + validateFramebuffer2(this.gl); + } + } + unbindTextureToFrameBuffer() { + if (this.outputTexture != null) { + bindColorTextureToFramebuffer2(this.gl, this.outputTexture, this.framebuffer); + if (this.debug) { + validateFramebuffer2(this.gl); + } + } else { + unbindColorTextureFromFramebuffer2(this.gl, this.framebuffer); + } + } + downloadMatrixDriver(texture, downloadAndDecode) { + this.bindTextureToFrameBuffer(texture); + const result = downloadAndDecode(); + this.unbindTextureToFrameBuffer(); + return result; + } + setOutputMatrixTextureDriver(outputMatrixTextureMaybePacked, width, height) { + this.throwIfDisposed(); + const gl = this.gl; + bindColorTextureToFramebuffer2(gl, outputMatrixTextureMaybePacked, this.framebuffer); + if (this.debug) { + validateFramebuffer2(gl); + } + this.outputTexture = outputMatrixTextureMaybePacked; + callAndCheck2(gl, () => gl.viewport(0, 0, width, height)); + callAndCheck2(gl, () => gl.scissor(0, 0, width, height)); + } + setOutputMatrixWriteRegionDriver(x, y, width, height) { + this.throwIfDisposed(); + callAndCheck2(this.gl, () => this.gl.scissor(x, y, width, height)); + } + throwIfDisposed() { + if (this.disposed) { + throw new Error("Attempted to use disposed GPGPUContext."); + } + } + throwIfNoProgram() { + if (this.program == null) { + throw new Error("No GPU program is currently set."); + } + } +}; +function linearSearchLastTrue2(arr) { + let i = 0; + for (; i < arr.length; ++i) { + const isDone = arr[i](); + if (!isDone) { + break; + } + } + return i - 1; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/shared.js +var { addImpl: addImplCPU2, bincountImpl: bincountImplCPU2, bincountReduceImpl: bincountReduceImplCPU2, ceilImpl: ceilImplCPU2, concatImpl: concatImplCPU2, equalImpl: equalImplCPU2, expImpl: expImplCPU2, expm1Impl: expm1ImplCPU2, floorImpl: floorImplCPU2, gatherNdImpl: gatherNdImplCPU2, gatherV2Impl: gatherV2ImplCPU2, greaterImpl: greaterImplCPU2, greaterEqualImpl: greaterEqualImplCPU2, lessImpl: lessImplCPU2, lessEqualImpl: lessEqualImplCPU2, linSpaceImpl: linSpaceImplCPU2, logImpl: logImplCPU2, maxImpl: maxImplCPU2, maximumImpl: maximumImplCPU2, minimumImpl: minimumImplCPU2, multiplyImpl: multiplyImplCPU2, negImpl: negImplCPU2, notEqualImpl: notEqualImplCPU2, prodImpl: prodImplCPU2, rangeImpl: rangeImplCPU2, rsqrtImpl: rsqrtImplCPU2, sigmoidImpl: sigmoidImplCPU2, simpleAbsImpl: simpleAbsImplCPU2, sliceImpl: sliceImplCPU2, sparseFillEmptyRowsImpl: sparseFillEmptyRowsImplCPU2, sparseReshapeImpl: sparseReshapeImplCPU2, sparseSegmentReductionImpl: sparseSegmentReductionImplCPU2, sqrtImpl: sqrtImplCPU2, stridedSliceImpl: stridedSliceImplCPU2, stringNGramsImpl: stringNGramsImplCPU2, stringSplitImpl: stringSplitImplCPU2, stringToHashBucketFastImpl: stringToHashBucketFastImplCPU2, subImpl: subImplCPU2, tileImpl: tileImplCPU2, topKImpl: topKImplCPU2, transposeImpl: transposeImplCPU2, uniqueImpl: uniqueImplCPU2 } = shared_exports2; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/packing_util.js +function getVecChannels2(name, rank) { + return ["x", "y", "z", "w", "u", "v"].slice(0, rank).map((d) => `${name}.${d}`); +} +function getChannels2(name, rank) { + if (rank === 1) { + return [name]; + } + return getVecChannels2(name, rank); +} +function getSourceCoords4(rank, dims) { + if (rank === 1) { + return "rc"; + } + let coords9 = ""; + for (let i = 0; i < rank; i++) { + coords9 += dims[i]; + if (i < rank - 1) { + coords9 += ","; + } + } + return coords9; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/pack_gpu.js +var PackProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = false; + this.packedOutput = true; + this.outputShape = outputShape; + const rank = outputShape.length; + if (rank === 0) { + this.userCode = ` + void main() { + setOutput(vec4(getA(), 0., 0., 0.)); + } + `; + } else { + const channels = getChannels2("rc", rank); + const dtype = getCoordsDataType2(rank); + const outOfBoundsCondition = getOutOfBoundsCondition2(rank, outputShape, channels); + const setup46 = getSetup2(rank, outputShape[outputShape.length - 1], outputShape[outputShape.length - 2], channels); + const output = getOutput2(outputShape, channels); + this.userCode = ` + void main() { + ${dtype} rc = getOutputCoords(); + + if(${outOfBoundsCondition}) { + setOutput(vec4(0)); + } else { + ${setup46} + + setOutput(vec4(${output})); + } + } + `; + } + } +}; +function getSourceCoordsArr2(rank, dims) { + const coords9 = []; + for (let row = 0; row <= 1; row++) { + for (let col = 0; col <= 1; col++) { + let coord = `${row === 0 ? "r" : "rp1"}, ${col === 0 ? "c" : "cp1"}`; + for (let d = 2; d < rank; d++) { + coord = `${dims[dims.length - 1 - d]},` + coord; + } + coords9.push(coord); + } + } + return coords9; +} +function getOutOfBoundsCondition2(rank, shape, dims) { + if (rank === 1) { + return `rc > ${shape[0]}`; + } + let cond = ""; + for (let i = rank - 2; i < rank; i++) { + cond += `${dims[i]} >= ${shape[i]}`; + if (i < rank - 1) { + cond += "||"; + } + } + return cond; +} +function getSetup2(rank, cols, rows, dims) { + if (rank === 1) { + return ""; + } + const innerDims = dims.slice(-2); + return ` + int r = ${innerDims[0]}; + int c = ${innerDims[1]}; + int rp1 = r + 1; + int cp1 = c + 1; + + bool cEdge = cp1 >= ${cols}; + bool rEdge = rp1 >= ${rows}; + `; +} +function getOutput2(shape, dims) { + const rank = shape.length; + const sourceCoords = getSourceCoordsArr2(rank, dims); + if (rank === 1) { + return `getA(rc), + rc + 1 >= ${shape[0]} ? 0. : getA(rc + 1), + 0, 0`; + } + return `getA(${sourceCoords[0]}), + cEdge ? 0. : getA(${sourceCoords[1]}), + rEdge ? 0. : getA(${sourceCoords[2]}), + rEdge || cEdge ? 0. : getA(${sourceCoords[3]})`; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/reshape_packed_gpu.js +var ReshapePackedProgram2 = class { + constructor(outputShape, inputShape) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.customUniforms = [{ name: "inputShape", type: "ivec3" }]; + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + let mainLoop = ``; + for (let i = 0; i < 4; i++) { + let thisRC = `thisRC = rc;`; + if (i % 2 === 1) { + thisRC += `thisRC.z += 1;`; + } + if (i > 1) { + thisRC += `thisRC.y += 1;`; + } + mainLoop += ` + ${thisRC} + ${i > 0 ? `if(thisRC.y < rows && thisRC.z < cols){` : ""} + int flatIndex = getFlatIndex(thisRC); + + ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); + vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); + + result[${i}] = + getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); + ${i > 0 ? "}" : ""} + `; + } + this.userCode = ` + ${getReshapedInputCoords2(inputShape, this.enableShapeUniforms)} + ${this.enableShapeUniforms ? getFlatIndexFrom3DOutput2() : getFlatIndexFrom3D2(outputShape)} + + void main() { + ivec3 rc = getOutputCoords(); + + vec4 result = vec4(0.); + + ivec3 thisRC; + int rows = ${this.enableShapeUniforms ? "outShape[1]" : outputShape[1]}; + int cols = ${this.enableShapeUniforms ? "outShape[2]" : outputShape[2]}; + + ${mainLoop} + + setOutput(result); + } + `; + } +}; +function getReshapedInputCoords2(shape, enableShapeUniforms) { + const coordsFromIndexSnippet = enableShapeUniforms ? getLogicalCoordinatesFromFlatIndexByUniform2(["r", "c", "d"], "inputShape") : getLogicalCoordinatesFromFlatIndex2(["r", "c", "d"], shape); + return ` + ivec3 inputCoordsFromReshapedOutCoords(int index) { + ${coordsFromIndexSnippet} + return ivec3(r, c, d); + } + `; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/texture_manager.js +var TextureManager2 = class { + constructor(gpgpu) { + this.gpgpu = gpgpu; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + this._numBytesAllocated = 0; + this._numBytesFree = 0; + this.freeTextures = {}; + this.logEnabled = false; + this.usedTextures = {}; + } + acquireTexture(shapeRC, usage, isPacked) { + const physicalTexType = getPhysicalFromLogicalTextureType2(usage, isPacked); + const shapeKey = getKeyFromTextureShape2(shapeRC, physicalTexType, isPacked); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + if (!(shapeKey in this.usedTextures)) { + this.usedTextures[shapeKey] = []; + } + const texBytes = computeBytes2(shapeRC, physicalTexType, this.gpgpu.gl, this.gpgpu.textureConfig, isPacked); + if (this.freeTextures[shapeKey].length > 0) { + this.numFreeTextures--; + this.numUsedTextures++; + this._numBytesFree -= texBytes; + this.log(); + const newTexture2 = this.freeTextures[shapeKey].shift(); + this.usedTextures[shapeKey].push(newTexture2); + return newTexture2; + } + let newTexture; + if (physicalTexType === PhysicalTextureType2.PACKED_2X2_FLOAT32) { + newTexture = this.gpgpu.createPackedMatrixTexture(shapeRC[0], shapeRC[1]); + } else if (physicalTexType === PhysicalTextureType2.PACKED_2X2_FLOAT16) { + newTexture = this.gpgpu.createFloat16PackedMatrixTexture(shapeRC[0], shapeRC[1]); + } else if (physicalTexType === PhysicalTextureType2.UNPACKED_FLOAT32) { + newTexture = this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]); + } else if (physicalTexType === PhysicalTextureType2.UNPACKED_FLOAT16) { + newTexture = this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]); + } else if (physicalTexType === PhysicalTextureType2.PACKED_4X1_UNSIGNED_BYTE) { + newTexture = this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]); + } + this.usedTextures[shapeKey].push(newTexture); + this.numUsedTextures++; + this._numBytesAllocated += texBytes; + this.log(); + return newTexture; + } + releaseTexture(texture, shape, logicalTexType, isPacked) { + if (this.freeTextures == null) { + return; + } + const physicalTexType = getPhysicalFromLogicalTextureType2(logicalTexType, isPacked); + const shapeKey = getKeyFromTextureShape2(shape, physicalTexType, isPacked); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + const texBytes = computeBytes2(shape, physicalTexType, this.gpgpu.gl, this.gpgpu.textureConfig, isPacked); + const deleteTexThreshold = env3().get("WEBGL_DELETE_TEXTURE_THRESHOLD"); + if (deleteTexThreshold !== -1 && this._numBytesAllocated > deleteTexThreshold) { + this.gpgpu.deleteMatrixTexture(texture); + this._numBytesAllocated -= texBytes; + } else { + this.freeTextures[shapeKey].push(texture); + this.numFreeTextures++; + this._numBytesFree += texBytes; + } + this.numUsedTextures--; + const texList = this.usedTextures[shapeKey]; + const texIndex = texList.indexOf(texture); + if (texIndex < 0) { + throw new Error("Cannot release a texture that was never provided by this texture manager"); + } + texList.splice(texIndex, 1); + this.log(); + } + log() { + if (!this.logEnabled) { + return; + } + const total = this.numFreeTextures + this.numUsedTextures; + console.log("Free/Used", `${this.numFreeTextures} / ${this.numUsedTextures}`, `(${total})`); + const freeRatio = this._numBytesFree / this._numBytesAllocated; + console.log(`Bytes allocated: ${this._numBytesAllocated}`); + console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100 * freeRatio)}%)`); + } + get numBytesAllocated() { + return this._numBytesAllocated; + } + get numBytesFree() { + return this._numBytesFree; + } + getNumUsedTextures() { + return this.numUsedTextures; + } + getNumFreeTextures() { + return this.numFreeTextures; + } + dispose() { + if (this.freeTextures == null) { + return; + } + for (const texShape in this.freeTextures) { + this.freeTextures[texShape].forEach((tex) => { + this.gpgpu.deleteMatrixTexture(tex); + }); + } + for (const texShape in this.usedTextures) { + this.usedTextures[texShape].forEach((tex) => { + this.gpgpu.deleteMatrixTexture(tex); + }); + } + this.freeTextures = null; + this.usedTextures = null; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + this._numBytesAllocated = 0; + this._numBytesFree = 0; + } +}; +function numBytesForInternalFormat2(gl, internalFormat) { + const glany = gl; + if (internalFormat === glany.R32F) { + return 4; + } else if (internalFormat === glany.R16F) { + return 2; + } else if (internalFormat === glany.RGBA32F) { + return 16; + } else if (internalFormat === gl.RGBA) { + return 16; + } else if (internalFormat === glany.RGBA16F) { + return 8; + } + throw new Error(`Unknown internal format ${internalFormat}`); +} +function computeBytes2(shape, physicalTexType, gl, textureConfig, isPacked) { + const internalFormat = internalFormatForPhysicalTexType2(physicalTexType, textureConfig); + let numElements; + if (isPacked) { + const [packedWidth, packedHeight] = getPackedMatrixTextureShapeWidthHeight2(shape[0], shape[1]); + numElements = packedWidth * packedHeight; + } else { + const [width, height] = getUnpackedMatrixTextureShapeWidthHeight2(shape[0], shape[1]); + numElements = width * height; + } + const bytesPerElement3 = numBytesForInternalFormat2(gl, internalFormat); + return numElements * bytesPerElement3; +} +function internalFormatForPhysicalTexType2(physicalTexType, textureConfig) { + switch (physicalTexType) { + case PhysicalTextureType2.PACKED_2X2_FLOAT32: + return getInternalFormatForPackedMatrixTexture2(textureConfig); + case PhysicalTextureType2.PACKED_2X2_FLOAT16: + return getInternalFormatForFloat16PackedMatrixTexture2(textureConfig); + case PhysicalTextureType2.UNPACKED_FLOAT32: + return getInternalFormatForFloat32MatrixTexture2(textureConfig); + case PhysicalTextureType2.UNPACKED_FLOAT16: + return getInternalFormatForFloat16MatrixTexture2(textureConfig); + case PhysicalTextureType2.PACKED_4X1_UNSIGNED_BYTE: + return getInternalFormatForUnsignedBytesMatrixTexture2(textureConfig); + default: + throw new Error(`Unknown physical texture type ${physicalTexType}`); + } +} +function getPhysicalTextureForRendering2(isPacked) { + if (env3().getBool("WEBGL_RENDER_FLOAT32_ENABLED")) { + if (isPacked) { + return PhysicalTextureType2.PACKED_2X2_FLOAT32; + } + return PhysicalTextureType2.UNPACKED_FLOAT32; + } + if (isPacked) { + return PhysicalTextureType2.PACKED_2X2_FLOAT16; + } + return PhysicalTextureType2.UNPACKED_FLOAT16; +} +function getPhysicalFromLogicalTextureType2(logicalTexType, isPacked) { + if (logicalTexType === TextureUsage2.UPLOAD) { + return PhysicalTextureType2.PACKED_2X2_FLOAT32; + } else if (logicalTexType === TextureUsage2.RENDER || logicalTexType == null) { + return getPhysicalTextureForRendering2(isPacked); + } else if (logicalTexType === TextureUsage2.DOWNLOAD || logicalTexType === TextureUsage2.PIXELS) { + return PhysicalTextureType2.PACKED_4X1_UNSIGNED_BYTE; + } + throw new Error(`Unknown logical texture type ${logicalTexType}`); +} +function getKeyFromTextureShape2(shapeRowsCol, physicalTexType, isPacked) { + return `${shapeRowsCol[0]}_${shapeRowsCol[1]}_${physicalTexType}_${isPacked}`; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/unaryop_gpu.js +var UnaryOpProgram2 = class { + constructor(aShape, opSnippet) { + this.variableNames = ["A"]; + this.outputShape = aShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + this.userCode = ` + float unaryOperation(float x) { + ${opSnippet} + } + + void main() { + float x = getAAtOutCoords(); + float y = unaryOperation(x); + + setOutput(y); + } + `; + } +}; +var CHECK_NAN_SNIPPET4 = `if (isnan(x)) return x;`; +var LINEAR3 = `return x;`; +var ABS3 = `return abs(x);`; +var ELU6 = `return (x >= 0.0) ? x : (exp(x) - 1.0);`; +var RELU4 = CHECK_NAN_SNIPPET4 + ` + return (x < 0.0) ? 0.0 : x; +`; +var RELU64 = CHECK_NAN_SNIPPET4 + ` + return (x < 0.0) ? 0.0 : min(6.0, x); +`; +var CLONE2 = "return x;"; +var SIGMOID4 = `return 1.0 / (1.0 + exp(-1.0 * x));`; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/unaryop_packed_gpu.js +var LINEAR4 = `return x;`; +var ELU7 = ` + vec4 result; + + result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); + result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); + result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); + result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); + + return result; +`; +var RELU5 = ` + vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`; +var RELU65 = ` + vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`; +var SIGMOID5 = `return 1.0 / (1.0 + exp(-1.0 * x));`; +var UnaryOpPackedProgram2 = class { + constructor(aShape, opSnippet) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = aShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + this.userCode = ` + vec4 unaryOperation(vec4 x) { + ${opSnippet} + } + + void main() { + vec4 x = getAAtOutCoords(); + vec4 y = unaryOperation(x); + + setOutput(y); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/unpack_gpu.js +var UnpackProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = false; + this.outputShape = outputShape; + const rank = outputShape.length; + const channels = getChannels2("rc", rank); + const dtype = getCoordsDataType2(rank); + const sourceCoords = getSourceCoords4(rank, channels); + const innerDims = channels.slice(-2); + const coords9 = rank <= 1 ? "rc" : `vec2(${innerDims.join(",")})`; + this.userCode = ` + void main() { + ${dtype} rc = getOutputCoords(); + vec4 packedInput = getA(${sourceCoords}); + + setOutput(getChannel(packedInput, ${coords9})); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/backend_webgl.js +var whereImpl6 = kernel_impls_exports2.whereImpl; +var EPSILON_FLOAT324 = 1e-7; +var EPSILON_FLOAT164 = 1e-4; +var binaryCaches2 = {}; +function getBinaryCache2(webGLVersion) { + if (webGLVersion in binaryCaches2) { + return binaryCaches2[webGLVersion]; + } + binaryCaches2[webGLVersion] = {}; + return binaryCaches2[webGLVersion]; +} +var CPU_HANDOFF_SIZE_THRESHOLD2 = env3().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"); +var BEFORE_PAGING_CONSTANT2 = 600; +function numMBBeforeWarning2() { + if (env3().global.screen == null) { + return 1024; + } + return env3().global.screen.height * env3().global.screen.width * window.devicePixelRatio * BEFORE_PAGING_CONSTANT2 / 1024 / 1024; +} +var MathBackendWebGL2 = class extends KernelBackend2 { + constructor(gpgpu) { + super(); + this.pendingRead = new WeakMap(); + this.pendingDisposal = new WeakSet(); + this.dataRefCount = new WeakMap(); + this.numBytesInGPU = 0; + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + this.lastGlFlushTime = 0; + this.warnedAboutMemory = false; + this.pendingDeletes = 0; + this.disposed = false; + if (!env3().getBool("HAS_WEBGL")) { + throw new Error("WebGL is not supported on this device"); + } + if (gpgpu == null) { + const gl = getWebGLContext2(env3().getNumber("WEBGL_VERSION")); + this.binaryCache = getBinaryCache2(env3().getNumber("WEBGL_VERSION")); + this.gpgpu = new GPGPUContext2(gl); + this.canvas = gl.canvas; + this.gpgpuCreatedLocally = true; + } else { + this.gpgpu = gpgpu; + this.binaryCache = {}; + this.gpgpuCreatedLocally = false; + this.canvas = gpgpu.gl.canvas; + } + this.textureManager = new TextureManager2(this.gpgpu); + this.numMBBeforeWarning = numMBBeforeWarning2(); + this.texData = new DataStorage2(this, engine2()); + } + nextDataId() { + return MathBackendWebGL2.nextDataId++; + } + numDataIds() { + return this.texData.numDataIds() - this.pendingDeletes; + } + write(values, shape, dtype) { + if (env3().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS") || env3().getBool("DEBUG")) { + this.checkNumericalProblems(values); + } + if (dtype === "complex64" && values != null) { + throw new Error(`Cannot write to a complex64 dtype. Please use tf.complex(real, imag).`); + } + const dataId = { id: this.nextDataId() }; + this.texData.set(dataId, { shape, dtype, values, usage: TextureUsage2.UPLOAD, refCount: 1 }); + return dataId; + } + refCount(dataId) { + if (this.texData.has(dataId)) { + const tensorData = this.texData.get(dataId); + return tensorData.refCount; + } + return 0; + } + incRef(dataId) { + const texData = this.texData.get(dataId); + texData.refCount++; + } + decRef(dataId) { + if (this.texData.has(dataId)) { + const texData = this.texData.get(dataId); + texData.refCount--; + } + } + move(dataId, values, shape, dtype, refCount) { + if (env3().getBool("DEBUG")) { + this.checkNumericalProblems(values); + } + if (dtype === "complex64") { + throw new Error(`Cannot write to a complex64 dtype. Please use tf.complex(real, imag).`); + } + this.texData.set(dataId, { shape, dtype, values, usage: TextureUsage2.UPLOAD, refCount }); + } + disposeIntermediateTensorInfo(tensorInfo) { + this.disposeData(tensorInfo.dataId); + } + readSync(dataId) { + const texData = this.texData.get(dataId); + const { values, dtype, complexTensorInfos, slice: slice8, shape, isPacked } = texData; + if (slice8 != null) { + let program; + if (isPacked) { + program = new UnaryOpPackedProgram2(shape, CLONE2); + } else { + program = new UnaryOpProgram2(shape, CLONE2); + } + const res = this.runWebGLProgram(program, [{ dataId, shape, dtype }], dtype); + const data = this.readSync(res.dataId); + this.disposeIntermediateTensorInfo(res); + return data; + } + if (values != null) { + return this.convertAndCacheOnCPU(dataId); + } + if (dtype === "string") { + return values; + } + const shouldTimeProgram = this.activeTimers != null; + let start; + if (shouldTimeProgram) { + start = util_exports2.now(); + } + let result; + if (dtype === "complex64") { + const realValues = this.readSync(complexTensorInfos.real.dataId); + const imagValues = this.readSync(complexTensorInfos.imag.dataId); + result = backend_util_exports2.mergeRealAndImagArrays(realValues, imagValues); + } else { + result = this.getValuesFromTexture(dataId); + } + if (shouldTimeProgram) { + this.downloadWaitMs += util_exports2.now() - start; + } + return this.convertAndCacheOnCPU(dataId, result); + } + async read(dataId) { + if (this.pendingRead.has(dataId)) { + const subscribers2 = this.pendingRead.get(dataId); + return new Promise((resolve) => subscribers2.push(resolve)); + } + const texData = this.texData.get(dataId); + const { values, shape, slice: slice8, dtype, complexTensorInfos, isPacked } = texData; + if (slice8 != null) { + let program; + if (isPacked) { + program = new UnaryOpPackedProgram2(shape, CLONE2); + } else { + program = new UnaryOpProgram2(shape, CLONE2); + } + const res = this.runWebGLProgram(program, [{ dataId, shape, dtype }], dtype); + const data = this.read(res.dataId); + this.disposeIntermediateTensorInfo(res); + return data; + } + if (values != null) { + return this.convertAndCacheOnCPU(dataId); + } + if (!env3().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED") && env3().getNumber("WEBGL_VERSION") === 2) { + throw new Error(`tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.`); + } + let buffer3 = null; + let tmpDownloadTarget; + if (dtype !== "complex64" && env3().get("WEBGL_BUFFER_SUPPORTED")) { + tmpDownloadTarget = this.decode(dataId); + const tmpData = this.texData.get(tmpDownloadTarget.dataId); + buffer3 = this.gpgpu.createBufferFromTexture(tmpData.texture, ...getDenseTexShape2(shape)); + } + this.pendingRead.set(dataId, []); + if (dtype !== "complex64") { + await this.gpgpu.createAndWaitForFence(); + } + let vals; + if (dtype === "complex64") { + const ps = await Promise.all([ + this.read(complexTensorInfos.real.dataId), + this.read(complexTensorInfos.imag.dataId) + ]); + const realValues = ps[0]; + const imagValues = ps[1]; + vals = backend_util_exports2.mergeRealAndImagArrays(realValues, imagValues); + } else if (buffer3 == null) { + vals = this.getValuesFromTexture(dataId); + } else { + const size2 = util_exports2.sizeFromShape(shape); + vals = this.gpgpu.downloadFloat32MatrixFromBuffer(buffer3, size2); + } + if (tmpDownloadTarget != null) { + this.disposeIntermediateTensorInfo(tmpDownloadTarget); + } + if (buffer3 != null) { + const gl = this.gpgpu.gl; + callAndCheck2(gl, () => gl.deleteBuffer(buffer3)); + } + const dTypeVals = this.convertAndCacheOnCPU(dataId, vals); + const subscribers = this.pendingRead.get(dataId); + this.pendingRead.delete(dataId); + subscribers.forEach((resolve) => resolve(dTypeVals)); + if (this.pendingDisposal.has(dataId)) { + this.pendingDisposal.delete(dataId); + if (this.disposeData(dataId)) { + engine2().removeDataId(dataId, this); + } + this.pendingDeletes--; + } + return dTypeVals; + } + bufferSync(t) { + const data = this.readSync(t.dataId); + let decodedData = data; + if (t.dtype === "string") { + try { + decodedData = data.map((d) => util_exports2.decodeString(d)); + } catch (_a) { + throw new Error("Failed to decode encoded string bytes into utf-8"); + } + } + return buffer2(t.shape, t.dtype, decodedData); + } + checkNumericalProblems(values) { + if (values == null) { + return; + } + for (let i = 0; i < values.length; i++) { + const num = values[i]; + if (!canBeRepresented2(num)) { + if (env3().getBool("WEBGL_RENDER_FLOAT32_CAPABLE")) { + throw Error(`The value ${num} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`); + } + throw Error(`The value ${num} cannot be represented on this device.`); + } + } + } + getValuesFromTexture(dataId) { + const { shape, dtype, isPacked } = this.texData.get(dataId); + const size2 = util_exports2.sizeFromShape(shape); + if (env3().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")) { + const tmpTarget = this.decode(dataId); + const tmpData2 = this.texData.get(tmpTarget.dataId); + const vals2 = this.gpgpu.downloadMatrixFromPackedTexture(tmpData2.texture, ...getDenseTexShape2(shape)).subarray(0, size2); + this.disposeIntermediateTensorInfo(tmpTarget); + return vals2; + } + const shouldUsePackedProgram = env3().getBool("WEBGL_PACK") && isPacked === true; + const outputShape = shouldUsePackedProgram ? getShapeAs3D2(shape) : shape; + const program = shouldUsePackedProgram ? new EncodeFloatPackedProgram2(outputShape) : new EncodeFloatProgram2(outputShape); + const output = this.runWebGLProgram(program, [{ shape: outputShape, dtype, dataId }], "float32"); + const tmpData = this.texData.get(output.dataId); + const vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]).subarray(0, size2); + this.disposeIntermediateTensorInfo(output); + return vals; + } + timerAvailable() { + return env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0; + } + async time(f) { + const oldActiveTimers = this.activeTimers; + const newActiveTimers = []; + let outerMostTime = false; + if (this.programTimersStack == null) { + this.programTimersStack = newActiveTimers; + outerMostTime = true; + } else { + this.activeTimers.push(newActiveTimers); + } + this.activeTimers = newActiveTimers; + f(); + const flattenedActiveTimerQueries = util_exports2.flatten(this.activeTimers.map((d) => d.query)).filter((d) => d != null); + const flattenedActiveTimerNames = util_exports2.flatten(this.activeTimers.map((d) => d.name)).filter((d) => d != null); + this.activeTimers = oldActiveTimers; + if (outerMostTime) { + this.programTimersStack = null; + } + const res = { + uploadWaitMs: this.uploadWaitMs, + downloadWaitMs: this.downloadWaitMs, + kernelMs: null, + wallMs: null + }; + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) { + const kernelMs = await Promise.all(flattenedActiveTimerQueries); + res["kernelMs"] = util_exports2.sum(kernelMs); + res["getExtraProfileInfo"] = () => kernelMs.map((d, i) => ({ name: flattenedActiveTimerNames[i], ms: d })).map((d) => `${d.name}: ${d.ms}`).join(", "); + } else { + res["kernelMs"] = { + error: "WebGL query timers are not supported in this environment." + }; + } + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + return res; + } + memory() { + return { + unreliable: false, + numBytesInGPU: this.numBytesInGPU, + numBytesInGPUAllocated: this.textureManager.numBytesAllocated, + numBytesInGPUFree: this.textureManager.numBytesFree + }; + } + startTimer() { + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) { + return this.gpgpu.beginQuery(); + } + return { startMs: util_exports2.now(), endMs: null }; + } + endTimer(query) { + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) { + this.gpgpu.endQuery(); + return query; + } + query.endMs = util_exports2.now(); + return query; + } + async getQueryTime(query) { + if (env3().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) { + return this.gpgpu.waitForQueryAndGetTime(query); + } + const timerQuery = query; + return timerQuery.endMs - timerQuery.startMs; + } + disposeData(dataId, force = false) { + if (this.pendingDisposal.has(dataId)) { + return false; + } + if (!this.texData.has(dataId)) { + return true; + } + if (force) { + this.texData.get(dataId).refCount = 0; + } else { + this.texData.get(dataId).refCount--; + } + if (!force && this.texData.get(dataId).refCount > 0) { + return false; + } + if (this.pendingRead.has(dataId)) { + this.pendingDisposal.add(dataId); + this.pendingDeletes++; + return false; + } + this.releaseGPUData(dataId); + const { complexTensorInfos } = this.texData.get(dataId); + if (complexTensorInfos != null) { + this.disposeData(complexTensorInfos.real.dataId, force); + this.disposeData(complexTensorInfos.imag.dataId, force); + } + this.texData.delete(dataId); + return true; + } + releaseGPUData(dataId) { + const { texture, dtype, texShape, usage, isPacked, slice: slice8 } = this.texData.get(dataId); + const key = slice8 && slice8.origDataId || dataId; + const refCount = this.dataRefCount.get(key); + if (refCount > 1) { + this.dataRefCount.set(key, refCount - 1); + } else { + this.dataRefCount.delete(key); + if (texture != null) { + this.numBytesInGPU -= this.computeBytes(texShape, dtype); + this.textureManager.releaseTexture(texture, texShape, usage, isPacked); + } + } + const texData = this.texData.get(dataId); + texData.texture = null; + texData.texShape = null; + texData.isPacked = false; + texData.slice = null; + } + getTexture(dataId) { + this.uploadToGPU(dataId); + return this.texData.get(dataId).texture; + } + getDataInfo(dataId) { + return this.texData.get(dataId); + } + shouldExecuteOnCPU(inputs, sizeThreshold = CPU_HANDOFF_SIZE_THRESHOLD2) { + return env3().getBool("WEBGL_CPU_FORWARD") && inputs.every((input3) => this.texData.get(input3.dataId).texture == null && util_exports2.sizeFromShape(input3.shape) < sizeThreshold); + } + getGPGPUContext() { + return this.gpgpu; + } + where(condition) { + backend_util_exports2.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead"); + const condVals = condition.dataSync(); + return whereImpl6(condition.shape, condVals); + } + packedUnaryOp(x, op3, dtype) { + const program = new UnaryOpPackedProgram2(x.shape, op3); + const outInfo = this.compileAndRun(program, [x], dtype); + return engine2().makeTensorFromDataId(outInfo.dataId, outInfo.shape, outInfo.dtype); + } + abs(x) { + if (this.shouldExecuteOnCPU([x]) && x.dtype !== "complex64") { + const outValues = simpleAbsImplCPU2(this.texData.get(x.dataId).values); + return this.makeOutput(x.shape, x.dtype, outValues); + } + if (env3().getBool("WEBGL_PACK_UNARY_OPERATIONS")) { + return this.packedUnaryOp(x, ABS3, x.dtype); + } + const program = new UnaryOpProgram2(x.shape, ABS3); + const outInfo = this.compileAndRun(program, [x]); + return engine2().makeTensorFromDataId(outInfo.dataId, outInfo.shape, outInfo.dtype); + } + makeTensorInfo(shape, dtype, values) { + let dataId; + if (dtype === "string" && values != null && values.length > 0 && util_exports2.isString(values[0])) { + const encodedValues = values.map((d) => util_exports2.encodeString(d)); + dataId = this.write(encodedValues, shape, dtype); + } else { + dataId = this.write(values, shape, dtype); + } + this.texData.get(dataId).usage = null; + return { dataId, shape, dtype }; + } + makeOutput(shape, dtype, values) { + const { dataId } = this.makeTensorInfo(shape, dtype, values); + return engine2().makeTensorFromDataId(dataId, shape, dtype, this); + } + unpackTensor(input3) { + const program = new UnpackProgram2(input3.shape); + return this.runWebGLProgram(program, [input3], input3.dtype); + } + packTensor(input3) { + const program = new PackProgram2(input3.shape); + const preventEagerUnpackingOutput = true; + return this.runWebGLProgram(program, [input3], input3.dtype, null, preventEagerUnpackingOutput); + } + packedReshape(input3, afterShape) { + const input3DShape = [ + getBatchDim2(input3.shape), + ...getRowsCols2(input3.shape) + ]; + const input3D = { + dtype: input3.dtype, + shape: input3DShape, + dataId: input3.dataId + }; + const afterShapeAs3D = [ + getBatchDim2(afterShape), + ...getRowsCols2(afterShape) + ]; + const program = new ReshapePackedProgram2(afterShapeAs3D, input3DShape); + const preventEagerUnpackingOfOutput = true; + const customValues = [input3DShape]; + const output = this.runWebGLProgram(program, [input3D], input3.dtype, customValues, preventEagerUnpackingOfOutput); + return { dataId: output.dataId, shape: afterShape, dtype: output.dtype }; + } + decode(dataId) { + const texData = this.texData.get(dataId); + const { isPacked, shape, dtype } = texData; + const shapeAs3D = getShapeAs3D2(shape); + let program; + const denseTexShape = getDenseTexShape2(shapeAs3D); + if (isPacked) { + program = new DecodeMatrixPackedProgram2(shapeAs3D); + } else { + program = new DecodeMatrixProgram2(shapeAs3D); + } + const preventEagerUnpackingOfOutput = true; + const customValues = [denseTexShape]; + const out = this.runWebGLProgram(program, [{ shape: shapeAs3D, dtype, dataId }], dtype, customValues, preventEagerUnpackingOfOutput); + return { dtype, shape, dataId: out.dataId }; + } + runWebGLProgram(program, inputs, outputDtype, customUniformValues, preventEagerUnpackingOfOutput = false) { + const output = this.makeTensorInfo(program.outputShape, outputDtype); + const outData = this.texData.get(output.dataId); + if (program.packedOutput) { + outData.isPacked = true; + } + if (program.outPackingScheme === PackingScheme2.DENSE) { + const texelShape = getDenseTexShape2(program.outputShape); + outData.texShape = texelShape.map((d) => d * 2); + } + if (program.outTexUsage != null) { + outData.usage = program.outTexUsage; + } + if (util_exports2.sizeFromShape(output.shape) === 0) { + outData.values = util_exports2.getTypedArrayFromDType(output.dtype, 0); + return output; + } + const dataToDispose = []; + const inputsData = inputs.map((input3) => { + if (input3.dtype === "complex64") { + throw new Error(`GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.`); + } + let texData = this.texData.get(input3.dataId); + if (texData.texture == null) { + if (!program.packedInputs && util_exports2.sizeFromShape(input3.shape) <= env3().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM")) { + return { + shape: input3.shape, + texData: null, + isUniform: true, + uniformValues: texData.values + }; + } + if (program.packedInputs) { + texData.isPacked = true; + texData.shape = input3.shape; + } + } else if (!!texData.isPacked !== !!program.packedInputs) { + input3 = texData.isPacked ? this.unpackTensor(input3) : this.packTensor(input3); + dataToDispose.push(input3); + texData = this.texData.get(input3.dataId); + } else if (texData.isPacked && !isReshapeFree2(texData.shape, input3.shape)) { + const savedInput = input3; + const targetShape = input3.shape; + input3.shape = texData.shape; + input3 = this.packedReshape(input3, targetShape); + dataToDispose.push(input3); + texData = this.texData.get(input3.dataId); + savedInput.shape = targetShape; + } + this.uploadToGPU(input3.dataId); + return { shape: input3.shape, texData, isUniform: false }; + }); + this.uploadToGPU(output.dataId); + const outputData = { shape: output.shape, texData: outData, isUniform: false }; + const key = makeShaderKey2(program, inputsData, outputData); + const binary = this.getAndSaveBinary(key, () => { + return compileProgram2(this.gpgpu, program, inputsData, outputData); + }); + const shouldTimeProgram = this.activeTimers != null; + let query; + if (shouldTimeProgram) { + query = this.startTimer(); + } + runProgram2(this.gpgpu, binary, inputsData, outputData, customUniformValues); + dataToDispose.forEach((info) => this.disposeIntermediateTensorInfo(info)); + if (shouldTimeProgram) { + query = this.endTimer(query); + this.activeTimers.push({ name: program.constructor.name, query: this.getQueryTime(query) }); + } + const glFlushThreshold = env3().get("WEBGL_FLUSH_THRESHOLD"); + if (glFlushThreshold > 0) { + const time2 = util_exports2.now(); + if (time2 - this.lastGlFlushTime > glFlushThreshold) { + this.gpgpu.gl.flush(); + this.lastGlFlushTime = time2; + } + } + if (!env3().getBool("WEBGL_LAZILY_UNPACK") && outData.isPacked && preventEagerUnpackingOfOutput === false) { + const unpacked = this.unpackTensor(output); + this.disposeIntermediateTensorInfo(output); + return unpacked; + } + return output; + } + compileAndRun(program, inputs, outputDtype, customUniformValues, preventEagerUnpackingOfOutput = false) { + outputDtype = outputDtype || inputs[0].dtype; + const outInfo = this.runWebGLProgram(program, inputs, outputDtype, customUniformValues, preventEagerUnpackingOfOutput); + return outInfo; + } + getAndSaveBinary(key, getBinary) { + if (!(key in this.binaryCache)) { + this.binaryCache[key] = getBinary(); + } + return this.binaryCache[key]; + } + getTextureManager() { + return this.textureManager; + } + dispose() { + if (this.disposed) { + return; + } + if (!env3().getBool("IS_TEST")) { + const allKeys = Object.keys(this.binaryCache); + allKeys.forEach((key) => { + this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram); + delete this.binaryCache[key]; + }); + } + this.textureManager.dispose(); + if (this.canvas != null && (typeof HTMLCanvasElement !== "undefined" && this.canvas instanceof HTMLCanvasElement)) { + this.canvas.remove(); + } else { + this.canvas = null; + } + if (this.gpgpuCreatedLocally) { + this.gpgpu.program = null; + this.gpgpu.dispose(); + } + this.disposed = true; + } + floatPrecision() { + if (this.floatPrecisionValue == null) { + this.floatPrecisionValue = tidy2(() => { + if (!env3().get("WEBGL_RENDER_FLOAT32_ENABLED")) { + const debugFlag = env3().getBool("DEBUG"); + env3().set("DEBUG", false); + const underflowCheckValue = this.abs(scalar2(1e-8)).dataSync()[0]; + env3().set("DEBUG", debugFlag); + if (underflowCheckValue > 0) { + return 32; + } + } + return 16; + }); + } + return this.floatPrecisionValue; + } + epsilon() { + return this.floatPrecision() === 32 ? EPSILON_FLOAT324 : EPSILON_FLOAT164; + } + uploadToGPU(dataId) { + const texData = this.texData.get(dataId); + const { shape, dtype, values, texture, usage, isPacked } = texData; + if (texture != null) { + return; + } + const shouldTimeProgram = this.activeTimers != null; + let start; + if (shouldTimeProgram) { + start = util_exports2.now(); + } + let texShape = texData.texShape; + if (texShape == null) { + texShape = getTextureShapeFromLogicalShape2(shape, isPacked); + texData.texShape = texShape; + } + if (values != null) { + const shapeAs3D = getShapeAs3D2(shape); + let program; + let width = texShape[1], height = texShape[0]; + const isByteArray = values instanceof Uint8Array; + if (isPacked) { + [width, height] = getPackedMatrixTextureShapeWidthHeight2(texShape[0], texShape[1]); + program = new EncodeMatrixPackedProgram2(shapeAs3D, isByteArray); + } else { + program = new EncodeMatrixProgram2(shapeAs3D, isByteArray); + } + const tempDenseInputHandle = this.makeTensorInfo([height, width], dtype); + if (isByteArray) { + this.texData.get(tempDenseInputHandle.dataId).usage = TextureUsage2.PIXELS; + } else { + this.texData.get(tempDenseInputHandle.dataId).usage = TextureUsage2.UPLOAD; + } + this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(tempDenseInputHandle.dataId), width, height, values); + const customValues = [[height, width]]; + const preventEagerUnpacking = true; + const encodedOutputTarget = this.runWebGLProgram(program, [tempDenseInputHandle], dtype, customValues, preventEagerUnpacking); + const outputTexData = this.texData.get(encodedOutputTarget.dataId); + texData.texture = outputTexData.texture; + texData.texShape = outputTexData.texShape; + texData.isPacked = outputTexData.isPacked; + texData.usage = outputTexData.usage; + this.disposeIntermediateTensorInfo(tempDenseInputHandle); + this.texData.delete(encodedOutputTarget.dataId); + texData.values = null; + if (shouldTimeProgram) { + this.uploadWaitMs += util_exports2.now() - start; + } + } else { + const newTexture = this.acquireTexture(texShape, usage, dtype, isPacked); + texData.texture = newTexture; + } + } + convertAndCacheOnCPU(dataId, float32Values) { + const texData = this.texData.get(dataId); + const { dtype } = texData; + this.releaseGPUData(dataId); + if (float32Values != null) { + texData.values = float32ToTypedArray2(float32Values, dtype); + } + return texData.values; + } + acquireTexture(texShape, texType, dtype, isPacked) { + this.numBytesInGPU += this.computeBytes(texShape, dtype); + if (!this.warnedAboutMemory && this.numBytesInGPU > this.numMBBeforeWarning * 1024 * 1024) { + const mb = (this.numBytesInGPU / 1024 / 1024).toFixed(2); + this.warnedAboutMemory = true; + console.warn(`High memory usage in GPU: ${mb} MB, most likely due to a memory leak`); + } + return this.textureManager.acquireTexture(texShape, texType, isPacked); + } + computeBytes(shape, dtype) { + return shape[0] * shape[1] * util_exports2.bytesPerElement(dtype); + } +}; +MathBackendWebGL2.nextDataId = 0; +function float32ToTypedArray2(a, dtype) { + if (dtype === "float32" || dtype === "complex64") { + return a; + } else if (dtype === "int32" || dtype === "bool") { + const result = dtype === "int32" ? new Int32Array(a.length) : new Uint8Array(a.length); + for (let i = 0; i < result.length; ++i) { + result[i] = Math.round(a[i]); + } + return result; + } else { + throw new Error(`Unknown dtype ${dtype}`); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/base.js +if (device_util_exports2.isBrowser()) { + registerBackend2("webgl", () => new MathBackendWebGL2(), 2); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_gpu.js +var CHECK_NAN_SNIPPET5 = ` + if (isnan(a)) return a; + if (isnan(b)) return b; +`; +var BinaryOpProgram2 = class { + constructor(op3, aShape, bShape) { + this.variableNames = ["A", "B"]; + this.outputShape = backend_util_exports2.assertAndGetBroadcastShape(aShape, bShape); + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + this.userCode = ` + float binaryOperation(float a, float b) { + ${op3} + } + + void main() { + float a = getAAtOutCoords(); + float b = getBAtOutCoords(); + setOutput(binaryOperation(a, b)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_packed_gpu.js +var CHECK_NAN_SNIPPET6 = ` + result.r = isNaN.r > 0. ? NAN : result.r; + result.g = isNaN.g > 0. ? NAN : result.g; + result.b = isNaN.b > 0. ? NAN : result.b; + result.a = isNaN.a > 0. ? NAN : result.a; +`; +var BinaryOpPackedProgram2 = class { + constructor(op3, aShape, bShape, checkOutOfBounds = false) { + this.variableNames = ["A", "B"]; + this.supportsBroadcasting = true; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = backend_util_exports2.assertAndGetBroadcastShape(aShape, bShape); + const rank = this.outputShape.length; + this.enableShapeUniforms = useShapeUniforms2(rank); + let checkOutOfBoundsString = ""; + if (checkOutOfBounds) { + if (rank === 0 || util_exports2.sizeFromShape(this.outputShape) === 1) { + checkOutOfBoundsString = ` + result.y = 0.; + result.z = 0.; + result.w = 0.; + `; + } else { + const dtype = getCoordsDataType2(rank); + checkOutOfBoundsString = ` + ${dtype} coords = getOutputCoords(); + `; + if (rank === 1) { + if (this.enableShapeUniforms) { + checkOutOfBoundsString += ` + result.y = (coords + 1) >= outShape ? 0. : result.y; + result.z = 0.; + result.w = 0.; + `; + } else { + checkOutOfBoundsString += ` + result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; + result.z = 0.; + result.w = 0.; + `; + } + } else { + const channels = getChannels2("coords", rank); + if (this.enableShapeUniforms) { + checkOutOfBoundsString += ` + bool nextRowOutOfBounds = + (${channels[rank - 2]} + 1) >= outShape[${rank} - 2]; + bool nextColOutOfBounds = + (${channels[rank - 1]} + 1) >= outShape[${rank} - 1]; + result.y = nextColOutOfBounds ? 0. : result.y; + result.z = nextRowOutOfBounds ? 0. : result.z; + result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; + `; + } else { + checkOutOfBoundsString += ` + bool nextRowOutOfBounds = + (${channels[rank - 2]} + 1) >= ${this.outputShape[rank - 2]}; + bool nextColOutOfBounds = + (${channels[rank - 1]} + 1) >= ${this.outputShape[rank - 1]}; + result.y = nextColOutOfBounds ? 0. : result.y; + result.z = nextRowOutOfBounds ? 0. : result.z; + result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; + `; + } + } + } + } + this.userCode = ` + vec4 binaryOperation(vec4 a, vec4 b) { + ${op3} + } + + void main() { + vec4 a = getAAtOutCoords(); + vec4 b = getBAtOutCoords(); + + vec4 result = binaryOperation(a, b); + ${checkOutOfBoundsString} + + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Identity.js +function identity6(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + backend4.incRef(x.dataId); + return { dataId: x.dataId, shape: x.shape, dtype: x.dtype }; +} +var identityConfig5 = { + kernelName: Identity3, + backendName: "webgl", + kernelFunc: identity6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Complex.js +function complex6(args) { + const { inputs, backend: backend4 } = args; + const { real: real7, imag: imag7 } = inputs; + const complexInfo = backend4.makeTensorInfo(real7.shape, "complex64"); + const complex7 = backend4.texData.get(complexInfo.dataId); + const realTensorInfo = identity6({ inputs: { x: real7 }, backend: backend4 }); + const imagTensorInfo = identity6({ inputs: { x: imag7 }, backend: backend4 }); + complex7.complexTensorInfos = { real: realTensorInfo, imag: imagTensorInfo }; + return complexInfo; +} +var complexConfig4 = { + kernelName: Complex2, + backendName: "webgl", + kernelFunc: complex6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LeakyRelu.js +var LEAKYRELU2 = `return (a < 0.) ? b * a : a;`; +var LEAKYRELU_PACKED2 = ` + vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); + return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); +`; +function leakyRelu7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { alpha } = attrs; + const $alpha = backend4.makeTensorInfo([], "float32", util_exports2.createScalarValue(alpha, "float32")); + const program = env3().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new BinaryOpPackedProgram2(LEAKYRELU_PACKED2, x.shape, $alpha.shape) : new BinaryOpProgram2(LEAKYRELU2, x.shape, $alpha.shape); + const result = backend4.runWebGLProgram(program, [x, $alpha], x.dtype); + backend4.disposeIntermediateTensorInfo($alpha); + return result; +} +var leakyReluConfig5 = { + kernelName: LeakyRelu2, + backendName: "webgl", + kernelFunc: leakyRelu7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Prelu.js +var PRELU2 = `return (a < 0.) ? b * a : a;`; +var PRELU_PACKED2 = ` + vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); + return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); +`; +function prelu8(args) { + const { inputs, backend: backend4 } = args; + const { x, alpha } = inputs; + const program = env3().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new BinaryOpPackedProgram2(PRELU_PACKED2, x.shape, alpha.shape) : new BinaryOpProgram2(PRELU2, x.shape, alpha.shape); + return backend4.runWebGLProgram(program, [x, alpha], x.dtype); +} +var preluConfig5 = { + kernelName: Prelu2, + backendName: "webgl", + kernelFunc: prelu8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/kernel_funcs_utils.js +var CHECK_NAN_SNIPPET_UNARY2 = `if (isnan(x)) return x;`; +var CHECK_NAN_SNIPPET_BINARY2 = ` + if (isnan(a)) return a; + if (isnan(b)) return b; +`; +var CHECK_NAN_SNIPPET_BINARY_PACKED2 = ` + result.r = isNaN.r > 0. ? NAN : result.r; + result.g = isNaN.g > 0. ? NAN : result.g; + result.b = isNaN.b > 0. ? NAN : result.b; + result.a = isNaN.a > 0. ? NAN : result.a; +`; +function unaryKernelFunc4({ opSnippet, packedOpSnippet, cpuKernelImpl, dtype }) { + return ({ inputs, backend: backend4 }) => { + const { x } = inputs; + const webglBackend = backend4; + const $dtype = dtype || x.dtype; + if (webglBackend.shouldExecuteOnCPU([x]) && cpuKernelImpl != null) { + const xData = webglBackend.texData.get(x.dataId); + const outValues = cpuKernelImpl(xData.values, $dtype); + return webglBackend.makeTensorInfo(x.shape, $dtype, outValues); + } + const shouldUsePackedProgram = env3().getBool("WEBGL_PACK_UNARY_OPERATIONS") && packedOpSnippet != null; + let program; + if (shouldUsePackedProgram) { + program = new UnaryOpPackedProgram2(x.shape, packedOpSnippet); + } else { + program = new UnaryOpProgram2(x.shape, opSnippet); + } + return webglBackend.runWebGLProgram(program, [x], $dtype); + }; +} +function binaryKernelFunc4({ opSnippet, packedOpSnippet, checkOutOfBounds = false, supportsComplex = false, cpuKernelImpl, dtype }) { + return ({ inputs, backend: backend4 }) => { + const { a, b } = inputs; + const webglBackend = backend4; + if (supportsComplex && a.dtype === "complex64") { + const aData = webglBackend.texData.get(a.dataId); + const bData = webglBackend.texData.get(b.dataId); + const [real7, imag7] = [ + [aData.complexTensorInfos.real, bData.complexTensorInfos.real], + [aData.complexTensorInfos.imag, bData.complexTensorInfos.imag] + ].map((complexParts) => { + const [aPart, bPart] = complexParts; + const aHandle = { + dataId: aPart.dataId, + dtype: aPart.dtype, + shape: a.shape + }; + const bHandle = { + dataId: bPart.dataId, + dtype: bPart.dtype, + shape: b.shape + }; + const program2 = new BinaryOpProgram2(opSnippet, a.shape, b.shape); + return webglBackend.runWebGLProgram(program2, [aHandle, bHandle], upcastType2(aPart.dtype, bPart.dtype)); + }); + const complexOutput = complex6({ inputs: { real: real7, imag: imag7 }, backend: webglBackend }); + webglBackend.disposeIntermediateTensorInfo(real7); + webglBackend.disposeIntermediateTensorInfo(imag7); + return complexOutput; + } + const $dtype = dtype || upcastType2(a.dtype, b.dtype); + if ((a.dtype === "string" || b.dtype === "string" || webglBackend.shouldExecuteOnCPU([a, b])) && cpuKernelImpl != null) { + const aVals = webglBackend.texData.get(a.dataId).values; + const bVals = webglBackend.texData.get(b.dataId).values; + const decodedAVals = a.dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(aVals) : aVals; + const decodedBVals = a.dtype === "string" ? backend_util_exports2.fromUint8ToStringArray(bVals) : bVals; + const [outValues, outShape] = cpuKernelImpl(a.shape, b.shape, decodedAVals, decodedBVals, $dtype); + const out = webglBackend.makeTensorInfo(outShape, $dtype); + const outData = webglBackend.texData.get(out.dataId); + outData.values = outValues; + return out; + } + const shouldUsePackedProgram = env3().getBool("WEBGL_PACK_BINARY_OPERATIONS") && packedOpSnippet != null; + let program; + if (shouldUsePackedProgram) { + program = new BinaryOpPackedProgram2(packedOpSnippet, a.shape, b.shape, checkOutOfBounds); + } else { + program = new BinaryOpProgram2(opSnippet, a.shape, b.shape); + } + return webglBackend.runWebGLProgram(program, [a, b], $dtype); + }; +} +function mapActivationToShaderProgram2(activation2, packed = false) { + if (activation2 === "linear") { + if (packed) { + return LINEAR4; + } + return LINEAR3; + } else if (activation2 === "relu") { + if (packed) { + return RELU5; + } + return RELU4; + } else if (activation2 === "elu") { + if (packed) { + return ELU7; + } + return ELU6; + } else if (activation2 === "relu6") { + if (packed) { + return RELU65; + } + return RELU64; + } else if (activation2 === "prelu") { + if (packed) { + return PRELU_PACKED2; + } + return PRELU2; + } else if (activation2 === "leakyrelu") { + if (packed) { + return LEAKYRELU_PACKED2; + } + return LEAKYRELU2; + } else if (activation2 === "sigmoid") { + if (packed) { + return SIGMOID5; + } + return SIGMOID4; + } + throw new Error(`Activation ${activation2} has not been implemented for the WebGL backend.`); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/mulmat_packed_gpu.js +var MatMulPackedProgram2 = class { + constructor(aShape, bShape, outputShape, transposeA = false, transposeB = false, addBias = false, activation2 = null, hasPreluActivation = false, hasLeakyreluActivation = false) { + this.variableNames = ["matrixA", "matrixB"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + const sharedDim = transposeA ? aShape[1] : aShape[2]; + const sharedDimensionPacked = Math.ceil(sharedDim / 2); + const aSample = transposeA ? "i * 2, rc.y" : "rc.y, i * 2"; + const bSample = transposeB ? "rc.z, i * 2" : "i * 2, rc.z"; + const aSwizzle = transposeA ? ["a.xxyy", "a.zzww"] : ["a.xxzz", "a.yyww"]; + const bSwizzle = transposeB ? ["b.xzxz", "b.ywyw"] : ["b.xyxy", "b.zwzw"]; + let activationSnippet = "", applyActivationSnippet = ""; + if (activation2) { + if (hasPreluActivation) { + activationSnippet = `vec4 activation(vec4 a) { + vec4 b = getPreluActivationWeightsAtOutCoords(); + ${activation2} + }`; + } else if (hasLeakyreluActivation) { + activationSnippet = `vec4 activation(vec4 a) { + vec4 b = getLeakyreluAlphaAtOutCoords(); + ${activation2} + }`; + } else { + activationSnippet = `vec4 activation(vec4 x) { + ${activation2} + }`; + } + applyActivationSnippet = `result = activation(result);`; + } + const addBiasSnippet = addBias ? "result += getBiasAtOutCoords();" : ""; + if (addBias) { + this.variableNames.push("bias"); + } + if (hasPreluActivation) { + this.variableNames.push("preluActivationWeights"); + } + if (hasLeakyreluActivation) { + this.variableNames.push("leakyreluAlpha"); + } + let batchASnippet = "rc.x"; + let batchBSnippet = "rc.x"; + if (aShape[0] < bShape[0]) { + batchASnippet = `int(min(float(rc.x), ${aShape[0] - 1}.))`; + } else if (bShape[0] < aShape[0]) { + batchBSnippet = `int(min(float(rc.x), ${bShape[0] - 1}.))`; + } + this.userCode = ` + ${activationSnippet} + // Don't use uniform for sharedDimensionPacked for performance. + const float sharedDimension = ${sharedDimensionPacked}.0; + + vec4 dot2x2ARowBCol(ivec3 rc) { + vec4 result = vec4(0); + for (int i = 0; i < ${sharedDimensionPacked}; i++) { + int batchA = ${batchASnippet}; + int batchB = ${batchBSnippet}; + vec4 a = getMatrixA(batchA, ${aSample}); + vec4 b = getMatrixB(batchB, ${bSample}); + + // These swizzled products need to be separately added. + // See: https://github.com/tensorflow/tfjs/issues/1735 + result += (${aSwizzle[0]} * ${bSwizzle[0]}); + result += (${aSwizzle[1]} * ${bSwizzle[1]}); + } + return result; + } + + void main() { + ivec3 rc = getOutputCoords(); + vec4 result = dot2x2ARowBCol(rc); + + ${addBiasSnippet} + + ${applyActivationSnippet} + + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_complex_gpu.js +var COMPLEX_MULTIPLY2 = { + REAL: "return areal * breal - aimag * bimag;", + IMAG: "return areal * bimag + aimag * breal;" +}; +var BinaryOpComplexProgram2 = class { + constructor(op3, aShape, bShape) { + this.variableNames = ["AReal", "AImag", "BReal", "BImag"]; + this.outputShape = backend_util_exports2.assertAndGetBroadcastShape(aShape, bShape); + this.userCode = ` + float binaryOpComplex( + float areal, float aimag, float breal, float bimag) { + ${op3} + } + + void main() { + float areal = getARealAtOutCoords(); + float aimag = getAImagAtOutCoords(); + float breal = getBRealAtOutCoords(); + float bimag = getBImagAtOutCoords(); + setOutput(binaryOpComplex(areal, aimag, breal, bimag)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Multiply.js +var MUL2 = "return a * b;"; +function multiply5(args) { + const { inputs, backend: backend4 } = args; + const { a, b } = inputs; + const dtype = backend_util_exports2.upcastType(a.dtype, b.dtype); + if (a.dtype === "complex64") { + const aData = backend4.texData.get(a.dataId); + const bData = backend4.texData.get(b.dataId); + const realProgram = new BinaryOpComplexProgram2(COMPLEX_MULTIPLY2.REAL, a.shape, b.shape); + const imagProgram = new BinaryOpComplexProgram2(COMPLEX_MULTIPLY2.IMAG, a.shape, b.shape); + const inputs2 = [ + { + dataId: aData.complexTensorInfos.real.dataId, + dtype: aData.complexTensorInfos.real.dtype, + shape: a.shape + }, + { + dataId: aData.complexTensorInfos.imag.dataId, + dtype: aData.complexTensorInfos.imag.dtype, + shape: a.shape + }, + { + dataId: bData.complexTensorInfos.real.dataId, + dtype: bData.complexTensorInfos.real.dtype, + shape: b.shape + }, + { + dataId: bData.complexTensorInfos.imag.dataId, + dtype: bData.complexTensorInfos.imag.dtype, + shape: b.shape + } + ]; + const realPart = backend4.runWebGLProgram(realProgram, inputs2, "float32"); + const imagPart = backend4.runWebGLProgram(imagProgram, inputs2, "float32"); + const complexOutput = complex6({ inputs: { real: realPart, imag: imagPart }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(imagPart); + return complexOutput; + } + if (backend4.shouldExecuteOnCPU([a, b])) { + const aData = backend4.texData.get(a.dataId); + const bData = backend4.texData.get(b.dataId); + const [outValues, outShape] = multiplyImplCPU2(a.shape, b.shape, aData.values, bData.values, dtype); + const out = backend4.makeTensorInfo(outShape, dtype); + const outData = backend4.texData.get(out.dataId); + outData.values = outValues; + return out; + } + let program; + if (env3().getBool("WEBGL_PACK_BINARY_OPERATIONS")) { + program = new BinaryOpPackedProgram2(MUL2, a.shape, b.shape); + } else { + program = new BinaryOpProgram2(MUL2, a.shape, b.shape); + } + return backend4.runWebGLProgram(program, [a, b], dtype); +} +var multiplyConfig5 = { + kernelName: Multiply3, + backendName: "webgl", + kernelFunc: multiply5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/reshape.js +function packedReshape2(input3, afterShape, backend4) { + const input3DShape = [ + getBatchDim2(input3.shape), + ...getRowsCols2(input3.shape) + ]; + const input3D = { + dtype: input3.dtype, + shape: input3DShape, + dataId: input3.dataId + }; + const afterShapeAs3D = [ + getBatchDim2(afterShape), + ...getRowsCols2(afterShape) + ]; + const program = new ReshapePackedProgram2(afterShapeAs3D, input3DShape); + const preventEagerUnpackingOfOutput = true; + const customValues = [input3DShape]; + const output = backend4.runWebGLProgram(program, [input3D], input3.dtype, customValues, preventEagerUnpackingOfOutput); + return { dataId: output.dataId, shape: afterShape, dtype: output.dtype }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Reshape.js +function reshape8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { shape } = attrs; + const webglBackend = backend4; + const xSize = util_exports2.sizeFromShape(x.shape); + const $shape = util_exports2.inferFromImplicitShape(shape, xSize); + const $xSize = util_exports2.sizeFromShape($shape); + util_exports2.assert(xSize === $xSize, () => `The new shape (${$shape}) has ${$xSize} elements and the old shape (${x.shape}) has ${xSize} elements. The new shape and old shape must have the same number of elements.`); + const xTexData = webglBackend.texData.get(x.dataId); + if (xTexData.isPacked && !isReshapeFree2(x.shape, $shape) && !(xTexData.texture !== null && isReshapeFree2(xTexData.shape, $shape))) { + return packedReshape2(x, $shape, webglBackend); + } + webglBackend.incRef(x.dataId); + return { dataId: x.dataId, shape: $shape, dtype: x.dtype }; +} +var reshapeConfig5 = { + kernelName: Reshape3, + backendName: "webgl", + kernelFunc: reshape8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/mean_gpu.js +var MeanProgram2 = class { + constructor(reduceInfo, divisor) { + this.variableNames = ["x"]; + const { windowSize, batchSize, inSize, outSize } = reduceInfo; + this.outputShape = [batchSize, outSize]; + const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + const windowSizeVec4Remainder = windowSize % 4; + let updateSnippet = `sumValue += dot(values, ones);`; + if (divisor != null) { + const denominator = 1 / divisor; + updateSnippet = `sumValue += dot(values * ${util_exports2.isInt(denominator) ? denominator.toPrecision(2) : denominator}, ones);`; + } + let checkOutOfBounds = ""; + if (inSize % windowSize > 0) { + checkOutOfBounds = ` + if (inIdx < 0 || inIdx >= ${inSize}) { + return 0.0; + } + `; + } + this.userCode = ` + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float getValue(int batch, int inIdx) { + ${checkOutOfBounds} + return getX(batch, inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${windowSize}; + + float sumValue = 0.0; + + for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) { + int inIdx = inOffset + i; + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + ${updateSnippet} + } + + int inIdx = inOffset + ${windowSizeNearestVec4}; + if (${windowSizeVec4Remainder === 1}) { + vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 2}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), 0.0, 0.0); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 3}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), 0.0); + + ${updateSnippet} + } + setOutput(sumValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/reduce_gpu.js +var ReduceProgram2 = class { + constructor(reduceInfo, reduceType) { + this.variableNames = ["x"]; + const { windowSize, batchSize, inSize, outSize } = reduceInfo; + this.outputShape = [batchSize, outSize]; + let initializationValue = "0.0"; + let compareOp = ``; + if (reduceType === "prod") { + initializationValue = "1.0"; + } else if (reduceType === "min") { + initializationValue = "1.0 / 1e-20"; + compareOp = `min`; + } else if (reduceType === "max") { + initializationValue = "-1.0 / 1e-20"; + compareOp = `max`; + } + let returnValue = `${reduceType}(${reduceType}(${reduceType}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + if (reduceType === "sum") { + returnValue = `sumValue`; + } else if (reduceType === "prod") { + returnValue = `prodValue`; + } else if (reduceType === "all") { + returnValue = `allValue`; + } else if (reduceType === "any") { + returnValue = `anyValue`; + } + const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + const windowSizeVec4Remainder = windowSize % 4; + let updateSnippet = ` + if (${reduceType === "sum"}) { + sumValue += dot(values, ones); + } else if (${reduceType === "prod"}) { + vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); + prodValue *= tmp[0] * tmp[1]; + } else { + minMaxValue = ${compareOp}(values, minMaxValue); + if (${reduceType === "min"} || ${reduceType === "max"}) { + minMaxValue = ${compareOp}(values, minMaxValue); + bvec4 isNaN = isnan(values); + if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { + minMaxValue = vec4(NAN); + } + } + } + `; + let vecType = `vec4`; + if (reduceType === "all") { + initializationValue = "1.0"; + updateSnippet = ` + bool reducedAllValue = all(values); + float floatedReducedAllValue = float(reducedAllValue); + allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); + `; + vecType = `bvec4`; + } else if (reduceType === "any") { + initializationValue = "0.0"; + updateSnippet = ` + bool reducedAnyValue = any(values); + float floatedReducedAnyValue = float(reducedAnyValue); + anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); + `; + vecType = `bvec4`; + } + let checkOutOfBounds = ""; + if (inSize % windowSize > 0) { + checkOutOfBounds = ` + if (inIdx < 0 || inIdx >= ${inSize}) { + return initializationValue; + } + `; + } + this.userCode = ` + const float initializationValue = ${initializationValue}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float getValue(int batch, int inIdx) { + ${checkOutOfBounds} + return getX(batch, inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${windowSize}; + + vec4 minMaxValue = vec4(${initializationValue}); + float prodValue = 1.0; + float sumValue = 0.0; + float allValue = 1.0; + float anyValue = 0.0; + + for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) { + int inIdx = inOffset + i; + ${vecType} values = ${vecType}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + ${updateSnippet} + } + + int inIdx = inOffset + ${windowSizeNearestVec4}; + if (${windowSizeVec4Remainder === 1}) { + ${vecType} values = ${vecType}( + getValue(batch, inIdx), + initializationValue, + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 2}) { + ${vecType} values = ${vecType}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 3}) { + ${vecType} values = ${vecType}( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + initializationValue + ); + + ${updateSnippet} + } + setOutput(${returnValue}); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/reduce.js +function getReductionStages2(inShape) { + const stages = []; + while (stages.length === 0 || stages[stages.length - 1].outSize !== 1) { + const outSize = stages.length ? stages[stages.length - 1].outSize : inShape[1]; + const windowSize = backend_util_exports2.computeOptimalWindowSize(outSize); + stages.push({ + inSize: outSize, + windowSize, + outSize: Math.ceil(outSize / windowSize) + }); + } + return stages; +} +function reduce2(x, dtype, reductionType, backend4) { + const reductionStages = getReductionStages2(x.shape); + let result = x; + for (let i = 0; i < reductionStages.length; i++) { + const { inSize, windowSize, outSize } = reductionStages[i]; + let program; + let previousResult; + if (reductionType === "mean") { + program = i === 0 ? new MeanProgram2({ windowSize, inSize, batchSize: x.shape[0], outSize }, inSize) : new MeanProgram2({ windowSize, inSize, batchSize: x.shape[0], outSize }); + } else { + program = new ReduceProgram2({ windowSize, inSize, batchSize: x.shape[0], outSize }, reductionType); + } + previousResult = result; + result = backend4.runWebGLProgram(program, [result], dtype); + if (previousResult.dataId !== x.dataId) { + backend4.disposeIntermediateTensorInfo(previousResult); + } + } + return result; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/transpose_gpu.js +var TransposeProgram2 = class { + constructor(aShape, newDim) { + this.variableNames = ["A"]; + const outputShape = new Array(aShape.length); + for (let i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[newDim[i]]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + const dtype = getCoordsDataType2(this.rank); + const switched = getSwitchedCoords2(newDim); + this.userCode = ` + void main() { + ${dtype} resRC = getOutputCoords(); + setOutput(getA(${switched})); + } + `; + } +}; +function getSwitchedCoords2(newDim) { + const rank = newDim.length; + if (rank > 6) { + throw Error(`Transpose for rank ${rank} is not yet supported`); + } + const originalOrder = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u", "resRC.v"]; + const switchedCoords = new Array(rank); + for (let i = 0; i < newDim.length; i++) { + switchedCoords[newDim[i]] = originalOrder[i]; + } + return switchedCoords.join(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/transpose_packed_gpu.js +var TransposePackedProgram2 = class { + constructor(aShape, newDim) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + const outputShape = new Array(aShape.length); + for (let i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[newDim[i]]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + if (this.rank > 6) { + throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`); + } + const dtype = getCoordsDataType2(this.rank); + const outputOrder = getVecChannels2("rc", this.rank); + const switchedOrder = new Array(this.rank); + for (let i = 0; i < newDim.length; i++) { + switchedOrder[newDim[i]] = outputOrder[i]; + } + const innerDims = `vec2(${switchedOrder.slice(-2).join()})`; + const nextColumn = `++${outputOrder[this.rank - 1]} < ${outputShape[this.rank - 1]}`; + const getc = `getChannel(getA(${switchedOrder.join()}), ${innerDims})`; + this.userCode = ` + void main() { + ${dtype} rc = getOutputCoords(); + vec4 result = vec4(0.); + result[0] = ${getc}; + if(${nextColumn}) { + result[1] = ${getc}; + } + --${outputOrder[this.rank - 1]}; + if(++${outputOrder[this.rank - 2]} < ${outputShape[this.rank - 2]}) { + result[2] = ${getc}; + if(${nextColumn}) { + result[3] = ${getc}; + } + } + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Transpose_impl.js +function transposeImpl4(x, perm, backend4) { + const program = env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new TransposePackedProgram2(x.shape, perm) : new TransposeProgram2(x.shape, perm); + return backend4.runWebGLProgram(program, [x], x.dtype); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sum_impl.js +function sumImpl2(x, axis, keepDims, backend4) { + const reductionIndices = axis; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(reductionIndices, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + const sumInputIsTransposed = permutedAxes != null; + let sumInput = x; + if (sumInputIsTransposed) { + sumInput = transposeImpl4(x, permutedAxes, backend4); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("sum", axes, xRank); + const [sumOutShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(sumInput.shape, axes); + let outShape = sumOutShape; + if (keepDims) { + outShape = backend_util_exports2.expandShapeToKeepDim(sumOutShape, origAxes); + } + const inSize = util_exports2.sizeFromShape(reduceShape); + const xSize = util_exports2.sizeFromShape(x.shape); + const batchSize = xSize / inSize; + const reshapedInput = reshape8({ inputs: { x: sumInput }, attrs: { shape: [batchSize, inSize] }, backend: backend4 }); + const outType = sumOutType2(x.dtype); + const reduced = reduce2(reshapedInput, outType, "sum", backend4); + const out = reshape8({ inputs: { x: reduced }, attrs: { shape: outShape }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(reshapedInput); + backend4.disposeIntermediateTensorInfo(reduced); + if (sumInputIsTransposed) { + backend4.disposeIntermediateTensorInfo(sumInput); + } + return out; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sum.js +function sum9(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + return sumImpl2(x, axis, keepDims, backend4); +} +var sumConfig5 = { + kernelName: Sum2, + backendName: "webgl", + kernelFunc: sum9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Transpose.js +function transpose7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { perm } = attrs; + const webglBackend = backend4; + const xRank = x.shape.length; + const newShape = new Array(xRank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[perm[i]]; + } + let out; + if (webglBackend.shouldExecuteOnCPU([x])) { + const xTexData = webglBackend.texData.get(x.dataId); + const values = xTexData.values; + const outValues = transposeImplCPU2(values, x.shape, x.dtype, perm, newShape); + out = webglBackend.makeTensorInfo(newShape, x.dtype); + const outData = webglBackend.texData.get(out.dataId); + outData.values = outValues; + } else { + out = transposeImpl4(x, perm, webglBackend); + } + return out; +} +var transposeConfig5 = { + kernelName: Transpose2, + backendName: "webgl", + kernelFunc: transpose7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/BatchMatMul_impl.js +var MATMUL_SHARED_DIM_THRESHOLD2 = 1e3; +function batchMatMulImpl2({ a, b, transposeA, transposeB, backend: backend4, bias = null, preluActivationWeights = null, leakyreluAlpha = 0, activation: activation2 = null }) { + const aRank = a.shape.length; + const bRank = b.shape.length; + const innerShapeA = transposeA ? a.shape[aRank - 2] : a.shape[aRank - 1]; + const innerShapeB = transposeB ? b.shape[bRank - 1] : b.shape[bRank - 2]; + const outerShapeA = transposeA ? a.shape[aRank - 1] : a.shape[aRank - 2]; + const outerShapeB = transposeB ? b.shape[bRank - 2] : b.shape[bRank - 1]; + const outerDimsA = a.shape.slice(0, -2); + const outerDimsB = b.shape.slice(0, -2); + const batchDimA = util_exports2.sizeFromShape(outerDimsA); + const batchDimB = util_exports2.sizeFromShape(outerDimsB); + const batchDimsCompatible = batchDimA === batchDimB || batchDimA === 1 || batchDimB === 1; + util_exports2.assert(aRank >= 2 && bRank >= 2 && batchDimsCompatible, () => `Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${outerDimsA}) and (${outerDimsB}).`); + const outShapeOuterDims = batchDimA > batchDimB ? a.shape.slice(0, -2) : b.shape.slice(0, -2); + const outShape = outShapeOuterDims.concat([outerShapeA, outerShapeB]); + util_exports2.assert(innerShapeA === innerShapeB, () => `Error in matMul: inner shapes (${innerShapeA}) and (${innerShapeB}) of Tensors with shapes ${a.shape} and ${b.shape} and transposeA=${transposeA} and transposeB=${transposeB} must match.`); + const a3dShape = transposeA ? [batchDimA, innerShapeA, outerShapeA] : [batchDimA, outerShapeA, innerShapeA]; + const b3dShape = transposeB ? [batchDimB, outerShapeB, innerShapeB] : [batchDimB, innerShapeB, outerShapeB]; + const a3d = reshape8({ inputs: { x: a }, backend: backend4, attrs: { shape: a3dShape } }); + const b3d = reshape8({ inputs: { x: b }, backend: backend4, attrs: { shape: b3dShape } }); + const intermediates = [a3d, b3d]; + const batchDim = Math.max(batchDimA, batchDimB); + const sharedDim = transposeA ? a3d.shape[1] : a3d.shape[2]; + const hasBias = bias != null; + const hasPreluActivationWeights = preluActivationWeights != null; + const hasLeakyreluAlpha = activation2 === "leakyrelu"; + const fusedActivation = activation2 != null ? mapActivationToShaderProgram2(activation2, true) : null; + const containsFusedOps = hasBias || hasPreluActivationWeights || hasLeakyreluAlpha || fusedActivation != null; + let out; + if ((outerShapeA === 1 || outerShapeB === 1) && sharedDim > MATMUL_SHARED_DIM_THRESHOLD2 && containsFusedOps === false) { + let aVec = a3d; + let bVec = b3d; + if (transposeA) { + aVec = transpose7({ inputs: { x: a3d }, backend: backend4, attrs: { perm: [0, 2, 1] } }); + intermediates.push(aVec); + } + if (transposeB) { + bVec = transpose7({ inputs: { x: b3d }, backend: backend4, attrs: { perm: [0, 2, 1] } }); + intermediates.push(bVec); + } + const shouldReshapeA = outerShapeB !== 1; + const shouldReshapeB = outerShapeB === 1; + let aVec3d = aVec; + if (shouldReshapeA) { + aVec3d = reshape8({ + inputs: { x: aVec }, + backend: backend4, + attrs: { shape: [batchDim, sharedDim, 1] } + }); + intermediates.push(aVec3d); + } + const axis = outerShapeB === 1 ? 2 : 1; + let bVec3d = bVec; + if (shouldReshapeB) { + bVec3d = reshape8({ + inputs: { x: bVec }, + backend: backend4, + attrs: { shape: [batchDim, 1, sharedDim] } + }); + intermediates.push(bVec3d); + } + const product = multiply5({ inputs: { a: aVec3d, b: bVec3d }, backend: backend4 }); + out = sum9({ inputs: { x: product }, backend: backend4, attrs: { axis, keepDims: true } }); + intermediates.push(product); + } else { + const dtype = upcastType2(a.dtype, b.dtype); + const program = new MatMulPackedProgram2(a3dShape, b3dShape, [batchDim, outerShapeA, outerShapeB], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights, hasLeakyreluAlpha); + const inputs = [a3d, b3d]; + if (bias != null) { + inputs.push(bias); + } + if (hasPreluActivationWeights) { + inputs.push(preluActivationWeights); + } + if (hasLeakyreluAlpha) { + const $leakyreluAlpha = backend4.makeTensorInfo([], "float32", util_exports2.createScalarValue(leakyreluAlpha, "float32")); + inputs.push($leakyreluAlpha); + intermediates.push($leakyreluAlpha); + } + out = backend4.runWebGLProgram(program, inputs, dtype); + } + const outReshaped = reshape8({ inputs: { x: out }, backend: backend4, attrs: { shape: outShape } }); + intermediates.push(out); + for (const i of intermediates) { + backend4.disposeIntermediateTensorInfo(i); + } + return outReshaped; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/_FusedMatMul.js +function _fusedMatMul4(args) { + const { inputs, backend: backend4, attrs } = args; + const { a, b, bias, preluActivationWeights } = inputs; + const { transposeA, transposeB, activation: activation2, leakyreluAlpha } = attrs; + return batchMatMulImpl2({ + a, + b, + transposeA, + transposeB, + backend: backend4, + bias, + preluActivationWeights, + leakyreluAlpha, + activation: activation2 + }); +} +var _fusedMatMulConfig4 = { + kernelName: _FusedMatMul2, + backendName: "webgl", + kernelFunc: _fusedMatMul4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Abs.js +var ABS4 = `return abs(x);`; +function abs6(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (backend4.shouldExecuteOnCPU([x]) && x.dtype !== "complex64") { + const xData = backend4.texData.get(x.dataId); + const outValues = simpleAbsImplCPU2(xData.values); + return backend4.makeTensorInfo(x.shape, x.dtype, outValues); + } + let program; + if (env3().getBool("WEBGL_PACK_UNARY_OPERATIONS")) { + program = new UnaryOpPackedProgram2(x.shape, ABS4); + } else { + program = new UnaryOpProgram2(x.shape, ABS4); + } + return backend4.runWebGLProgram(program, [x], x.dtype); +} +var absConfig5 = { + kernelName: Abs2, + backendName: "webgl", + kernelFunc: abs6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Acos.js +var ACOS2 = CHECK_NAN_SNIPPET4 + ` + if (abs(x) > 1.) { + return NAN; + } + return acos(x); +`; +var acos6 = unaryKernelFunc4({ opSnippet: ACOS2 }); +var acosConfig4 = { + kernelName: Acos2, + backendName: "webgl", + kernelFunc: acos6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Acosh.js +var ACOSH2 = CHECK_NAN_SNIPPET4 + ` + if (x < 1.0) return NAN; +return log(x + sqrt(x * x - 1.0));`; +var acosh6 = unaryKernelFunc4({ opSnippet: ACOSH2 }); +var acoshConfig4 = { + kernelName: Acosh2, + backendName: "webgl", + kernelFunc: acosh6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Add.js +var ADD2 = "return a + b;"; +var addKernelFunc2 = binaryKernelFunc4({ + opSnippet: ADD2, + packedOpSnippet: ADD2, + supportsComplex: true, + cpuKernelImpl: addImplCPU2 +}); +var addConfig5 = { + kernelName: Add3, + backendName: "webgl", + kernelFunc: addKernelFunc2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/addn_gpu.js +var AddNProgram2 = class { + constructor(outputShape, shapes) { + this.outputShape = []; + this.outputShape = outputShape; + this.variableNames = shapes.map((_, i) => `T${i}`); + const snippets = []; + this.variableNames.forEach((variable3) => { + snippets.push(`float v${variable3} = get${variable3}AtOutCoords();`); + }); + const operation = this.variableNames.map((variable3) => { + return `v${variable3}`; + }).join(" + "); + this.userCode = ` + void main() { + ${snippets.join("\n ")} + + float result = ${operation}; + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/addn_packed_gpu.js +var AddNPackedProgram2 = class { + constructor(outputShape, shapes) { + this.outputShape = []; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = outputShape; + this.variableNames = shapes.map((_, i) => `T${i}`); + const snippets = []; + this.variableNames.forEach((variable3) => { + snippets.push(`vec4 v${variable3} = get${variable3}AtOutCoords();`); + }); + const operation = this.variableNames.map((variable3) => { + return `v${variable3}`; + }).join(" + "); + this.userCode = ` + void main() { + ${snippets.join("\n ")} + + vec4 result = ${operation}; + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/AddN.js +function addN6(args) { + const { inputs, backend: backend4 } = args; + const tensors = inputs; + if (tensors.length === 1) { + return identity6({ inputs: { x: tensors[0] }, backend: backend4 }); + } + if (tensors.length > env3().get("WEBGL_MAX_TEXTURES_IN_SHADER")) { + const midIndex = Math.floor(tensors.length / 2); + const leftSide = addN6({ inputs: tensors.slice(0, midIndex), backend: backend4 }); + const rightSide = addN6({ inputs: tensors.slice(midIndex), backend: backend4 }); + return addN6({ inputs: [leftSide, rightSide], backend: backend4 }); + } + const dtype = tensors.map((t) => t.dtype).reduce((d1, d2) => upcastType2(d1, d2)); + const shapes = tensors.map((t) => t.shape); + const usePackedOp = env3().getBool("WEBGL_PACK"); + const program = usePackedOp ? new AddNPackedProgram2(tensors[0].shape, shapes) : new AddNProgram2(tensors[0].shape, shapes); + return backend4.runWebGLProgram(program, tensors, dtype); +} +var addNConfig5 = { + kernelName: AddN2, + backendName: "webgl", + kernelFunc: addN6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/All.js +function all7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + let permutedX = x; + if (permutedAxes != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("all", axes, xRank); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(permutedX.shape, axes); + const inSize = util_exports2.sizeFromShape(reduceShape); + const a2D = reshape8({ inputs: { x: permutedX }, backend: backend4, attrs: { shape: [-1, inSize] } }); + const reduced = reduce2(a2D, a2D.dtype, "all", backend4); + let res; + if (keepDims) { + const newShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: newShape } }); + } else { + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: outShape } }); + } + backend4.disposeIntermediateTensorInfo(a2D); + backend4.disposeIntermediateTensorInfo(reduced); + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo(permutedX); + } + return res; +} +var allConfig5 = { + kernelName: All2, + backendName: "webgl", + kernelFunc: all7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Any.js +function any7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + let permutedX = x; + if (permutedAxes != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("any", axes, xRank); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(permutedX.shape, axes); + const inSize = util_exports2.sizeFromShape(reduceShape); + const a2D = reshape8({ inputs: { x: permutedX }, backend: backend4, attrs: { shape: [-1, inSize] } }); + const reduced = reduce2(a2D, a2D.dtype, "any", backend4); + let res; + if (keepDims) { + const newShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: newShape } }); + } else { + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: outShape } }); + } + backend4.disposeIntermediateTensorInfo(a2D); + backend4.disposeIntermediateTensorInfo(reduced); + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo(permutedX); + } + return res; +} +var anyConfig5 = { + kernelName: Any2, + backendName: "webgl", + kernelFunc: any7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/argminmax_gpu.js +var ArgMinMaxProgram2 = class { + constructor(reduceInfo, op3, firstPass) { + this.variableNames = ["A"]; + const { windowSize, batchSize, outSize } = reduceInfo; + if (!firstPass) { + this.variableNames.push("bestIndicesA"); + } + this.outputShape = [batchSize, outSize]; + const compOp = op3 === "max" ? ">" : "<"; + const indexSnippet = firstPass ? "inOffset + i;" : "round(getBestIndicesA(batch, inOffset + i));"; + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = outIdx * ${windowSize}; + + int bestIndex = inOffset; + float bestValue = getA(batch, bestIndex); + + for (int i = 0; i < ${windowSize}; i++) { + int inIdx = ${indexSnippet}; + float candidate = getA(batch, inIdx); + if (candidate ${compOp} bestValue) { + bestValue = candidate; + bestIndex = inIdx; + } + } + setOutput(float(bestIndex)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/argminmax_packed_gpu.js +var ArgMinMaxPackedProgram2 = class { + constructor(shape, windowSize, op3, firstPass) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + util_exports2.assert(shape.length > 2, () => `Packed arg${op3.charAt(0).toUpperCase() + op3.slice(1)} supports only inputs with rank above 2.`); + const inSize = shape[shape.length - 1]; + const outSize = Math.ceil(inSize / windowSize); + this.outputShape = shape.slice(0, -1); + if (outSize > 1) { + this.outputShape.push(outSize); + } + if (!firstPass) { + this.variableNames.push("bestIndicesA"); + } + const outShape = this.outputShape; + const rank = outShape.length; + const dtype = getCoordsDataType2(rank); + const coords9 = getChannels2("coords", rank); + let sourceLocSetup; + let sourceRank; + if (outSize === 1) { + sourceRank = rank + 1; + const sourceLocDType = getCoordsDataType2(sourceRank); + sourceLocSetup = ` + ${sourceLocDType} sourceLocR = ${sourceLocDType}(${coords9.join()}, 0); + ++${coords9[rank - 1]}; + ${sourceLocDType} sourceLocG = ${sourceLocDType}(${coords9.join()}, 0); + ++${coords9[rank - 2]}; + ${sourceLocDType} sourceLocA = ${sourceLocDType}(${coords9.join()}, 0); + --${coords9[rank - 1]}; + ${sourceLocDType} sourceLocB = ${sourceLocDType}(${coords9.join()}, 0); + --${coords9[rank - 2]};`; + } else { + sourceRank = rank; + sourceLocSetup = ` + ${dtype} sourceLocR = coords; + ++${coords9[rank - 1]}; + ${dtype} sourceLocG = coords; + ++${coords9[rank - 2]}; + ${dtype} sourceLocA = coords; + --${coords9[rank - 1]}; + ${dtype} sourceLocB = coords; + --${coords9[rank - 2]};`; + } + const channels = ["x", "y", "z", "w", "u", "v"].slice(0, sourceRank); + const inChannel = "." + channels[sourceRank - 1]; + const intChannels = channels.map((x) => "int " + x); + const srcRCoords = getChannels2("sourceLocR", sourceRank - 1).concat("inIdx.r"); + const srcGCoords = getChannels2("sourceLocG", sourceRank - 1).concat("inIdx.g"); + const srcBCoords = getChannels2("sourceLocB", sourceRank - 1).concat("inIdx.b"); + const srcACoords = getChannels2("sourceLocA", sourceRank - 1).concat("inIdx.a"); + const compOp = op3 === "max" ? "greaterThan" : "lessThan"; + const fetchCandidateIdx = firstPass ? "" : ` + inIdx = round(vec4(getBestIndicesAChannel(${srcRCoords.join()}), + getBestIndicesAChannel(${srcGCoords.join()}), + getBestIndicesAChannel(${srcBCoords.join()}), + getBestIndicesAChannel(${srcACoords.join()})));`; + const fetchValue = `vec4( + getAChannel(${srcRCoords.join()}), + hasNextCol ? getAChannel(${srcGCoords.join()}) : 0., + hasNextRow ? getAChannel(${srcBCoords.join()}) : 0., + hasNextRow && hasNextCol ? getAChannel(${srcACoords.join()}) : 0.)`; + const getBestIndicesAChannelSnippet = firstPass ? "" : ` + float getBestIndicesAChannel(${intChannels.join()}) { + return getChannel(getBestIndicesA(${channels.join()}), + vec2(${channels.slice(-2).join()})); + }`; + this.userCode = ` + float getAChannel(${intChannels.join()}) { + return getChannel(getA(${channels.join()}), + vec2(${channels.slice(-2).join()})); + } + ${getBestIndicesAChannelSnippet} + void main() { + ${dtype} coords = getOutputCoords(); + bool hasNextCol = ${coords9[rank - 1]} < ${outShape[rank - 1] - 1}; + bool hasNextRow = ${coords9[rank - 2]} < ${outShape[rank - 2] - 1}; + ${sourceLocSetup} + ivec4 srcIdx = ivec4(sourceLocR${inChannel}, sourceLocG${inChannel}, + sourceLocB${inChannel}, sourceLocA${inChannel}) * ${windowSize}; + ivec4 inIdx = srcIdx; + vec4 bestIndex = vec4(inIdx); + vec4 bestValue = ${fetchValue}; + + for (int i = 0; i < ${windowSize}; i++) { + inIdx = srcIdx; + ${fetchCandidateIdx} + vec4 candidate = ${fetchValue}; + bvec4 nan = isnan(candidate); + bvec4 replace = bvec4( + vec4(${compOp}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); + + bestValue = vec4(replace.x ? candidate.x : bestValue.x, + replace.y ? candidate.y : bestValue.y, + replace.z ? candidate.z : bestValue.z, + replace.w ? candidate.w : bestValue.w); + bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace)); + srcIdx++; + } + setOutput(bestIndex); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/arg_min_max.js +function argReduce2(backend4, x, reduceType, bestIndicesA = null) { + let batchSize = x.shape[0]; + let inSize = x.shape[1]; + if (bestIndicesA != null) { + batchSize = bestIndicesA.shape[0]; + inSize = bestIndicesA.shape[1]; + } + const windowSize = backend_util_exports2.computeOptimalWindowSize(inSize); + const reduceInfo = { windowSize, inSize, batchSize, outSize: Math.ceil(inSize / windowSize) }; + const program = new ArgMinMaxProgram2(reduceInfo, reduceType, bestIndicesA == null); + const inputs = [x]; + if (bestIndicesA != null) { + inputs.push(bestIndicesA); + } + const output = backend4.runWebGLProgram(program, inputs, "int32"); + if (output.shape[1] === 1) { + return output; + } + const result = argReduce2(backend4, x, reduceType, output); + backend4.disposeIntermediateTensorInfo(output); + return result; +} +function argReducePacked2(backend4, x, reduceType, bestIndicesA = null) { + const inShape = bestIndicesA != null ? bestIndicesA.shape : x.shape; + const inSize = inShape[inShape.length - 1]; + const windowSize = backend_util_exports2.computeOptimalWindowSize(inSize); + const program = new ArgMinMaxPackedProgram2(inShape, windowSize, reduceType, bestIndicesA == null); + const inputs = bestIndicesA == null ? [x] : [x, bestIndicesA]; + const output = backend4.runWebGLProgram(program, inputs, "int32"); + if (output.shape.length === x.shape.length) { + const result = argReducePacked2(backend4, x, reduceType, output); + backend4.disposeIntermediateTensorInfo(output); + return result; + } + return output; +} +function argMinMaxReduce2(backend4, x, axis, reduceType) { + const axes = [axis]; + backend_util_exports2.assertAxesAreInnerMostDims("arg" + reduceType.charAt(0).toUpperCase() + reduceType.slice(1), axes, x.shape.length); + if (!env3().getBool("WEBGL_PACK_REDUCE") || x.shape.length <= 2) { + const intermediateTensorInfos = []; + const xtexData = backend4.texData.get(x.dataId); + const xIsPacked = xtexData !== null && xtexData.isPacked; + let xUnPacked = x; + if (xIsPacked) { + xUnPacked = backend4.unpackTensor(x); + intermediateTensorInfos.push(xUnPacked); + } + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(xUnPacked.shape, axes); + const inSize = util_exports2.sizeFromShape(reduceShape); + const a2D = reshape8({ inputs: { x: xUnPacked }, backend: backend4, attrs: { shape: [-1, inSize] } }); + intermediateTensorInfos.push(a2D); + const reduced = argReduce2(backend4, a2D, reduceType); + intermediateTensorInfos.push(reduced); + const reshaped = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: outShape } }); + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return reshaped; + } + return argReducePacked2(backend4, x, reduceType); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ArgMax.js +function argMax6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis } = attrs; + let axes = util_exports2.parseAxisParam(axis, x.shape); + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + const intermediateTensorInfos = []; + if (permutedAxes != null) { + $x = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + intermediateTensorInfos.push($x); + axes = backend_util_exports2.getInnerMostAxes(axes.length, $x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("argMax", [axes[0]], $x.shape.length); + const out = argMinMaxReduce2(backend4, $x, axes[0], "max"); + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return out; +} +var argMaxConfig5 = { + kernelName: ArgMax2, + backendName: "webgl", + kernelFunc: argMax6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ArgMin.js +function argMin6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis } = attrs; + let axes = util_exports2.parseAxisParam(axis, x.shape); + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, x.shape.length); + let $x = x; + const intermediateTensorInfos = []; + if (permutedAxes != null) { + $x = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + intermediateTensorInfos.push($x); + axes = backend_util_exports2.getInnerMostAxes(axes.length, $x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("argMin", [axes[0]], $x.shape.length); + const out = argMinMaxReduce2(backend4, $x, axes[0], "min"); + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return out; +} +var argMinConfig4 = { + kernelName: ArgMin2, + backendName: "webgl", + kernelFunc: argMin6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Asin.js +var ASIN2 = CHECK_NAN_SNIPPET4 + ` + if (abs(x) > 1.) { + return NAN; + } + return asin(x); +`; +var asin6 = unaryKernelFunc4({ opSnippet: ASIN2 }); +var asinConfig4 = { + kernelName: Asin2, + backendName: "webgl", + kernelFunc: asin6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Asinh.js +var ASINH2 = CHECK_NAN_SNIPPET4 + `return log(x + sqrt(x * x + 1.0));`; +var asinh6 = unaryKernelFunc4({ opSnippet: ASINH2 }); +var asinhConfig4 = { + kernelName: Asinh2, + backendName: "webgl", + kernelFunc: asinh6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Atan.js +var ATAN3 = CHECK_NAN_SNIPPET4 + ` + return atan(x); +`; +var atan7 = unaryKernelFunc4({ opSnippet: ATAN3 }); +var atanConfig4 = { + kernelName: Atan3, + backendName: "webgl", + kernelFunc: atan7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Atan2.js +var ATAN22 = CHECK_NAN_SNIPPET_BINARY2 + ` + return atan(a, b); +`; +var ATAN2_PACKED2 = ` + vec4 result = atan(a, b); + vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); + ` + CHECK_NAN_SNIPPET_BINARY_PACKED2 + ` + return result; +`; +var atan26 = binaryKernelFunc4({ opSnippet: ATAN22, packedOpSnippet: ATAN2_PACKED2 }); +var atan2Config4 = { + kernelName: Atan22, + backendName: "webgl", + kernelFunc: atan26 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Atanh.js +var ATANH2 = CHECK_NAN_SNIPPET4 + ` + if ((x < -1.0) || (x > 1.0)) return NAN; +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`; +var atanh6 = unaryKernelFunc4({ opSnippet: ATANH2 }); +var atanhConfig4 = { + kernelName: Atanh2, + backendName: "webgl", + kernelFunc: atanh6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/pool_gpu.js +var Pool2DProgram2 = class { + constructor(convInfo, poolType, computePositions, flattenPositions = false, includeBatchInIndex = false) { + this.variableNames = ["x"]; + if (poolType === "avg" && computePositions) { + throw new Error("Cannot compute positions for average pool."); + } + const filterWidth = convInfo.filterWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + this.outputShape = convInfo.outShape; + const isAvgPool = poolType === "avg"; + const batchFlattenPositionStr = `((batch * ${convInfo.inHeight} + xR) * ${convInfo.inWidth} + xC) * ${convInfo.inChannels} + d`; + const flattenPositionStr = `(xR * ${convInfo.inWidth} + xC) * ${convInfo.inChannels} + d`; + let initializationValue = "0.0"; + if (!isAvgPool) { + initializationValue = "-1.0 / 1e-20"; + } + if (computePositions) { + const compareOp2 = ">="; + this.userCode = ` + const ivec2 strides = ivec2(${strideHeight}, ${strideWidth}); + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d = coords[3]; + + ivec2 xRCCorner = coords.yz * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // max/min x(?, ?, d) to get y(yR, yC, d). + // ? = to be determined + float minMaxValue = 0.0; + float minMaxValueFound = 0.0; + int minMaxPosition = 0; + float avgValue = 0.0; + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${effectiveFilterWidth}; + wC += ${dilationWidth}) { + int xC = xCCorner + wC; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + float value = getX(batch, xR, xC, d); + + // If a min / max value has already been found, use it. If not, + // use the current value. + float currMinMaxValue = mix( + value, minMaxValue, minMaxValueFound); + if (value ${compareOp2} currMinMaxValue) { + minMaxValue = value; + minMaxValueFound = 1.0; + minMaxPosition = ${flattenPositions ? includeBatchInIndex ? batchFlattenPositionStr : flattenPositionStr : `wR * ${effectiveFilterWidth} + wC`}; + } + } + } + setOutput(float(minMaxPosition)); + } + `; + return; + } + const compareOp = "max"; + let returnValue = `${poolType}(${poolType}(${poolType}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + if (poolType === "avg") { + returnValue = `avgValue / count`; + } + const filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4; + const filterWidthVec4Remainder = filterWidth % 4; + const updateSnippet = ` + if (${isAvgPool}) { + avgValue += dot(values, ones); + } else { + minMaxValue = ${compareOp}(values, minMaxValue); + } + `; + this.userCode = ` + const ivec2 strides = ivec2(${strideHeight}, ${strideWidth}); + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + const float initializationValue = ${initializationValue}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float count = 0.0; + + float getValue(int batch, int xR, int xC, int d) { + if (xC < 0 || xC >= ${convInfo.inWidth}) { + return initializationValue; + } + count += 1.0; + return getX(batch, xR, xC, d); + } + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d = coords[3]; + + ivec2 xRCCorner = coords.yz * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // max/min x(?, ?, d) to get y(yR, yC, d). + // ? = to be determined + vec4 minMaxValue = vec4(${initializationValue}); + float avgValue = 0.0; + count = 0.0; + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${filterWidthNearestVec4}; wC += 4) { + int xC = xCCorner + wC * ${dilationWidth}; + + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${dilationWidth}, d), + getValue(batch, xR, xC + 2 * ${dilationWidth}, d), + getValue(batch, xR, xC + 3 * ${dilationWidth}, d) + ); + + ${updateSnippet} + } + + int xC = xCCorner + ${filterWidthNearestVec4}; + if (${filterWidthVec4Remainder === 1}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + initializationValue, + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${filterWidthVec4Remainder === 2}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${dilationWidth}, d), + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${filterWidthVec4Remainder === 3}) { + vec4 values = vec4( + getValue(batch, xR, xC, d), + getValue(batch, xR, xC + ${dilationWidth}, d), + getValue(batch, xR, xC + 2 * ${dilationWidth}, d), + initializationValue + ); + + ${updateSnippet} + } + } + setOutput(${returnValue}); + } + `; + } +}; +var Pool3DProgram2 = class { + constructor(convInfo, poolType, computePositions, flattenPositions = false, includeBatchInIndex = false) { + this.variableNames = ["x"]; + if (poolType === "avg" && computePositions) { + throw new Error("Cannot compute positions for average pool."); + } + const filterWidth = convInfo.filterWidth; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = convInfo.padInfo.front; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + this.outputShape = convInfo.outShape; + const isAvgPool = poolType === "avg"; + let initializationValue = "0.0"; + if (!isAvgPool) { + initializationValue = "-1.0 / 1e-20"; + } + if (computePositions) { + const compareOp2 = ">="; + this.userCode = ` + const ivec3 strides = + ivec3(${strideDepth}, ${strideHeight}, ${strideWidth}); + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xDCorner = xCorner.x; + int xRCorner = xCorner.y; + int xCCorner = xCorner.z; + + // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch). + // ? = to be determined + float minMaxValue = 0.0; + float minMaxValueFound = 0.0; + int minMaxPosition = 0; + + for (int wD = 0; wD < ${effectiveFilterDepth}; + wD += ${dilationDepth}) { + int xD = xDCorner + wD; + + if (xD < 0 || xD >= ${convInfo.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${effectiveFilterWidth}; + wC += ${dilationWidth}) { + int xC = xCCorner + wC; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + float value = getX(batch, xD, xR, xC, ch); + + // If a min / max value has already been found, use it. If not, + // use the current value. + float currMinMaxValue = mix( + value, minMaxValue, minMaxValueFound); + if (value ${compareOp2} currMinMaxValue) { + minMaxValue = value; + minMaxValueFound = 1.0; + minMaxPosition = ${flattenPositions ? includeBatchInIndex ? `(((batch * ${convInfo.inDepth} + xD) * ${convInfo.inHeight} + xR) * ${convInfo.inWidth} + xC) * ${convInfo.inChannels} + ch` : `((xD * ${convInfo.inHeight} + xR) * ${convInfo.inWidth} + xC) * ${convInfo.inChannels} + ch` : `wD * ${effectiveFilterHeight} * ${effectiveFilterWidth} + + wR * ${effectiveFilterWidth} + wC`}; + } + } + } + } + setOutput(float(minMaxPosition)); + } + `; + return; + } + const compareOp = "max"; + let returnValue = `${poolType}(${poolType}(${poolType}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + if (poolType === "avg") { + returnValue = `avgValue / count`; + } + const filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4; + const filterWidthVec4Remainder = filterWidth % 4; + const updateSnippet = ` + if (${isAvgPool}) { + avgValue += dot(values, ones); + } else { + minMaxValue = ${compareOp}(values, minMaxValue); + } + `; + this.userCode = ` + const ivec3 strides = + ivec3(${strideDepth}, ${strideHeight}, ${strideWidth}); + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + const float initializationValue = ${initializationValue}; + const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); + + float count = 0.0; + + float getValue(int batch, int xD, int xR, int xC, int ch) { + if (xC < 0 || xC >= ${convInfo.inWidth}) { + return initializationValue; + } + count += 1.0; + return getX(batch, xD, xR, xC, ch); + } + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xDCorner = xCorner.x; + int xRCorner = xCorner.y; + int xCCorner = xCorner.z; + + // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch). + // ? = to be determined + vec4 minMaxValue = vec4(${initializationValue}); + float avgValue = 0.0; + count = 0.0; + + for (int wD = 0; wD < ${effectiveFilterDepth}; + wD += ${dilationDepth}) { + int xD = xDCorner + wD; + + if (xD < 0 || xD >= ${convInfo.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + int xR = xRCorner + wR; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${filterWidthNearestVec4}; wC += 4) { + int xC = xCCorner + wC * ${dilationWidth}; + + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${dilationWidth}, ch), + getValue(batch, xD, xR, xC + 2 * ${dilationWidth}, ch), + getValue(batch, xD, xR, xC + 3 * ${dilationWidth}, ch) + ); + + ${updateSnippet} + } + + int xC = xCCorner + ${filterWidthNearestVec4}; + if (${filterWidthVec4Remainder === 1}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + initializationValue, + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${filterWidthVec4Remainder === 2}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${dilationWidth}, ch), + initializationValue, + initializationValue + ); + + ${updateSnippet} + } else if (${filterWidthVec4Remainder === 3}) { + vec4 values = vec4( + getValue(batch, xD, xR, xC, ch), + getValue(batch, xD, xR, xC + ${dilationWidth}, ch), + getValue(batch, xD, xR, xC + 2 * ${dilationWidth}, ch), + initializationValue + ); + + ${updateSnippet} + } + } + setOutput(${returnValue}); + } + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/AvgPool.js +function avgPool7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + assertNotComplex4(x, "avgPool"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = 1; + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports2.arraysEqual(convInfo.inShape, convInfo.outShape)) { + return identity6({ inputs: { x }, backend: backend4 }); + } + const avgPoolProgram = new Pool2DProgram2(convInfo, "avg", false); + return backend4.runWebGLProgram(avgPoolProgram, [x], "float32"); +} +var avgPoolConfig5 = { + kernelName: AvgPool2, + backendName: "webgl", + kernelFunc: avgPool7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/AvgPool3D.js +function avgPool3D4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { filterSize, strides, pad: pad4, dimRoundingMode, dataFormat } = attrs; + const dilations = [1, 1, 1]; + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode, dataFormat); + const avgPoolProgram = new Pool3DProgram2(convInfo, "avg", false); + return backend4.runWebGLProgram(avgPoolProgram, [x], "float32"); +} +var avgPool3DConfig4 = { + kernelName: AvgPool3D2, + backendName: "webgl", + kernelFunc: avgPool3D4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/avg_pool_backprop_gpu.js +var AvgPool2DBackpropProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy"]; + this.outputShape = convInfo.inShape; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const avgMultiplier = 1 / (filterHeight * filterWidth); + this.userCode = ` + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + const float avgMultiplier = float(${avgMultiplier}); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + + ivec2 dyRCCorner = coords.yz - pads; + int dyRCorner = dyRCCorner.x; + int dyCCorner = dyRCCorner.y; + + // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${effectiveFilterWidth}; + wC+= ${dilationWidth}) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(b, idyR, idyC, d); + + dotProd += dyValue * avgMultiplier; + } + } + setOutput(dotProd); + } + `; + } +}; +var AvgPool3DBackpropProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy"]; + this.outputShape = convInfo.inShape; + const filterDepth = convInfo.filterDepth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const avgMultiplier = 1 / (filterDepth * filterHeight * filterWidth); + this.userCode = ` + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + const float avgMultiplier = float(${avgMultiplier}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyDCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get + // dx(xD, xR, xC, ch). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int wD = 0; wD < ${effectiveFilterDepth}; + wD += ${dilationDepth}) { + float dyD = float(dyDCorner + wD) / ${strideDepth}.0; + + if (dyD < 0.0 || dyD >= ${convInfo.outDepth}.0 || fract(dyD) > 0.0) { + continue; + } + int idyD = int(dyD); + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${effectiveFilterWidth}; + wC += ${dilationWidth}) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(batch, idyD, idyR, idyC, ch); + + dotProd += dyValue * avgMultiplier; + } + } + } + setOutput(dotProd); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/AvgPool3DGrad.js +function avgPool3DGrad4(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const x = input3; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = [1, 1, 1]; + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + const avgPoolBackpropProgram = new AvgPool3DBackpropProgram2(convInfo); + return backend4.runWebGLProgram(avgPoolBackpropProgram, [dy], x.dtype); +} +var avgPoolGrad3DConfig2 = { + kernelName: AvgPool3DGrad2, + backendName: "webgl", + kernelFunc: avgPool3DGrad4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/AvgPoolGrad.js +function avgPoolGrad6(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const x = input3; + assertNotComplex4([dy, input3], "avgPoolGrad"); + const { filterSize, strides, pad: pad4 } = attrs; + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, 1, pad4); + const avgPoolBackpropProgram = new AvgPool2DBackpropProgram2(convInfo); + return backend4.runWebGLProgram(avgPoolBackpropProgram, [dy], x.dtype); +} +var avgPoolGradConfig6 = { + kernelName: AvgPoolGrad2, + backendName: "webgl", + kernelFunc: avgPoolGrad6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/BatchMatMul.js +function batchMatMul5(args) { + const { inputs, backend: backend4, attrs } = args; + const { a, b } = inputs; + const { transposeA, transposeB } = attrs; + return batchMatMulImpl2({ a, b, transposeA, transposeB, backend: backend4 }); +} +var batchMatMulConfig5 = { + kernelName: BatchMatMul2, + backendName: "webgl", + kernelFunc: batchMatMul5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/batchnorm_gpu.js +var BatchNormProgram2 = class { + constructor(xShape, meanShape, varianceShape, offsetShape, scaleShape, varianceEpsilon) { + this.outputShape = []; + this.variableNames = ["x", "mean", "variance"]; + backend_util_exports2.assertAndGetBroadcastShape(xShape, meanShape); + backend_util_exports2.assertAndGetBroadcastShape(xShape, varianceShape); + let offsetSnippet = "0.0"; + if (offsetShape != null) { + backend_util_exports2.assertAndGetBroadcastShape(xShape, offsetShape); + this.variableNames.push("offset"); + offsetSnippet = "getOffsetAtOutCoords()"; + } + let scaleSnippet = "1.0"; + if (scaleShape != null) { + backend_util_exports2.assertAndGetBroadcastShape(xShape, scaleShape); + this.variableNames.push("scale"); + scaleSnippet = "getScaleAtOutCoords()"; + } + this.outputShape = xShape; + this.userCode = ` + void main() { + float x = getXAtOutCoords(); + float mean = getMeanAtOutCoords(); + float variance = getVarianceAtOutCoords(); + float offset = ${offsetSnippet}; + float scale = ${scaleSnippet}; + float inv = scale * inversesqrt(variance + float(${varianceEpsilon})); + setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/batchnorm_packed_gpu.js +var BatchNormPackedProgram2 = class { + constructor(xShape, meanShape, varianceShape, offsetShape, scaleShape, varianceEpsilon) { + this.packedInputs = true; + this.packedOutput = true; + this.variableNames = ["x", "mean", "variance"]; + backend_util_exports2.assertAndGetBroadcastShape(xShape, meanShape); + backend_util_exports2.assertAndGetBroadcastShape(xShape, varianceShape); + let offsetSnippet = "vec4(0.0)"; + if (offsetShape != null) { + backend_util_exports2.assertAndGetBroadcastShape(xShape, offsetShape); + this.variableNames.push("offset"); + offsetSnippet = "getOffsetAtOutCoords()"; + } + let scaleSnippet = "vec4(1.0)"; + if (scaleShape != null) { + backend_util_exports2.assertAndGetBroadcastShape(xShape, scaleShape); + this.variableNames.push("scale"); + scaleSnippet = "getScaleAtOutCoords()"; + } + this.outputShape = xShape; + this.userCode = ` + void main() { + vec4 offset = ${offsetSnippet}; + vec4 scale = ${scaleSnippet}; + + vec4 x = getXAtOutCoords(); + vec4 mean = getMeanAtOutCoords(); + vec4 variance = getVarianceAtOutCoords(); + + vec4 inv = scale * inversesqrt(variance + vec4(${varianceEpsilon})); + + setOutput((x - mean) * inv + offset); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/BatchNorm.js +var batchNorm6 = ({ inputs, backend: backend4, attrs }) => { + const { x, mean: mean6, variance, offset, scale: scale4 } = inputs; + util_exports2.assert(mean6.shape.length === variance.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."); + util_exports2.assert(offset == null || mean6.shape.length === offset.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."); + util_exports2.assert(scale4 == null || mean6.shape.length === scale4.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + let { varianceEpsilon } = attrs; + if (varianceEpsilon == null) { + varianceEpsilon = 1e-3; + } + const finalInputs = [x, mean6, variance]; + let offsetShape = null; + if (offset != null) { + offsetShape = offset.shape; + finalInputs.push(offset); + } + let scaleShape = null; + if (scale4 != null) { + scaleShape = scale4.shape; + finalInputs.push(scale4); + } + const program = env3().getBool("WEBGL_PACK_NORMALIZATION") ? new BatchNormPackedProgram2(x.shape, mean6.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon) : new BatchNormProgram2(x.shape, mean6.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon); + const output = backend4.runWebGLProgram(program, finalInputs, finalInputs[0].dtype); + return output; +}; +var batchNormConfig4 = { + kernelName: FusedBatchNorm2, + backendName: "webgl", + kernelFunc: batchNorm6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/slice_gpu.js +var SliceProgram2 = class { + constructor(destSize) { + this.variableNames = ["source"]; + this.outputShape = destSize; + this.rank = destSize.length; + const dtype = getCoordsDataType2(this.rank); + this.customUniforms = [{ name: "start", arrayIndex: this.rank, type: "int" }]; + const sourceCoords = getCoords3(this.rank); + let body4; + const coordSum = destSize.map((_, i) => { + return `sourceLoc.${coords5[i]} = start[${i}] + coords.${coords5[i]};`; + }); + body4 = ` + ${dtype} sourceLoc; + ${dtype} coords = getOutputCoords(); + ${coordSum.join("\n")} + `; + this.userCode = ` + void main() { + ${body4} + setOutput(getSource(${sourceCoords})); + } + `; + } +}; +var coords5 = ["x", "y", "z", "w", "u", "v"]; +function getCoords3(rank) { + if (rank === 1) { + return "sourceLoc"; + } else if (rank <= 6) { + return coords5.slice(0, rank).map((x) => "sourceLoc." + x).join(","); + } else { + throw Error(`Slicing for rank ${rank} is not yet supported`); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/slice_packed_gpu.js +var SlicePackedProgram2 = class { + constructor(destSize) { + this.variableNames = ["source"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = destSize; + this.rank = destSize.length; + this.customUniforms = [{ name: "start", arrayIndex: this.rank, type: "int" }]; + const dtype = getCoordsDataType2(this.rank); + const coords9 = getChannels2("coords", this.rank); + const sourceLoc = getChannels2("sourceLoc", this.rank); + const innerDims = this.rank === 1 ? "sourceLoc" : `vec2(${sourceLoc.slice(-2).join()})`; + const getChannel = `getChannel(getSource(${sourceLoc.join()}), ${innerDims})`; + const upperRow = ` + result.x = ${getChannel}; + if (++${coords9[this.rank - 1]} < ${destSize[this.rank - 1]}) { + ++${sourceLoc[this.rank - 1]}; + result.y = ${getChannel}; + --${sourceLoc[this.rank - 1]}; + } + `; + const lowerRow = this.rank === 1 ? "" : ` + --${coords9[this.rank - 1]}; + if (++${coords9[this.rank - 2]} < ${destSize[this.rank - 2]}) { + ++${sourceLoc[this.rank - 2]}; + result.z = ${getChannel}; + if (++${coords9[this.rank - 1]} < ${destSize[this.rank - 1]}) { + ++${sourceLoc[this.rank - 1]}; + result.w = ${getChannel}; + } + } + `; + const sourceLocSetup = this.rank <= 4 ? `sourceLoc = coords + + ${dtype}(${destSize.map((_, i) => `start[${i}]`).join()});` : destSize.map((_, i) => `${sourceLoc[i]} = ${coords9[i]} + start[${i}];`).join("\n"); + this.userCode = ` + void main() { + ${dtype} coords = getOutputCoords(); + ${dtype} sourceLoc; + ${sourceLocSetup} + vec4 result = vec4(0.); + ${upperRow} + ${lowerRow} + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Slice.js +function shallowSlice2(x, begin, size2, backend4) { + const xTexData = backend4.texData.get(x.dataId); + const t = backend4.makeTensorInfo(size2, x.dtype); + const newTexData = backend4.texData.get(t.dataId); + Object.assign(newTexData, xTexData); + newTexData.refCount = 1; + newTexData.shape = size2; + newTexData.dtype = x.dtype; + let flatOffset = slice_util_exports2.computeFlatOffset(begin, util_exports2.computeStrides(x.shape)); + if (xTexData.slice) { + flatOffset += xTexData.slice.flatOffset; + } + newTexData.slice = { + flatOffset, + origDataId: xTexData.slice && xTexData.slice.origDataId || x.dataId + }; + const refCount = backend4.dataRefCount.get(newTexData.slice.origDataId) || 1; + backend4.dataRefCount.set(newTexData.slice.origDataId, refCount + 1); + return t; +} +function slice7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { begin, size: size2 } = attrs; + const [$begin, $size] = slice_util_exports2.parseSliceParams(x, begin, size2); + slice_util_exports2.assertParamsValid(x, $begin, $size); + if (util_exports2.sizeFromShape($size) === 0) { + return backend4.makeTensorInfo($size, x.dtype, []); + } + if (backend4.shouldExecuteOnCPU([x]) || x.dtype === "string") { + const xTexData = backend4.texData.get(x.dataId); + const outValues = sliceImplCPU2(xTexData.values, $begin, $size, x.shape, x.dtype); + return backend4.makeTensorInfo($size, x.dtype, outValues); + } + const { isPacked } = backend4.texData.get(x.dataId); + const isContinous = slice_util_exports2.isSliceContinous(x.shape, $begin, $size); + if (isPacked || !isContinous) { + const program = env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new SlicePackedProgram2($size) : new SliceProgram2($size); + const customValues = [$begin]; + return backend4.runWebGLProgram(program, [x], x.dtype, customValues); + } + backend4.uploadToGPU(x.dataId); + return shallowSlice2(x, $begin, $size, backend4); +} +var sliceConfig5 = { + kernelName: Slice2, + backendName: "webgl", + kernelFunc: slice7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/BatchToSpaceND.js +var batchToSpaceND7 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockShape, crops } = attrs; + util_exports2.assert(x.shape.length <= 4, () => "batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"); + const prod8 = blockShape.reduce((a, b) => a * b); + const reshaped = backend_util_exports2.getReshaped(x.shape, blockShape, prod8); + const permuted = backend_util_exports2.getPermuted(reshaped.length, blockShape.length); + const reshapedPermuted = backend_util_exports2.getReshapedPermuted(x.shape, blockShape, prod8); + const sliceBeginCoords = backend_util_exports2.getSliceBeginCoords(crops, blockShape.length); + const sliceSize = backend_util_exports2.getSliceSize(reshapedPermuted, crops, blockShape.length); + const toDispose = []; + const reshapedIntermediate = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: reshaped } }); + const transposedIntermediate = transpose7({ inputs: { x: reshapedIntermediate }, backend: backend4, attrs: { perm: permuted } }); + const reshapedIntermediate2 = reshape8({ + inputs: { x: transposedIntermediate }, + backend: backend4, + attrs: { shape: reshapedPermuted } + }); + const sliced = slice7({ + inputs: { x: reshapedIntermediate2 }, + backend: backend4, + attrs: { begin: sliceBeginCoords, size: sliceSize } + }); + toDispose.push(reshapedIntermediate); + toDispose.push(transposedIntermediate); + toDispose.push(reshapedIntermediate2); + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return sliced; +}; +var batchToSpaceNDConfig5 = { + kernelName: BatchToSpaceND2, + backendName: "webgl", + kernelFunc: batchToSpaceND7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Bincount.js +function bincount6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, weights } = inputs; + const { size: size2 } = attrs; + const xVals = backend4.readSync(x.dataId); + const weightsVals = backend4.readSync(weights.dataId); + const outVals = bincountImplCPU2(xVals, weightsVals, weights.dtype, weights.shape, size2); + return backend4.makeTensorInfo([size2], weights.dtype, outVals); +} +var bincountConfig4 = { + kernelName: Bincount2, + backendName: "webgl", + kernelFunc: bincount6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/NotEqual.js +var NOT_EQUAL2 = `return float(a != b);`; +var notEqual6 = binaryKernelFunc4({ opSnippet: NOT_EQUAL2, cpuKernelImpl: notEqualImplCPU2, dtype: "bool" }); +var notEqualConfig5 = { + kernelName: NotEqual2, + backendName: "webgl", + kernelFunc: notEqual6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Real.js +function real6(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const inputData = backend4.texData.get(input3.dataId); + return identity6({ inputs: { x: inputData.complexTensorInfos.real }, backend: backend4 }); +} +var realConfig4 = { + kernelName: Real2, + backendName: "webgl", + kernelFunc: real6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/int.js +var TO_INT2 = `return float(int(x));`; +function int2(input3, backend4) { + const program = new UnaryOpProgram2(input3.shape, TO_INT2); + const output = backend4.runWebGLProgram(program, [input3], "int32"); + return { dataId: output.dataId, shape: output.shape, dtype: output.dtype }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Cast.js +function cast9(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { dtype } = attrs; + if (dtype === "complex64") { + if (x.dtype === "complex64") { + return identity6({ inputs: { x }, backend: backend4 }); + } + const zerosTensor = zeros4(x.shape); + const floatX = cast9({ inputs: { x }, backend: backend4, attrs: { dtype: "float32" } }); + const result = complex6({ inputs: { real: floatX, imag: zerosTensor }, backend: backend4 }); + zerosTensor.dispose(); + backend4.disposeIntermediateTensorInfo(floatX); + return result; + } + if (x.dtype === "complex64") { + const realPart = real6({ inputs: { input: x }, backend: backend4 }); + const result = cast9({ inputs: { x: realPart }, backend: backend4, attrs: { dtype } }); + backend4.disposeIntermediateTensorInfo(realPart); + return result; + } + if (!util_exports2.hasEncodingLoss(x.dtype, dtype)) { + const result = identity6({ inputs: { x }, backend: backend4 }); + return { dataId: result.dataId, shape: result.shape, dtype }; + } + if (dtype === "int32") { + return int2(x, backend4); + } + if (dtype === "bool") { + const zerosTensorInfo = backend4.makeTensorInfo([], "bool", util_exports2.getTypedArrayFromDType("bool", 1)); + const binaryInputs = { a: x, b: zerosTensorInfo }; + const result = notEqual6({ inputs: binaryInputs, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(zerosTensorInfo); + return result; + } + throw new Error(`Error in Cast: failed to cast ${x.dtype} to ${dtype}`); +} +var castConfig5 = { + kernelName: Cast2, + backendName: "webgl", + kernelFunc: cast9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Ceil.js +var CEIL2 = `return ceil(x);`; +var ceil6 = unaryKernelFunc4({ opSnippet: CEIL2, packedOpSnippet: CEIL2, cpuKernelImpl: ceilImplCPU2 }); +var ceilConfig5 = { + kernelName: Ceil2, + backendName: "webgl", + kernelFunc: ceil6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/clip_gpu.js +var ClipProgram2 = class { + constructor(aShape) { + this.variableNames = ["A"]; + this.customUniforms = [ + { name: "minVal", type: "float" }, + { name: "maxVal", type: "float" } + ]; + this.outputShape = aShape; + this.userCode = ` + + void main() { + float value = getAAtOutCoords(); + if (isnan(value)) { + setOutput(value); + return; + } + + setOutput(clamp(value, minVal, maxVal)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/clip_packed_gpu.js +var ClipPackedProgram2 = class { + constructor(aShape) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.customUniforms = [ + { name: "minVal", type: "float" }, + { name: "maxVal", type: "float" } + ]; + this.outputShape = aShape; + this.userCode = ` + void main() { + vec4 value = getAAtOutCoords(); + + if (any(isnan(value))) { + setOutput(value); + return; + } + + setOutput(clamp(value, vec4(minVal), vec4(maxVal))); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ClipByValue.js +function clipByValue4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { clipValueMin, clipValueMax } = attrs; + let program; + if (env3().getBool("WEBGL_PACK_CLIP")) { + program = new ClipPackedProgram2(x.shape); + } else { + program = new ClipProgram2(x.shape); + } + const customValues = [[clipValueMin], [clipValueMax]]; + return backend4.runWebGLProgram(program, [x], x.dtype, customValues); +} +var clipByValueConfig3 = { + kernelName: ClipByValue2, + backendName: "webgl", + kernelFunc: clipByValue4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/complex_abs_gpu.js +var ComplexAbsProgram2 = class { + constructor(shape) { + this.variableNames = ["real", "imag"]; + this.outputShape = shape; + this.userCode = ` + void main() { + float re = abs(getRealAtOutCoords()); + float im = abs(getImagAtOutCoords()); + float mx = max(re, im); + + // sadly the length function in glsl is not underflow-safe + // (at least not on Intel GPUs). So the safe solution is + // to ensure underflow-safety in all cases. + setOutput( + mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) + ); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ComplexAbs.js +function makeComplexComponentTensorInfo2(complexTensor, complexPart) { + return { + dataId: complexPart.dataId, + dtype: complexPart.dtype, + shape: complexTensor.shape + }; +} +function complexAbs4(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + const xData = backend4.texData.get(x.dataId); + const program = new ComplexAbsProgram2(x.shape); + const programInputs = [ + makeComplexComponentTensorInfo2(x, xData.complexTensorInfos.real), + makeComplexComponentTensorInfo2(x, xData.complexTensorInfos.imag) + ]; + return backend4.runWebGLProgram(program, programInputs, programInputs[0].dtype); +} +var complexAbsConfig4 = { + kernelName: ComplexAbs2, + backendName: "webgl", + kernelFunc: complexAbs4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/concat_gpu.js +var ConcatProgram2 = class { + constructor(shapes) { + this.outputShape = []; + this.outputShape = backend_util_exports2.computeOutShape(shapes, 1); + this.variableNames = shapes.map((_, i) => `T${i}`); + const offsets = new Array(shapes.length - 1); + offsets[0] = shapes[0][1]; + for (let i = 1; i < offsets.length; i++) { + offsets[i] = offsets[i - 1] + shapes[i][1]; + } + const snippets = [`if (yC < ${offsets[0]}) setOutput(getT0(yR, yC));`]; + for (let i = 1; i < offsets.length; i++) { + const shift = offsets[i - 1]; + snippets.push(`else if (yC < ${offsets[i]}) setOutput(getT${i}(yR, yC-${shift}));`); + } + const lastIndex = offsets.length; + const lastShift = offsets[offsets.length - 1]; + snippets.push(`else setOutput(getT${lastIndex}(yR, yC-${lastShift}));`); + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + int yR = coords.x; + int yC = coords.y; + + ${snippets.join("\n ")} + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/concat_packed_gpu.js +var ConcatPackedProgram2 = class { + constructor(shapes, axis) { + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = []; + this.outputShape = backend_util_exports2.computeOutShape(shapes, axis); + const shape = this.outputShape; + const rank = shape.length; + const dtype = getCoordsDataType2(rank); + const coords9 = getChannels2("coords", rank); + const channels = ["x", "y", "z", "w", "u", "v"].slice(0, rank); + this.variableNames = shapes.map((_, i) => `T${i}`); + const offsets = new Array(shapes.length - 1); + offsets[0] = shapes[0][axis]; + for (let i = 1; i < offsets.length; i++) { + offsets[i] = offsets[i - 1] + shapes[i][axis]; + } + const channel = channels[axis]; + const lastChannels = channels.slice(-2); + const allChannels = channels.join(); + let getValueSnippet = `if (${channel} < ${offsets[0]}) { + return getChannel( + getT0(${allChannels}), vec2(${lastChannels.join()})); + }`; + for (let i = 1; i < offsets.length; i++) { + const shift2 = offsets[i - 1]; + getValueSnippet += ` + if (${channel} < ${offsets[i]} && ${channel} >= ${offsets[i - 1]}) { + return getChannel( + getT${i}(${shiftedChannels2(channels, channel, shift2)}), + vec2(${shiftedChannels2(lastChannels, channel, shift2)})); + }`; + } + const lastIndex = offsets.length; + const shift = offsets[offsets.length - 1]; + getValueSnippet += ` + return getChannel( + getT${lastIndex}(${shiftedChannels2(channels, channel, shift)}), + vec2(${shiftedChannels2(lastChannels, channel, shift)}));`; + this.userCode = ` + float getValue(${channels.map((x) => "int " + x)}) { + ${getValueSnippet} + } + + void main() { + ${dtype} coords = getOutputCoords(); + vec4 result = vec4(getValue(${coords9}), 0., 0., 0.); + + ${coords9[rank - 1]} = ${coords9[rank - 1]} + 1; + if (${coords9[rank - 1]} < ${shape[rank - 1]}) { + result.g = getValue(${coords9}); + } + + ${coords9[rank - 2]} = ${coords9[rank - 2]} + 1; + if (${coords9[rank - 2]} < ${shape[rank - 2]}) { + result.a = getValue(${coords9}); + } + + ${coords9[rank - 1]} = ${coords9[rank - 1]} - 1; + if (${coords9[rank - 2]} < ${shape[rank - 2]} && + ${coords9[rank - 1]} < ${shape[rank - 1]}) { + result.b = getValue(${coords9}); + } + setOutput(result); + } + `; + } +}; +function shiftedChannels2(channels, channel, shift) { + const channelIdx = channels.indexOf(channel); + const res = channels.map((c, idx) => { + if (idx === channelIdx) { + return `${c} - ${shift}`; + } else { + return c; + } + }); + return res.join(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Imag.js +function imag6(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + const inputData = backend4.texData.get(input3.dataId); + return identity6({ inputs: { x: inputData.complexTensorInfos.imag }, backend: backend4 }); +} +var imagConfig4 = { + kernelName: Imag2, + backendName: "webgl", + kernelFunc: imag6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Concat_impl.js +function concatImpl4(inputs, axis, backend4) { + const dtype = inputs[0].dtype; + if (dtype === "complex64") { + const reals = inputs.map((t) => real6({ inputs: { input: t }, backend: backend4 })); + const imags = inputs.map((t) => imag6({ inputs: { input: t }, backend: backend4 })); + const realConcated = concatImpl4(reals, axis, backend4); + const imagConcated = concatImpl4(imags, axis, backend4); + const result2 = complex6({ inputs: { real: realConcated, imag: imagConcated }, backend: backend4 }); + reals.forEach((r) => backend4.disposeIntermediateTensorInfo(r)); + imags.forEach((i) => backend4.disposeIntermediateTensorInfo(i)); + backend4.disposeIntermediateTensorInfo(realConcated); + backend4.disposeIntermediateTensorInfo(imagConcated); + return result2; + } + let runOnCpu = backend4.shouldExecuteOnCPU(inputs); + if (dtype === "string") { + runOnCpu = true; + } + if (runOnCpu) { + const tensors2D2 = inputs.map((t) => { + const innerSize = util_exports2.sizeFromShape(t.shape.slice(axis)); + const shape = [-1, innerSize]; + return reshape8({ inputs: { x: t }, backend: backend4, attrs: { shape } }); + }); + const inputsValShapes = tensors2D2.map((t) => { + return { vals: backend4.readSync(t.dataId), shape: t.shape }; + }); + const outShape2 = backend_util_exports2.computeOutShape(tensors2D2.map((t) => t.shape), 1); + const simplyConcat = tensors2D2[0].shape[0] === 1; + const outVals = concatImplCPU2(inputsValShapes, outShape2, dtype, simplyConcat); + const finalOutShape = backend_util_exports2.computeOutShape(inputs.map((t) => t.shape), axis); + const outInfo = backend4.makeTensorInfo(finalOutShape, dtype, outVals); + tensors2D2.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return outInfo; + } + if (inputs.length > env3().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")) { + const midIndex = Math.floor(inputs.length / 2); + const leftSide = concatImpl4(inputs.slice(0, midIndex), axis, backend4); + const rightSide = concatImpl4(inputs.slice(midIndex), axis, backend4); + const result2 = concatImpl4([leftSide, rightSide], axis, backend4); + backend4.disposeIntermediateTensorInfo(leftSide); + backend4.disposeIntermediateTensorInfo(rightSide); + return result2; + } + if (env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") && inputs[0].shape.length > 1) { + const program2 = new ConcatPackedProgram2(inputs.map((t) => t.shape), axis); + return backend4.runWebGLProgram(program2, inputs, dtype); + } + const { tensors2D, outShape } = computeTensors2D2(inputs, axis, backend4); + const program = new ConcatProgram2(tensors2D.map((t) => t.shape)); + const result = backend4.runWebGLProgram(program, tensors2D, dtype); + tensors2D.forEach((r) => backend4.disposeIntermediateTensorInfo(r)); + const reshapedResult = reshape8({ inputs: { x: result }, attrs: { shape: outShape }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(result); + return reshapedResult; +} +function computeTensors2D2(inputs, axis, backend4) { + const outShape = backend_util_exports2.computeOutShape(inputs.map((t) => t.shape), axis); + const tensors2D = inputs.map((x) => reshape8({ + inputs: { x }, + attrs: { shape: [-1, util_exports2.sizeFromShape(x.shape.slice(axis))] }, + backend: backend4 + })); + return { tensors2D, outShape }; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Concat.js +function concat7(args) { + const { inputs, backend: backend4, attrs } = args; + const { axis } = attrs; + const $axis = util_exports2.parseAxisParam(axis, inputs[0].shape)[0]; + const outShape = backend_util_exports2.computeOutShape(inputs.map((t) => t.shape), $axis); + if (util_exports2.sizeFromShape(outShape) === 0) { + return backend4.makeTensorInfo(outShape, inputs[0].dtype, []); + } + const $inputs = inputs.filter((t) => util_exports2.sizeFromShape(t.shape) > 0); + if ($inputs.length === 1) { + return identity6({ inputs: { x: $inputs[0] }, backend: backend4 }); + } + const shapes = $inputs.map((t) => t.shape); + backend_util_exports2.assertParamsConsistent(shapes, $axis); + return concatImpl4($inputs, $axis, backend4); +} +var concatConfig5 = { + kernelName: Concat2, + backendName: "webgl", + kernelFunc: concat7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/conv_gpu.js +var Conv2DProgram2 = class { + constructor(convInfo, addBias = false, activation2 = null, hasPreluActivationWeights = false, hasLeakyreluAlpha = false) { + this.variableNames = ["x", "W"]; + this.outputShape = convInfo.outShape; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4; + const inputDepthVec4Remainder = convInfo.inChannels % 4; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + const rowDim = isChannelsLast ? 1 : 2; + const colDim = isChannelsLast ? 2 : 3; + const channelDim = isChannelsLast ? 3 : 1; + let activationSnippet = "", applyActivationSnippet = ""; + if (activation2) { + if (hasPreluActivationWeights) { + activationSnippet = `float activation(float a) { + float b = getPreluActivationWeightsAtOutCoords(); + ${activation2} + }`; + } else if (hasLeakyreluAlpha) { + activationSnippet = `float activation(float a) { + float b = getLeakyreluAlphaAtOutCoords(); + ${activation2} + }`; + } else { + activationSnippet = ` + float activation(float x) { + ${activation2} + } + `; + } + applyActivationSnippet = `result = activation(result);`; + } + const addBiasSnippet = addBias ? "result += getBiasAtOutCoords();" : ""; + if (addBias) { + this.variableNames.push("bias"); + } + if (hasPreluActivationWeights) { + this.variableNames.push("preluActivationWeights"); + } + if (hasLeakyreluAlpha) { + this.variableNames.push("leakyreluAlpha"); + } + this.userCode = ` + ${activationSnippet} + + const ivec2 strides = ivec2(${strideHeight}, ${strideWidth}); + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d2 = coords[${channelDim}]; + + ivec2 xRCCorner = + ivec2(coords[${rowDim}], coords[${colDim}]) * strides - pads; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${filterHeight}; wR++) { + int xR = xRCorner + wR * ${dilationHeight}; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${filterWidth}; wC++) { + int xC = xCCorner + wC * ${dilationWidth}; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + for (int d1 = 0; d1 < ${inputDepthNearestVec4}; d1 += 4) { + vec4 wValues = vec4( + getW(wR, wC, d1, d2), + getW(wR, wC, d1 + 1, d2), + getW(wR, wC, d1 + 2, d2), + getW(wR, wC, d1 + 3, d2) + ); + + if (${isChannelsLast}) { + vec4 xValues = vec4( + getX(batch, xR, xC, d1), + getX(batch, xR, xC, d1 + 1), + getX(batch, xR, xC, d1 + 2), + getX(batch, xR, xC, d1 + 3) + ); + dotProd += dot(xValues, wValues); + } else { + vec4 xValues = vec4( + getX(batch, d1, xR, xC), + getX(batch, d1 + 1, xR, xC), + getX(batch, d1 + 2, xR, xC), + getX(batch, d1 + 3, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + } + + if (${inputDepthVec4Remainder === 1}) { + + if (${isChannelsLast}) { + dotProd += + getX(batch, xR, xC, ${inputDepthNearestVec4}) * + getW(wR, wC, ${inputDepthNearestVec4}, d2); + } else { + dotProd += + getX(batch, ${inputDepthNearestVec4}, xR, xC) * + getW(wR, wC, ${inputDepthNearestVec4}, d2); + } + + } else if (${inputDepthVec4Remainder === 2}) { + vec2 wValues = vec2( + getW(wR, wC, ${inputDepthNearestVec4}, d2), + getW(wR, wC, ${inputDepthNearestVec4} + 1, d2) + ); + + if (${isChannelsLast}) { + vec2 xValues = vec2( + getX(batch, xR, xC, ${inputDepthNearestVec4}), + getX(batch, xR, xC, ${inputDepthNearestVec4} + 1) + ); + dotProd += dot(xValues, wValues); + } else { + vec2 xValues = vec2( + getX(batch, ${inputDepthNearestVec4}, xR, xC), + getX(batch, ${inputDepthNearestVec4} + 1, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + + } else if (${inputDepthVec4Remainder === 3}) { + vec3 wValues = vec3( + getW(wR, wC, ${inputDepthNearestVec4}, d2), + getW(wR, wC, ${inputDepthNearestVec4} + 1, d2), + getW(wR, wC, ${inputDepthNearestVec4} + 2, d2) + ); + + if (${isChannelsLast}) { + vec3 xValues = vec3( + getX(batch, xR, xC, ${inputDepthNearestVec4}), + getX(batch, xR, xC, ${inputDepthNearestVec4} + 1), + getX(batch, xR, xC, ${inputDepthNearestVec4} + 2) + ); + dotProd += dot(xValues, wValues); + } else { + vec3 xValues = vec3( + getX(batch, ${inputDepthNearestVec4}, xR, xC), + getX(batch, ${inputDepthNearestVec4} + 1, xR, xC), + getX(batch, ${inputDepthNearestVec4} + 2, xR, xC) + ); + dotProd += dot(xValues, wValues); + } + + } + } + } + + float result = dotProd; + ${addBiasSnippet} + ${applyActivationSnippet} + setOutput(result); + } + `; + } +}; +var Conv3DProgram2 = class { + constructor(convInfo) { + this.variableNames = ["x", "W"]; + this.outputShape = convInfo.outShape; + const padFront = convInfo.padInfo.front; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const filterDepth = convInfo.filterDepth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4; + const inputDepthVec4Remainder = convInfo.inChannels % 4; + this.userCode = ` + const ivec3 strides = ivec3(${strideDepth}, ${strideHeight}, ${strideWidth}); + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int d2 = coords.u; + + ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; + int xFCorner = xFRCCorner.x; + int xRCorner = xFRCCorner.y; + int xCCorner = xFRCCorner.z; + + // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get + // y(yF, yR, yC, d2). ? = to be determined. : = across all + // values in that axis. + float dotProd = 0.0; + for (int wF = 0; wF < ${filterDepth}; wF++) { + int xF = xFCorner + wF * ${dilationDepth}; + + if (xF < 0 || xF >= ${convInfo.inDepth}) { + continue; + } + + for (int wR = 0; wR < ${filterHeight}; wR++) { + int xR = xRCorner + wR * ${dilationHeight}; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int wC = 0; wC < ${filterWidth}; wC++) { + int xC = xCCorner + wC * ${dilationWidth}; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + for (int d1 = 0; d1 < ${inputDepthNearestVec4}; d1 += 4) { + vec4 xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3) + ); + vec4 wValues = vec4( + getW(wF, wR, wC, d1, d2), + getW(wF, wR, wC, d1 + 1, d2), + getW(wF, wR, wC, d1 + 2, d2), + getW(wF, wR, wC, d1 + 3, d2) + ); + + dotProd += dot(xValues, wValues); + } + + if (${inputDepthVec4Remainder === 1}) { + dotProd += + getX(batch, xF, xR, xC, ${inputDepthNearestVec4}) * + getW(wF, wR, wC, ${inputDepthNearestVec4}, d2); + } else if (${inputDepthVec4Remainder === 2}) { + vec2 xValues = vec2( + getX(batch, xF, xR, xC, ${inputDepthNearestVec4}), + getX(batch, xF, xR, xC, ${inputDepthNearestVec4} + 1) + ); + vec2 wValues = vec2( + getW(wF, wR, wC, ${inputDepthNearestVec4}, d2), + getW(wF, wR, wC, ${inputDepthNearestVec4} + 1, d2) + ); + dotProd += dot(xValues, wValues); + } else if (${inputDepthVec4Remainder === 3}) { + vec3 xValues = vec3( + getX(batch, xF, xR, xC, ${inputDepthNearestVec4}), + getX(batch, xF, xR, xC, ${inputDepthNearestVec4} + 1), + getX(batch, xF, xR, xC, ${inputDepthNearestVec4} + 2) + ); + vec3 wValues = vec3( + getW(wF, wR, wC, ${inputDepthNearestVec4}, d2), + getW(wF, wR, wC, ${inputDepthNearestVec4} + 1, d2), + getW(wF, wR, wC, ${inputDepthNearestVec4} + 2, d2) + ); + dotProd += dot(xValues, wValues); + } + } + } + } + setOutput(dotProd); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/im2col_packed_gpu.js +var Im2ColPackedProgram2 = class { + constructor(outputShape, convInfo) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.customUniforms = [ + { name: "inputShape", type: "ivec3" }, + { name: "pad", type: "ivec2" }, + { name: "stride", type: "ivec2" }, + { name: "dilation", type: "ivec2" }, + { name: "inChannels", type: "int" }, + { name: "itemsPerBlockRow", type: "int" }, + { name: "outWidth", type: "int" } + ]; + this.outputShape = outputShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + const { dataFormat } = convInfo; + const glsl = getGlslDifferences2(); + const isChannelsLast = dataFormat === "channelsLast"; + const rowDim = isChannelsLast ? 0 : 1; + const colDim = isChannelsLast ? 1 : 2; + const boundsCheckingSnippet = this.enableShapeUniforms ? "if(blockIndex < outShape[1] && pos < outShape[0]) {" : `if(blockIndex < ${outputShape[1]} && pos < ${outputShape[0]}) {`; + let unrolled = ``; + for (let row = 0; row <= 1; row++) { + for (let col = 0; col <= 1; col++) { + unrolled += ` + blockIndex = rc.y + ${col}; + pos = rc.x + ${row}; + + ${boundsCheckingSnippet} + offsetY = int(blockIndex / outWidth) * stride[0] - pad[0]; + d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow); + + if(d0 < inputShape[${rowDim}] && d0 >= 0) { + // Use custom imod instead mod. On Intel GPU, mod may generate + // unexpected value. + // https://github.com/tensorflow/tfjs/issues/5447 + offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1]; + d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) / + inChannels); + + if(d1 < inputShape[${colDim}] && d1 >= 0) { + + ch = imod(pos, inChannels); + + if (${isChannelsLast}) { + innerDims = vec2(d1, ch); + result[${row * 2 + col}] = getChannel( + getA(d0, int(innerDims.x), + int(innerDims.y)), innerDims); + } else { + innerDims = vec2(d0, d1); + result[${row * 2 + col}] = getChannel( + getA(ch, int(innerDims.x), + int(innerDims.y)), innerDims); + } + } + } + } + `; + } + } + this.userCode = ` + void main() { + ivec2 rc = getOutputCoords(); + + vec4 result = vec4(0); + + int blockIndex, pos, offsetY, d0, offsetX, d1, ch; + vec2 innerDims; + + ${unrolled} + + ${glsl.output} = result; + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv2D_impl.js +function conv2dByMatMul2({ x, filter, convInfo, backend: backend4, bias = null, preluActivationWeights = null, leakyreluAlpha = 0, activation: activation2 = null }) { + const xShape = x.shape; + const xTexData = backend4.texData.get(x.dataId); + const sharedMatMulDim = convInfo.inChannels; + const outerShapeX = xShape[0] * xShape[1] * xShape[2]; + const outerShapeFilter = convInfo.outChannels; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + const transposeA = false; + const transposeB = false; + let out; + const intermediates = []; + const batchMatMulWillBeUnpacked = (outerShapeX === 1 || outerShapeFilter === 1) && sharedMatMulDim > MATMUL_SHARED_DIM_THRESHOLD2; + const canOptimize = !batchMatMulWillBeUnpacked && xTexData.isPacked && isChannelsLast && xTexData.texture != null && xShape[2] % 2 !== 0 && util_exports2.arraysEqual(xTexData.shape.slice(-3), xShape.slice(-3)); + if (canOptimize) { + const targetShape = xShape[0] * xShape[1] * (xShape[2] + 1); + const xReshaped = { + dataId: x.dataId, + shape: [1, targetShape, convInfo.inChannels], + dtype: x.dtype + }; + const originalXTexDataShape = xTexData.shape; + xTexData.shape = xTexData.shape.slice(); + xTexData.shape[xTexData.shape.length - 2]++; + util_exports2.assert(isReshapeFree2(xTexData.shape, xReshaped.shape), () => `packed reshape ${xTexData.shape} to ${xReshaped.shape} isn't free`); + const filterReshaped = reshape8({ + inputs: { x: filter }, + backend: backend4, + attrs: { shape: [1, convInfo.inChannels, convInfo.outChannels] } + }); + intermediates.push(filterReshaped); + const pointwiseConv = batchMatMulImpl2({ + a: xReshaped, + b: filterReshaped, + backend: backend4, + transposeA, + transposeB, + bias, + activation: activation2, + preluActivationWeights, + leakyreluAlpha + }); + const pointwiseConvTexData = backend4.texData.get(pointwiseConv.dataId); + util_exports2.assert(pointwiseConvTexData.isPacked, () => "batchMatMul result is expected to be packed"); + xTexData.shape = originalXTexDataShape; + pointwiseConvTexData.shape = convInfo.outShape; + out = identity6({ inputs: { x: pointwiseConv }, backend: backend4 }); + out.shape = convInfo.outShape; + intermediates.push(pointwiseConv); + } else { + const targetShape = isChannelsLast ? xShape[0] * xShape[1] * xShape[2] : xShape[0] * xShape[2] * xShape[3]; + const xReshaped = reshape8({ + inputs: { x }, + backend: backend4, + attrs: { shape: [1, targetShape, convInfo.inChannels] } + }); + const filterReshaped = reshape8({ + inputs: { x: filter }, + backend: backend4, + attrs: { shape: [1, convInfo.inChannels, convInfo.outChannels] } + }); + const result = batchMatMulImpl2({ + a: xReshaped, + b: filterReshaped, + transposeA, + transposeB, + backend: backend4, + bias, + activation: activation2, + preluActivationWeights, + leakyreluAlpha + }); + out = reshape8({ inputs: { x: result }, backend: backend4, attrs: { shape: convInfo.outShape } }); + intermediates.push(xReshaped); + intermediates.push(filterReshaped); + intermediates.push(result); + } + for (const i of intermediates) { + backend4.disposeIntermediateTensorInfo(i); + } + return out; +} +function conv2dWithIm2Row2({ x, filter, convInfo, backend: backend4, bias = null, preluActivationWeights = null, leakyreluAlpha = 0, activation: activation2 = null }) { + const { filterWidth, filterHeight, inChannels, outWidth, outHeight, dataFormat } = convInfo; + const isChannelsLast = dataFormat === "channelsLast"; + const sharedDim = filterWidth * filterHeight * inChannels; + const numCols = outHeight * outWidth; + const x2ColShape = [sharedDim, numCols]; + const transposeA = true; + const transposeB = false; + const intermediates = []; + const xSqueezed = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: x.shape.slice(1) } }); + const w2Row = reshape8({ + inputs: { x: filter }, + backend: backend4, + attrs: { shape: [1, sharedDim, util_exports2.sizeFromShape(filter.shape) / sharedDim] } + }); + intermediates.push(xSqueezed); + intermediates.push(w2Row); + const im2ColProgram = new Im2ColPackedProgram2(x2ColShape, convInfo); + const customValues = [ + xSqueezed.shape, + [convInfo.padInfo.top, convInfo.padInfo.left], + [convInfo.strideHeight, convInfo.strideWidth], + [convInfo.dilationHeight, convInfo.dilationWidth], + [convInfo.inChannels], + [convInfo.filterWidth * convInfo.inChannels], + [convInfo.outWidth] + ]; + const im2Col = backend4.runWebGLProgram(im2ColProgram, [xSqueezed], "float32", customValues); + const im2ColReshaped = reshape8({ + inputs: { x: im2Col }, + backend: backend4, + attrs: { shape: [1, x2ColShape[0], x2ColShape[1]] } + }); + intermediates.push(im2Col); + intermediates.push(im2ColReshaped); + const hasBias = bias != null; + const hasPreluActivationWeights = preluActivationWeights != null; + const hasLeakyreluAlpha = activation2 === "leakyrelu"; + const fusedActivation = activation2 ? mapActivationToShaderProgram2(activation2, true) : null; + const matmulProgram = new MatMulPackedProgram2(im2ColReshaped.shape, w2Row.shape, [1, numCols, convInfo.outChannels], transposeA, transposeB, hasBias, fusedActivation, hasPreluActivationWeights, hasLeakyreluAlpha); + const inputs = [im2ColReshaped, w2Row]; + if (bias) { + inputs.push(bias); + } + if (hasPreluActivationWeights) { + inputs.push(preluActivationWeights); + } + if (hasLeakyreluAlpha) { + const $leakyreluAlpha = backend4.makeTensorInfo([], "float32", util_exports2.createScalarValue(leakyreluAlpha, "float32")); + inputs.push($leakyreluAlpha); + intermediates.push($leakyreluAlpha); + } + const product = backend4.runWebGLProgram(matmulProgram, inputs, "float32"); + const outShape = isChannelsLast ? [1, outHeight, outWidth, convInfo.outChannels] : [1, convInfo.outChannels, outHeight, outWidth]; + const out = reshape8({ inputs: { x: product }, backend: backend4, attrs: { shape: outShape } }); + intermediates.push(product); + for (const i of intermediates) { + backend4.disposeIntermediateTensorInfo(i); + } + return out; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv2D.js +function conv2d8(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dataFormat, dilations, dimRoundingMode } = attrs; + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad4, dimRoundingMode, false, $dataFormat); + let out; + if (convInfo.filterHeight === 1 && convInfo.filterWidth === 1 && convInfo.dilationHeight === 1 && convInfo.dilationWidth === 1 && convInfo.strideHeight === 1 && convInfo.strideWidth === 1 && (convInfo.padInfo.type === "SAME" || convInfo.padInfo.type === "VALID")) { + out = conv2dByMatMul2({ x, filter, convInfo, backend: backend4 }); + } else if (env3().getBool("WEBGL_CONV_IM2COL") && x.shape[0] === 1) { + out = conv2dWithIm2Row2({ x, filter, convInfo, backend: backend4 }); + } else { + const program = new Conv2DProgram2(convInfo); + out = backend4.runWebGLProgram(program, [x, filter], "float32"); + } + const outReshaped = reshape8({ inputs: { x: out }, backend: backend4, attrs: { shape: convInfo.outShape } }); + backend4.disposeIntermediateTensorInfo(out); + return outReshaped; +} +var conv2DConfig5 = { + kernelName: Conv2D3, + backendName: "webgl", + kernelFunc: conv2d8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/conv_backprop_gpu.js +var Conv2DDerFilterProgram2 = class { + constructor(convInfo) { + this.variableNames = ["x", "dy"]; + this.outputShape = convInfo.filterShape; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int wR = coords.x; + int wC = coords.y; + int d1 = coords.z; + int d2 = coords.w; + + // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int b = 0; b < ${convInfo.batchSize}; b++) { + for (int yR = 0; yR < ${convInfo.outHeight}; yR++) { + int xR = wR + yR * ${strideHeight} - ${padTop}; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${convInfo.outWidth}; yC++) { + int xC = wC + yC * ${strideWidth} - ${padLeft}; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + if (${isChannelsLast}) { + float dyValue = getDy(b, yR, yC, d2); + float xValue = getX(b, xR, xC, d1); + dotProd += (xValue * dyValue); + } else { + float dyValue = getDy(b, d2, yR, yC); + float xValue = getX(b, d1, xR, xC); + dotProd += (xValue * dyValue); + } + + } + } + } + setOutput(dotProd); + } + `; + } +}; +var Conv2DDerInputProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy", "W"]; + this.outputShape = convInfo.inShape; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const isChannelsLast = convInfo.dataFormat === "channelsLast"; + const padTop = filterHeight - 1 - convInfo.padInfo.top; + const padLeft = filterWidth - 1 - convInfo.padInfo.left; + const rowDim = isChannelsLast ? 1 : 2; + const colDim = isChannelsLast ? 2 : 3; + const channelDim = isChannelsLast ? 3 : 1; + this.userCode = ` + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d1 = coords[${channelDim}]; + + ivec2 dyCorner = ivec2(coords[${rowDim}], coords[${colDim}]) - pads; + int dyRCorner = dyCorner.x; + int dyCCorner = dyCorner.y; + + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${filterHeight}; wR++) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${filterHeight} - 1 - wR; + + for (int wC = 0; wC < ${filterWidth}; wC++) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${filterWidth} - 1 - wC; + + for (int d2 = 0; d2 < ${convInfo.outChannels}; d2++) { + + if (${isChannelsLast}) { + float xValue = getDy(batch, idyR, idyC, d2); + float wValue = getW(wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } else { + float xValue = getDy(batch, d2, idyR, idyC); + float wValue = getW(wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } + + } + } + } + setOutput(dotProd); + } + `; + } +}; +var Conv3DDerFilterProgram2 = class { + constructor(convInfo) { + this.variableNames = ["x", "dy"]; + this.outputShape = convInfo.filterShape; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const padFront = convInfo.padInfo.front; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + this.userCode = ` + void main() { + ivec5 coords = getOutputCoords(); + int wF = coords.x; + int wR = coords.y; + int wC = coords.z; + int d1 = coords.w; + int d2 = coords.u; + + float dotProd = 0.0; + + for (int b = 0; b < ${convInfo.batchSize}; b++) { + for (int yF = 0; yF < ${convInfo.outDepth}; yF++) { + int xF = wF + yF * ${strideDepth} - ${padFront}; + + if (xF < 0 || xF >= ${convInfo.inDepth}) { + continue; + } + + for (int yR = 0; yR < ${convInfo.outHeight}; yR++) { + int xR = wR + yR * ${strideHeight} - ${padTop}; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${convInfo.outWidth}; yC++) { + int xC = wC + yC * ${strideWidth} - ${padLeft}; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + float dyValue = getDy(b, yF, yR, yC, d2); + float xValue = getX(b, xF, xR, xC, d1); + dotProd += (xValue * dyValue); + } + } + } + } + setOutput(dotProd); + } + `; + } +}; +var Conv3DDerInputProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy", "W"]; + this.outputShape = convInfo.inShape; + const filterDepth = convInfo.filterDepth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const padFront = filterDepth - 1 - convInfo.padInfo.front; + const padTop = filterHeight - 1 - convInfo.padInfo.top; + const padLeft = filterWidth - 1 - convInfo.padInfo.left; + this.userCode = ` + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int d1 = coords.u; + + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyFCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + float dotProd = 0.0; + for (int wF = 0; wF < ${filterDepth}; wF++) { + float dyF = float(dyFCorner + wF) / ${strideDepth}.0; + + if (dyF < 0.0 || dyF >= ${convInfo.outDepth}.0 || fract(dyF) > 0.0) { + continue; + } + int idyF = int(dyF); + + int wFPerm = ${filterDepth} - 1 - wF; + + for (int wR = 0; wR < ${filterHeight}; wR++) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${filterHeight} - 1 - wR; + + for (int wC = 0; wC < ${filterWidth}; wC++) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${filterWidth} - 1 - wC; + + for (int d2 = 0; d2 < ${convInfo.outChannels}; d2++) { + float xValue = getDy(batch, idyF, idyR, idyC, d2); + float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); + dotProd += xValue * wValue; + } + } + } + } + setOutput(dotProd); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv2DBackpropFilter.js +function conv2DBackpropFilter6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, pad: pad4, dataFormat, dimRoundingMode, filterShape } = attrs; + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filterShape, strides, 1, pad4, dimRoundingMode, false, $dataFormat); + const program = new Conv2DDerFilterProgram2(convInfo); + return backend4.runWebGLProgram(program, [x, dy], "float32"); +} +var conv2DBackpropFilterConfig4 = { + kernelName: Conv2DBackpropFilter2, + backendName: "webgl", + kernelFunc: conv2DBackpropFilter6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv2DBackpropInput.js +function conv2DBackpropInput7(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { inputShape, strides, pad: pad4, dataFormat, dimRoundingMode } = attrs; + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(inputShape, filter.shape, strides, 1, pad4, dimRoundingMode, false, $dataFormat); + const program = new Conv2DDerInputProgram2(convInfo); + return backend4.runWebGLProgram(program, [dy, filter], "float32"); +} +var conv2DBackpropInputConfig5 = { + kernelName: Conv2DBackpropInput2, + backendName: "webgl", + kernelFunc: conv2DBackpropInput7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv3D.js +function conv3D4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dilations } = attrs; + const convInfo = backend_util_exports2.computeConv3DInfo(x.shape, filter.shape, strides, dilations, pad4); + const program = new Conv3DProgram2(convInfo); + return backend4.runWebGLProgram(program, [x, filter], "float32"); +} +var conv3DConfig4 = { + kernelName: Conv3D3, + backendName: "webgl", + kernelFunc: conv3D4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv3DBackpropFilterV2.js +function conv3DBackpropFilterV24(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, pad: pad4, filterShape } = attrs; + const convInfo = backend_util_exports2.computeConv3DInfo(x.shape, filterShape, strides, 1, pad4); + const program = new Conv3DDerFilterProgram2(convInfo); + return backend4.runWebGLProgram(program, [x, dy], "float32"); +} +var conv3DBackpropFilterV2Config4 = { + kernelName: Conv3DBackpropFilterV22, + backendName: "webgl", + kernelFunc: conv3DBackpropFilterV24 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Conv3DBackpropInputV2.js +function conv3DBackpropInput4(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { pad: pad4, strides, inputShape } = attrs; + const convInfo = backend_util_exports2.computeConv3DInfo(inputShape, filter.shape, strides, 1, pad4); + const program = new Conv3DDerInputProgram2(convInfo); + return backend4.runWebGLProgram(program, [dy, filter], "float32"); +} +var conv3DBackpropInputConfig2 = { + kernelName: Conv3DBackpropInputV22, + backendName: "webgl", + kernelFunc: conv3DBackpropInput4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Cos.js +var COS2 = CHECK_NAN_SNIPPET_UNARY2 + ` + return cos(x); +`; +var cos6 = unaryKernelFunc4({ opSnippet: COS2 }); +var cosConfig5 = { + kernelName: Cos2, + backendName: "webgl", + kernelFunc: cos6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Cosh.js +var COSH2 = ` + float e2x = exp(-x); + return (e2x + 1.0 / e2x) / 2.0; +`; +var cosh6 = unaryKernelFunc4({ opSnippet: COSH2 }); +var coshConfig5 = { + kernelName: Cosh2, + backendName: "webgl", + kernelFunc: cosh6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/crop_and_resize_gpu.js +var CropAndResizeProgram2 = class { + constructor(imageShape, boxShape, cropSize, method, extrapolationValue) { + this.variableNames = ["Image", "Boxes", "BoxInd"]; + this.outputShape = []; + const [batch, imageHeight, imageWidth, depth] = imageShape; + const [numBoxes] = boxShape; + const [cropHeight, cropWidth] = cropSize; + this.outputShape = [numBoxes, cropHeight, cropWidth, depth]; + const methodId = method === "bilinear" ? 1 : 0; + const [inputHeightFloat, inputWidthFloat] = [`${imageHeight - 1}.0`, `${imageWidth - 1}.0`]; + const [heightRatio, heightScale, inY] = cropHeight > 1 ? [ + `${(imageHeight - 1) / (cropHeight - 1)}`, + "(y2-y1) * height_ratio", + `y1*${inputHeightFloat} + float(y)*(height_scale)` + ] : [ + "0.0", + "0.0", + `0.5 * (y1+y2) * ${inputHeightFloat}` + ]; + const [widthRatio, widthScale, inX] = cropWidth > 1 ? [ + `${(imageWidth - 1) / (cropWidth - 1)}`, + "(x2-x1) * width_ratio", + `x1*${inputWidthFloat} + float(x)*(width_scale)` + ] : [ + "0.0", + "0.0", + `0.5 * (x1+x2) * ${inputWidthFloat}` + ]; + this.userCode = ` + const float height_ratio = float(${heightRatio}); + const float width_ratio = float(${widthRatio}); + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int y = coords[1]; + int x = coords[2]; + int d = coords[3]; + + // get box vals + float y1 = getBoxes(b,0); + float x1 = getBoxes(b,1); + float y2 = getBoxes(b,2); + float x2 = getBoxes(b,3); + + // get image in batch index + int bInd = round(getBoxInd(b)); + if(bInd < 0 || bInd >= ${batch}) { + return; + } + + float height_scale = ${heightScale}; + float width_scale = ${widthScale}; + + float in_y = ${inY}; + if( in_y < 0.0 || in_y > ${inputHeightFloat} ) { + setOutput(float(${extrapolationValue})); + return; + } + float in_x = ${inX}; + if( in_x < 0.0 || in_x > ${inputWidthFloat} ) { + setOutput(float(${extrapolationValue})); + return; + } + + vec2 sourceFracIndexCR = vec2(in_x,in_y); + if(${methodId} == 1) { + // Compute the four integer indices. + ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); + ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); + + float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d); + float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d); + float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d); + float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d); + + vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR); + + float top = topLeft + (topRight - topLeft) * fracCR.x; + float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x; + float newValue = top + (bottom - top) * fracCR.y; + setOutput(newValue); + } else { + // Compute the coordinators of nearest neighbor point. + ivec2 sourceNearestCR = ivec2(floor( + sourceFracIndexCR + vec2(0.5,0.5))); + float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d); + setOutput(newValue); + } + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/CropAndResize.js +var cropAndResize7 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { image: image9, boxes, boxInd } = inputs; + const { cropSize, method, extrapolationValue } = attrs; + const program = new CropAndResizeProgram2(image9.shape, boxes.shape, cropSize, method, extrapolationValue); + return backend4.runWebGLProgram(program, [image9, boxes, boxInd], "float32"); +}; +var cropAndResizeConfig5 = { + kernelName: CropAndResize2, + backendName: "webgl", + kernelFunc: cropAndResize7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/cumsum_gpu.js +var CumSumProgram2 = class { + constructor(shape, exclusive, reverse8) { + this.variableNames = ["x"]; + this.customUniforms = [{ name: "index", type: "float" }]; + this.outputShape = shape; + const rank = shape.length; + const val = exclusive ? "0.0" : `getX(${getCoords4(rank, "coords")})`; + const length = shape[shape.length - 1]; + let condition = ""; + let idxString = ""; + if (exclusive) { + condition = reverse8 ? `end != ${length - 1}` : "end != 0"; + idxString = reverse8 ? "end + 1" : "end - 1"; + } else { + condition = reverse8 ? `end + pow2 < ${length}` : "end >= pow2"; + idxString = reverse8 ? "end + pow2" : "end - pow2"; + } + this.userCode = ` + void main() { + ${getCoordsDataType2(rank)} coords = getOutputCoords(); + int end = ${getFinalCoord2(rank, "coords")}; + float val = ${val}; + int pow2 = int(pow(2.0, index)); + if (${condition}) { + int idx = ${idxString}; + ${getFinalCoord2(rank, "coords")} = idx; + val += getX(${getCoords4(rank, "coords")}); + } + setOutput(val); + } + `; + } +}; +function getCoords4(rank, name) { + if (rank === 1) { + return `${name}`; + } else if (rank === 2) { + return `${name}.x, ${name}.y`; + } else if (rank === 3) { + return `${name}.x, ${name}.y, ${name}.z`; + } else if (rank === 4) { + return `${name}.x, ${name}.y, ${name}.z, ${name}.w`; + } else { + throw Error(`Cumulative sum for rank ${rank} is not yet supported`); + } +} +function getFinalCoord2(rank, name) { + if (rank === 1) { + return `${name}`; + } else if (rank === 2) { + return `${name}.y`; + } else if (rank === 3) { + return `${name}.z`; + } else if (rank === 4) { + return `${name}.w`; + } else { + throw Error(`Cumulative sum for rank ${rank} is not yet supported`); + } +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Cumsum.js +function cumsum7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, exclusive, reverse: reverse8 } = attrs; + const xRank = x.shape.length; + const permutation = backend_util_exports2.getAxesPermutation([axis], xRank); + let permutedX = x; + if (permutation != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutation } }); + } + const permutedAxis = backend_util_exports2.getInnerMostAxes(1, xRank)[0]; + if (permutedAxis !== xRank - 1) { + throw new Error(`WebGL cumsum shader expects an inner-most axis=${x.shape.length - 1} but got axis=${axis}`); + } + const size2 = permutedX.shape[permutedAxis]; + let result = identity6({ inputs: { x: permutedX }, backend: backend4 }); + for (let i = 0; i <= Math.ceil(Math.log2(size2)) - 1; i++) { + const program = new CumSumProgram2(permutedX.shape, false, reverse8); + const customValues = [[i]]; + const prevResult = result; + result = backend4.runWebGLProgram(program, [result], result.dtype, customValues); + backend4.disposeIntermediateTensorInfo(prevResult); + } + if (exclusive) { + const program = new CumSumProgram2(permutedX.shape, exclusive, reverse8); + const prevResult = result; + result = backend4.runWebGLProgram(program, [result], result.dtype); + backend4.disposeIntermediateTensorInfo(prevResult); + } + if (permutation != null) { + const reversePermutation = backend_util_exports2.getUndoAxesPermutation(permutation); + const reverseTransposedResult = transpose7({ inputs: { x: result }, backend: backend4, attrs: { perm: reversePermutation } }); + backend4.disposeIntermediateTensorInfo(result); + backend4.disposeIntermediateTensorInfo(permutedX); + return reverseTransposedResult; + } + return result; +} +var cumsumConfig5 = { + kernelName: Cumsum2, + backendName: "webgl", + kernelFunc: cumsum7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/DenseBincount.js +function denseBincount6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, weights } = inputs; + const { size: size2, binaryOutput } = attrs; + if (x.shape.length === 1) { + const xVals = backend4.readSync(x.dataId); + const weightsVals = backend4.readSync(weights.dataId); + const outVals = bincountImplCPU2(xVals, weightsVals, weights.dtype, weights.shape, size2); + return backend4.makeTensorInfo([size2], weights.dtype, outVals); + } else if (x.shape.length === 2) { + const xBuf = backend4.bufferSync(x); + const weightsBuf = backend4.bufferSync(weights); + const outBuf = bincountReduceImplCPU2(xBuf, weightsBuf, size2, binaryOutput); + return backend4.makeTensorInfo(outBuf.shape, weights.dtype, outBuf.values); + } + throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${x.shape.length}.`); +} +var denseBincountConfig4 = { + kernelName: DenseBincount2, + backendName: "webgl", + kernelFunc: denseBincount6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/depth_to_space_gpu.js +var DepthToSpaceProgram2 = class { + constructor(outputShape, blockSize, dataFormat) { + this.variableNames = ["x"]; + this.outputShape = []; + this.outputShape = outputShape; + this.blockSize = blockSize; + this.dataFormat = dataFormat; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int h = ${this.getHeightCoordString()}; + int w = ${this.getWidthCoordString()}; + int d = ${this.getDepthCoordString()}; + + int in_h = h / ${blockSize}; + int offset_h = imod(h, ${blockSize}); + int in_w = w / ${blockSize}; + int offset_w = imod(w, ${blockSize}); + int offset_d = (offset_h * ${blockSize} + offset_w) * + ${this.getOutputDepthSize()}; + int in_d = d + offset_d; + + float result = ${this.getInputSamplingString()}; + setOutput(result); + } + `; + } + getHeightCoordString() { + if (this.dataFormat === "NHWC") { + return `coords[1]`; + } else { + return `coords[2]`; + } + } + getWidthCoordString() { + if (this.dataFormat === "NHWC") { + return `coords[2]`; + } else { + return `coords[3]`; + } + } + getDepthCoordString() { + if (this.dataFormat === "NHWC") { + return `coords[3]`; + } else { + return `coords[1]`; + } + } + getOutputDepthSize() { + if (this.dataFormat === "NHWC") { + return this.outputShape[3]; + } else { + return this.outputShape[1]; + } + } + getInputSamplingString() { + if (this.dataFormat === "NHWC") { + return `getX(b, in_h, in_w, in_d)`; + } else { + return `getX(b, in_d, in_h, in_w)`; + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/DepthToSpace.js +function depthToSpace7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockSize, dataFormat } = attrs; + util_exports2.assert(blockSize > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${blockSize}`); + const batchSize = x.shape[0]; + const inputHeight = dataFormat === "NHWC" ? x.shape[1] : x.shape[2]; + const inputWidth = dataFormat === "NHWC" ? x.shape[2] : x.shape[3]; + const inputDepth = dataFormat === "NHWC" ? x.shape[3] : x.shape[1]; + const outputHeight = inputHeight * blockSize; + const outputWidth = inputWidth * blockSize; + const outputDepth = inputDepth / (blockSize * blockSize); + const outputShape = dataFormat === "NHWC" ? [batchSize, outputHeight, outputWidth, outputDepth] : [batchSize, outputDepth, outputHeight, outputWidth]; + const program = new DepthToSpaceProgram2(outputShape, blockSize, dataFormat); + return backend4.runWebGLProgram(program, [x], x.dtype); +} +var depthToSpaceConfig5 = { + kernelName: DepthToSpace2, + backendName: "webgl", + kernelFunc: depthToSpace7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/conv_gpu_depthwise.js +var DepthwiseConv2DProgram2 = class { + constructor(convInfo, addBias = false, activation2 = null, hasPreluActivation = false, hasLeakyReluAlpha = false) { + this.variableNames = ["x", "W"]; + this.customUniforms = [ + { name: "pads", type: "ivec2" }, + { name: "strides", type: "ivec2" }, + { name: "dilations", type: "ivec2" }, + { name: "inDims", type: "ivec2" } + ]; + this.outputShape = convInfo.outShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const channelMul = convInfo.outChannels / convInfo.inChannels; + let activationSnippet = "", applyActivationSnippet = ""; + if (activation2) { + if (hasPreluActivation) { + activationSnippet = `float activation(float a) { + float b = getPreluActivationWeightsAtOutCoords(); + ${activation2} + }`; + } else if (hasLeakyReluAlpha) { + activationSnippet = `float activation(float a) { + float b = getLeakyreluAlphaAtOutCoords(); + ${activation2} + }`; + } else { + activationSnippet = ` + float activation(float x) { + ${activation2} + } + `; + } + applyActivationSnippet = `result = activation(result);`; + } + const addBiasSnippet = addBias ? "result += getBiasAtOutCoords();" : ""; + if (addBias) { + this.variableNames.push("bias"); + } + if (hasPreluActivation) { + this.variableNames.push("preluActivationWeights"); + } + if (hasLeakyReluAlpha) { + this.variableNames.push("leakyreluAlpha"); + } + this.userCode = ` + ${activationSnippet} + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + ivec2 xRCCorner = coords.yz * strides - pads; + int d2 = coords.w; + int d1 = d2 / ${channelMul}; + int q = d2 - d1 * ${channelMul}; + + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. + for (int wR = 0; wR < ${filterHeight}; wR++) { + int xR = xRCorner + wR * dilations[0]; + + if (xR < 0 || xR >= inDims[0]) { + continue; + } + + for (int wC = 0; wC < ${filterWidth}; wC++) { + int xC = xCCorner + wC * dilations[1]; + + if (xC < 0 || xC >= inDims[1]) { + continue; + } + + float xVal = getX(batch, xR, xC, d1); + float wVal = getW(wR, wC, d1, q); + dotProd += xVal * wVal; + } + } + + float result = dotProd; + ${addBiasSnippet} + ${applyActivationSnippet} + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/conv_packed_gpu_depthwise.js +var DepthwiseConvPacked2DProgram2 = class { + constructor(convInfo, addBias = false, activation2 = null, hasPreluActivation = false, hasLeakyReluAlpha = false) { + this.variableNames = ["x", "W"]; + this.packedInputs = true; + this.packedOutput = true; + this.customUniforms = [ + { name: "pads", type: "ivec2" }, + { name: "strides", type: "ivec2" }, + { name: "dilations", type: "ivec2" }, + { name: "inDims", type: "ivec2" } + ]; + this.outputShape = convInfo.outShape; + this.enableShapeUniforms = useShapeUniforms2(this.outputShape.length); + const channelMul = convInfo.outChannels / convInfo.inChannels; + const padLeft = convInfo.padInfo.left; + const strideWidth = convInfo.strideWidth; + const dilationWidth = convInfo.dilationWidth; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const texelsAcross = filterWidth; + let mainLoop = ` + int xR; int xC; int xCOffset; + vec4 wTexel; vec4 previous; vec4 final;`; + for (let c = 0; c < filterWidth; c++) { + mainLoop += ` + vec4 xTexelC${c * 2}; + int xTexelC${c * 2}Ready; + vec4 xTexelC${c * 2 + 1}; + int xTexelC${c * 2 + 1}Ready; + vec4 xC${c};`; + } + for (let r = 0; r < filterHeight; r++) { + for (let c = 0; c < filterWidth; c++) { + mainLoop += ` + xTexelC${c * 2} = vec4(0.0); + xTexelC${c * 2}Ready = 0; + xTexelC${c * 2 + 1} = vec4(0.0); + xTexelC${c * 2 + 1}Ready = 0; + xC${c} = vec4(0.0);`; + } + mainLoop += ` + xR = xRCorner + ${r} * dilations[0]; + if (xR >=0 && xR < inDims[0]) { + `; + for (let texelC = 0; texelC < (texelsAcross + 1) / 2; texelC++) { + const colIndex = texelC * 2; + mainLoop += ` + xC = xCCorner + ${colIndex * dilationWidth}; + `; + if (strideWidth === 1) { + if (colIndex < filterWidth) { + if (padLeft % 2 === 1) { + mainLoop += ` + xCOffset = xC + 1; + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex}Ready == 0) { + xTexelC${colIndex} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${colIndex}.zw = vec2(0.0); + } + xTexelC${colIndex}Ready = 1; + } + `; + if (dilationWidth === 1 && colIndex > 0) { + mainLoop += ` + xC${colIndex} = vec4(xTexelC${colIndex - 2}.zw, xTexelC${colIndex}.xy); + `; + } else { + mainLoop += ` + xCOffset = xC + 1 - 2; + + if (xCOffset >= 0 && xCOffset < inDims[1]) { + previous = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + previous.zw = vec2(0.0); + } + + xC${colIndex} = vec4(previous.zw, xTexelC${colIndex}.xy); + } else { + xC${colIndex} = vec4(0.0, 0.0, xTexelC${colIndex}.xy); + } + `; + } + } else { + mainLoop += ` + if (xC >= 0 && xC < inDims[1] && xTexelC${colIndex}Ready == 0) { + xTexelC${colIndex} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${colIndex}.zw = vec2(0.0); + } + xTexelC${colIndex}Ready = 1; + } + + xC${colIndex} = xTexelC${colIndex}; + `; + } + if (colIndex + 1 < filterWidth) { + const nextTexelOffset = padLeft % 2 === 0 ? util_exports2.nearestLargerEven(dilationWidth) : dilationWidth; + if (dilationWidth % 2 === 0 && padLeft % 2 === 1 || dilationWidth % 2 !== 0 && padLeft % 2 !== 1) { + mainLoop += ` + xCOffset = xC + imod(pads[1], 2) + ${nextTexelOffset}; + + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex + 1}Ready == 0) { + xTexelC${colIndex + 1} = getX(batch, xR, xCOffset, d1); + + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${colIndex + 1}.zw = vec2(0.0); + } + xTexelC${colIndex + 1}Ready = 1; + } + `; + if (dilationWidth > 1) { + mainLoop += ` + xCOffset -= 2; + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex}Ready == 0) { + xTexelC${colIndex} = getX(batch, xR, xCOffset, d1); + xTexelC${colIndex}Ready = 1; + } + `; + } + mainLoop += ` + xC${colIndex + 1} = vec4(xTexelC${colIndex}.zw, xTexelC${colIndex + 1}.xy); + `; + } else { + if (nextTexelOffset === 1) { + mainLoop += ` + xC${colIndex + 1} = xTexelC${colIndex}; + `; + } else { + mainLoop += ` + xCOffset = xC + ${nextTexelOffset}; + + if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex + 1}Ready == 0) { + xTexelC${colIndex + 1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${colIndex + 1}.zw = vec2(0.0); + } + xTexelC${colIndex + 1}Ready = 1; + } + + xC${colIndex + 1} = xTexelC${colIndex + 1}; + `; + } + } + } + } + } else { + if (colIndex < filterWidth) { + if (padLeft % 2 === 1) { + mainLoop += ` + xCOffset = xC + 1 - strides[1]; + if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex}Ready == 0) { + xTexelC${colIndex} = getX(batch, xR, xCOffset, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xCOffset + 1 >= inDims[1]) { + xTexelC${colIndex}.zw = vec2(0.0); + } + xTexelC${colIndex}Ready = 1; + } + + if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${colIndex + 1}Ready == 0) { + xTexelC${colIndex + 1} = getX(batch, xR, xC + 1, d1); + // Need to manually clear unused channels in case + // we're reading from recycled texture. + if (xC + 2 >= inDims[1]) { + xTexelC${colIndex + 1}.zw = vec2(0.0); + } + xTexelC${colIndex + 1}Ready = 1; + } + + xC${colIndex} = vec4(xTexelC${colIndex}.zw, xTexelC${colIndex + 1}.zw); + `; + if (colIndex + 1 < filterWidth) { + mainLoop += ` + final = vec4(0.0); + xCOffset = xC + 1 + strides[1]; + if(xCOffset >= 0 && xCOffset < inDims[1]) { + final = getX(batch, xR, xCOffset, d1); + } + xC${colIndex + 1} = vec4(xTexelC${colIndex + 1}.xy, final.xy); + `; + } + } else { + mainLoop += ` + if(xC >= 0 && xC < inDims[1] && xTexelC${colIndex}Ready == 0) { + xTexelC${colIndex} = getX(batch, xR, xC, d1); + if (xC + 1 >= inDims[1]) { + xTexelC${colIndex}.zw = vec2(0.0); + } + xTexelC${colIndex}Ready = 1; + } + + xCOffset = xC + strides[1]; + if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${colIndex + 1}Ready == 0) { + xTexelC${colIndex + 1} = getX(batch, xR, xCOffset, d1); + if (xCOffset + 1 >= inDims[1]) { + xTexelC${colIndex + 1}.zw = vec2(0.); + } + xTexelC${colIndex + 1}Ready = 1; + } + + xC${colIndex} = vec4( + xTexelC${colIndex}.xy, xTexelC${colIndex + 1}.xy); + `; + if (colIndex + 1 < filterWidth) { + mainLoop += ` + xC${colIndex + 1} = vec4(xTexelC${colIndex}.zw, xTexelC${colIndex + 1}.zw); + `; + } + } + } + } + if (colIndex < filterWidth) { + mainLoop += ` + wTexel = getW(${r}, ${colIndex}, d1, q); + dotProd += xC${colIndex} * vec4(wTexel.xz, wTexel.xz); + `; + if (colIndex + 1 < filterWidth) { + mainLoop += ` + wTexel = getW(${r}, ${colIndex + 1}, d1, q); + dotProd += xC${colIndex + 1} * vec4(wTexel.xz, wTexel.xz); + `; + } + } + } + mainLoop += ` + } + `; + } + let activationSnippet = "", applyActivationSnippet = ""; + if (activation2) { + if (hasPreluActivation) { + activationSnippet = `vec4 activation(vec4 a) { + vec4 b = getPreluActivationWeightsAtOutCoords(); + ${activation2} + }`; + } else if (hasLeakyReluAlpha) { + activationSnippet = `vec4 activation(vec4 a) { + vec4 b = getLeakyreluAlphaAtOutCoords(); + ${activation2} + }`; + } else { + activationSnippet = `vec4 activation(vec4 x) { + ${activation2} + }`; + } + applyActivationSnippet = `result = activation(result);`; + } + const addBiasSnippet = addBias ? "result += getBiasAtOutCoords();" : ""; + if (addBias) { + this.variableNames.push("bias"); + } + if (hasPreluActivation) { + this.variableNames.push("preluActivationWeights"); + } + if (hasLeakyReluAlpha) { + this.variableNames.push("leakyreluAlpha"); + } + this.userCode = ` + ${activationSnippet} + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + ivec2 xRCCorner = coords.yz * strides - pads; + int d2 = coords.w; + int d1 = d2 / ${channelMul}; + int q = d2 - d1 * ${channelMul}; + int xRCorner = xRCCorner.x; + int xCCorner = xRCCorner.y; + + //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss. + vec4 dotProd = vec4(0.000000000000001); + + ${mainLoop} + + vec4 result = dotProd - vec4(0.000000000000001); + ${addBiasSnippet} + ${applyActivationSnippet} + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/DepthwiseConv2dNative.js +function depthwiseConv2dNative4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dilations, dimRoundingMode } = attrs; + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad4, dimRoundingMode, true); + let program; + if (env3().getBool("WEBGL_PACK_DEPTHWISECONV") && convInfo.strideWidth <= 2 && convInfo.outChannels / convInfo.inChannels === 1) { + program = new DepthwiseConvPacked2DProgram2(convInfo); + } else { + program = new DepthwiseConv2DProgram2(convInfo); + } + const customValues = [ + [convInfo.padInfo.top, convInfo.padInfo.left], + [convInfo.strideHeight, convInfo.strideWidth], + [convInfo.dilationHeight, convInfo.dilationWidth], + [convInfo.inHeight, convInfo.inWidth] + ]; + return backend4.runWebGLProgram(program, [x, filter], "float32", customValues); +} +var depthwiseConv2dNativeConfig5 = { + kernelName: DepthwiseConv2dNative2, + backendName: "webgl", + kernelFunc: depthwiseConv2dNative4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/conv_backprop_gpu_depthwise.js +var DepthwiseConv2DDerFilterProgram2 = class { + constructor(convInfo) { + this.variableNames = ["x", "dy"]; + this.outputShape = convInfo.filterShape; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const padTop = convInfo.padInfo.top; + const padLeft = convInfo.padInfo.left; + const channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int wR = coords.x; + int wC = coords.y; + int d1 = coords.z; + int dm = coords.w; + int d2 = d1 * ${channelMul} + dm; + + float dotProd = 0.0; + + // TO DO: Vec4 over the batch size + for (int b = 0; b < ${convInfo.batchSize}; b++) { + for (int yR = 0; yR < ${convInfo.outHeight}; yR++) { + int xR = wR + yR * ${strideHeight} - ${padTop}; + + if (xR < 0 || xR >= ${convInfo.inHeight}) { + continue; + } + + for (int yC = 0; yC < ${convInfo.outWidth}; yC++) { + int xC = wC + yC * ${strideWidth} - ${padLeft}; + + if (xC < 0 || xC >= ${convInfo.inWidth}) { + continue; + } + + float dyValue = getDy(b, yR, yC, d2); + float xValue = getX(b, xR, xC, d1); + dotProd += (xValue * dyValue); + } + } + } + setOutput(dotProd); + } + `; + } +}; +var DepthwiseConv2DDerInputProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy", "W"]; + this.outputShape = convInfo.inShape; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const padTop = filterHeight - 1 - convInfo.padInfo.top; + const padLeft = filterWidth - 1 - convInfo.padInfo.left; + const channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = ` + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords[0]; + int d1 = coords[3]; + ivec2 dyCorner = coords.yz - pads; + int dyRCorner = dyCorner.x; + int dyCCorner = dyCorner.y; + + float dotProd = 0.0; + + for (int wR = 0; wR < ${filterHeight}; wR++) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + int wRPerm = ${filterHeight} - 1 - wR; + + for (int wC = 0; wC < ${filterWidth}; wC++) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + int wCPerm = ${filterWidth} - 1 - wC; + + // TO DO: Vec4 over the channelMul + for (int dm = 0; dm < ${channelMul}; dm++) { + int d2 = d1 * ${channelMul} + dm; + float xValue = getDy(batch, idyR, idyC, d2); + float wValue = getW(wRPerm, wCPerm, d1, dm); + dotProd += xValue * wValue; + } + } + } + setOutput(dotProd); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/DepthwiseConv2dNativeBackpropFilter.js +function depthwiseConv2dNativeBackpropFilter6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, dy } = inputs; + const { strides, dilations, pad: pad4, dimRoundingMode, filterShape } = attrs; + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filterShape, strides, dilations, pad4, dimRoundingMode, true); + const program = new DepthwiseConv2DDerFilterProgram2(convInfo); + return backend4.runWebGLProgram(program, [x, dy], "float32"); +} +var depthwiseConv2dNativeBackpropFilterConfig4 = { + kernelName: DepthwiseConv2dNativeBackpropFilter2, + backendName: "webgl", + kernelFunc: depthwiseConv2dNativeBackpropFilter6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/DepthwiseConv2dNativeBackpropInput.js +function depthwiseConv2dNativeBackpropInput6(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, filter } = inputs; + const { strides, dilations, pad: pad4, dimRoundingMode, inputShape } = attrs; + const convInfo = backend_util_exports2.computeConv2DInfo(inputShape, filter.shape, strides, dilations, pad4, dimRoundingMode, true); + const program = new DepthwiseConv2DDerInputProgram2(convInfo); + return backend4.runWebGLProgram(program, [dy, filter], "float32"); +} +var depthwiseConv2dNativeBackpropInputConfig4 = { + kernelName: DepthwiseConv2dNativeBackpropInput2, + backendName: "webgl", + kernelFunc: depthwiseConv2dNativeBackpropInput6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/diag_gpu.js +var DiagProgram2 = class { + constructor(size2) { + this.variableNames = ["X"]; + this.outputShape = [size2, size2]; + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; + setOutput(val); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Diag.js +function diag5(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + const outShape = [...x.shape, ...x.shape]; + const xSize = util_exports2.sizeFromShape(x.shape); + const flat = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: [xSize] } }); + const program = new DiagProgram2(xSize); + const res = backend4.runWebGLProgram(program, [flat], flat.dtype); + const out = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo(flat); + backend4.disposeIntermediateTensorInfo(res); + return out; +} +var diagConfig4 = { + kernelName: Diag2, + backendName: "webgl", + kernelFunc: diag5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/dilation_gpu.js +var Dilation2DProgram2 = class { + constructor(convInfo) { + this.variableNames = ["x", "W"]; + this.outputShape = convInfo.outShape; + const { inHeight, inWidth, padInfo, strideHeight, strideWidth, filterHeight, filterWidth, dilationHeight, dilationWidth } = convInfo; + const { top: padTop, left: padLeft } = padInfo; + this.userCode = ` + const ivec2 strides = ivec2(${strideHeight}, ${strideWidth}); + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + const float neg_infinity = -3.4e38; + + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + int d1 = coords.w; + ivec2 outTopLeftCorner = + coords.yz * strides - pads; + int hBeg = outTopLeftCorner.x; + int wBeg = outTopLeftCorner.y; + + float curVal = neg_infinity; + for (int h = 0; h < ${filterHeight}; h++) { + int hIn = hBeg + h * ${dilationHeight}; + + if (hIn >= 0 && hIn < ${inHeight}) { + for (int w = 0; w < ${filterWidth}; w++) { + int wIn = wBeg + w * ${dilationWidth}; + + if (wIn >= 0 && wIn < ${inWidth}) { + float xVal = getX(batch, hIn, wIn, d1); + float wVal = getW(h, w, d1); + + float val = xVal + wVal; + if (val > curVal) { + curVal = val; + } + } + } + } + } + + float result = curVal; + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Dilation2D.js +function dilation2D2(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter } = inputs; + const { strides, pad: pad4, dilations } = attrs; + const convInfo = backend_util_exports2.computeDilation2DInfo(x.shape, filter.shape, strides, pad4, "NHWC", dilations); + let out; + const program = new Dilation2DProgram2(convInfo); + out = backend4.runWebGLProgram(program, [x, filter], "float32"); + const outReshaped = reshape8({ inputs: { x: out }, backend: backend4, attrs: { shape: convInfo.outShape } }); + backend4.disposeIntermediateTensorInfo(out); + return outReshaped; +} +var dilation2DConfig2 = { + kernelName: Dilation2D2, + backendName: "webgl", + kernelFunc: dilation2D2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Einsum.js +function einsum6(args) { + const { inputs, backend: backend4, attrs } = args; + const { equation } = attrs; + const tensors = inputs; + const { allDims, summedDims, idDims } = backend_util_exports2.decodeEinsumEquation(equation, tensors.length); + backend_util_exports2.checkEinsumDimSizes(allDims.length, idDims, tensors); + const { path, steps } = backend_util_exports2.getEinsumComputePath(summedDims, idDims); + const nSteps = steps.length; + let out = null; + let numDimsRemaining = allDims.length; + const tensorsToDispose = []; + for (let i = 0; i < nSteps; ++i) { + for (const idTerm of steps[i]) { + const { permutationIndices: perm, expandDims: dimsToExpand } = backend_util_exports2.getEinsumPermutation(numDimsRemaining, idDims[idTerm]); + let x; + if (backend_util_exports2.isIdentityPermutation(perm)) { + x = tensors[idTerm]; + } else { + x = transpose7({ inputs: { x: tensors[idTerm] }, backend: backend4, attrs: { perm } }); + tensorsToDispose.push(x); + } + const targetShape = x.shape.slice(); + for (let k = 0; k < dimsToExpand.length; ++k) { + targetShape.splice(dimsToExpand[k], 0, 1); + } + if (!util_exports2.arraysEqual(x.shape, targetShape)) { + x = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: targetShape } }); + tensorsToDispose.push(x); + } + if (out === null) { + out = x; + } else { + out = multiply5({ inputs: { a: x, b: out }, backend: backend4 }); + tensorsToDispose.push(out); + } + } + if (i < nSteps - 1) { + if (path[i] >= 0) { + out = sum9({ + inputs: { x: out }, + backend: backend4, + attrs: { + axis: path[i] - (allDims.length - numDimsRemaining), + keepDims: false + } + }); + tensorsToDispose.push(out); + } + numDimsRemaining--; + } + } + for (const tensorInfo of tensorsToDispose) { + if (tensorInfo === out) { + continue; + } + backend4.disposeIntermediateTensorInfo(tensorInfo); + } + return out; +} +var einsumConfig4 = { + kernelName: Einsum2, + backendName: "webgl", + kernelFunc: einsum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Elu.js +var ELU8 = `return (x >= 0.0) ? x : (exp(x) - 1.0);`; +var ELU_PACKED2 = ` + vec4 result; + + result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); + result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); + result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); + result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); + + return result; +`; +var elu9 = unaryKernelFunc4({ opSnippet: ELU8, packedOpSnippet: ELU_PACKED2 }); +var eluConfig5 = { + kernelName: Elu3, + backendName: "webgl", + kernelFunc: elu9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/EluGrad.js +var ELU_DER2 = `return (b >= 1.0) ? a : a * (b + 1.0);`; +var ELU_DER_PACKED2 = ` + vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); + return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); +`; +var eluGrad4 = (args) => { + const { inputs, backend: backend4 } = args; + const { dy, y } = inputs; + const program = env3().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new BinaryOpPackedProgram2(ELU_DER_PACKED2, dy.shape, y.shape) : new BinaryOpProgram2(ELU_DER2, dy.shape, y.shape); + return backend4.runWebGLProgram(program, [dy, y], dy.dtype); +}; +var eluGradConfig6 = { + kernelName: EluGrad2, + backendName: "webgl", + kernelFunc: eluGrad4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Equal.js +var PACKED_EQUAL2 = ` + return vec4(equal(a, b)); +`; +var EQUAL2 = `return float(a == b);`; +var equal6 = binaryKernelFunc4({ + opSnippet: EQUAL2, + packedOpSnippet: PACKED_EQUAL2, + dtype: "bool", + cpuKernelImpl: equalImplCPU2 +}); +var equalConfig5 = { + kernelName: Equal2, + backendName: "webgl", + kernelFunc: equal6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Erf.js +var ERF2 = ` + // Error function is calculated approximately with elementary function. + // See "Handbook of Mathematical Functions with Formulas, + // Graphs, and Mathematical Tables", Abramowitz and Stegun. + float p = ${backend_util_exports2.ERF_P}; + float a1 = ${backend_util_exports2.ERF_A1}; + float a2 = ${backend_util_exports2.ERF_A2}; + float a3 = ${backend_util_exports2.ERF_A3}; + float a4 = ${backend_util_exports2.ERF_A4}; + float a5 = ${backend_util_exports2.ERF_A5}; + + float sign = sign(x); + x = abs(x); + float t = 1.0 / (1.0 + p * x); + return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); +`; +var erf6 = unaryKernelFunc4({ opSnippet: ERF2 }); +var erfConfig4 = { + kernelName: Erf2, + backendName: "webgl", + kernelFunc: erf6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Exp.js +var EXP2 = `return exp(x);`; +var exp6 = unaryKernelFunc4({ opSnippet: EXP2, packedOpSnippet: EXP2, cpuKernelImpl: expImplCPU2 }); +var expConfig5 = { + kernelName: Exp2, + backendName: "webgl", + kernelFunc: exp6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ExpandDims.js +function expandDims9(args) { + const { inputs, attrs, backend: backend4 } = args; + const { dim } = attrs; + const { input: input3 } = inputs; + const inputRank = input3.shape.length; + const newShape = input3.shape.slice(); + let $dim = dim; + if (dim < 0) { + util_exports2.assert(-(inputRank + 1) <= dim, () => `Axis must be in the interval [${-(inputRank + 1)}, ${inputRank}]`); + $dim = inputRank + dim + 1; + } + newShape.splice($dim, 0, 1); + return reshape8({ inputs: { x: input3 }, backend: backend4, attrs: { shape: newShape } }); +} +var expandDimsConfig5 = { + kernelName: ExpandDims2, + backendName: "webgl", + kernelFunc: expandDims9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Expm1.js +var EXPM12 = `return exp(x) - 1.0;`; +var expm16 = unaryKernelFunc4({ opSnippet: EXPM12, packedOpSnippet: EXPM12, cpuKernelImpl: expm1ImplCPU2 }); +var expm1Config4 = { + kernelName: Expm12, + backendName: "webgl", + kernelFunc: expm16 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/fft_gpu.js +var FFTProgram2 = class { + constructor(component, inputShape, inverse) { + this.variableNames = ["real", "imag"]; + const innerDim = inputShape[1]; + this.outputShape = inputShape; + const exponentMultiplierSnippet = inverse ? `2.0 * ${Math.PI}` : `-2.0 * ${Math.PI}`; + const resultDenominator = inverse ? `${innerDim}.0` : "1.0"; + let opString; + if (component === "real") { + opString = "return real * expR - imag * expI;"; + } else if (component === "imag") { + opString = "return real * expI + imag * expR;"; + } else { + throw new Error(`FFT component must be either "real" or "imag", got ${component}.`); + } + this.userCode = ` + const float exponentMultiplier = ${exponentMultiplierSnippet}; + + float unaryOpComplex(float real, float expR, float imag, float expI) { + ${opString} + } + + float mulMatDFT(int batch, int index) { + float indexRatio = float(index) / float(${innerDim}); + float exponentMultiplierTimesIndexRatio = + exponentMultiplier * indexRatio; + + float result = 0.0; + + for (int i = 0; i < ${innerDim}; i++) { + // x = (-2|2 * PI / N) * index * i; + float x = exponentMultiplierTimesIndexRatio * float(i); + float expR = cos(x); + float expI = sin(x); + float real = getReal(batch, i); + float imag = getImag(batch, i); + + result += + unaryOpComplex(real, expR, imag, expI) / ${resultDenominator}; + } + + return result; + } + + void main() { + ivec2 coords = getOutputCoords(); + setOutput(mulMatDFT(coords[0], coords[1])); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FFT_impl.js +function fftImpl4(x, inverse, backend4) { + const xData = backend4.texData.get(x.dataId); + const inputSize8 = util_exports2.sizeFromShape(x.shape); + const innerDimensionSize = x.shape[x.shape.length - 1]; + const batch = inputSize8 / innerDimensionSize; + const input2D = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: [batch, innerDimensionSize] } }); + const xShape = input2D.shape; + const realProgram = new FFTProgram2("real", xShape, inverse); + const imagProgram = new FFTProgram2("imag", xShape, inverse); + const inputs = [ + { + dataId: xData.complexTensorInfos.real.dataId, + dtype: xData.complexTensorInfos.real.dtype, + shape: xShape + }, + { + dataId: xData.complexTensorInfos.imag.dataId, + dtype: xData.complexTensorInfos.imag.dtype, + shape: xShape + } + ]; + const realPart = backend4.runWebGLProgram(realProgram, inputs, "float32"); + const imagPart = backend4.runWebGLProgram(imagProgram, inputs, "float32"); + const complexOutput = complex6({ inputs: { real: realPart, imag: imagPart }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(imagPart); + const complexOutputReshaped = reshape8({ inputs: { x: complexOutput }, backend: backend4, attrs: { shape: x.shape } }); + backend4.disposeIntermediateTensorInfo(input2D); + backend4.disposeIntermediateTensorInfo(complexOutput); + return complexOutputReshaped; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FFT.js +function fft6(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + return fftImpl4(input3, false, backend4); +} +var fftConfig4 = { + kernelName: FFT2, + backendName: "webgl", + kernelFunc: fft6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/fill_gpu.js +var FillProgram2 = class { + constructor(shape, value) { + this.outputShape = []; + this.customUniforms = [{ name: "value", type: "float" }]; + this.variableNames = ["x"]; + this.outputShape = shape; + this.userCode = ` + void main() { + // Input can be obtained from uniform value. + setOutput(value); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Fill.js +function fill7(args) { + const { backend: backend4, attrs } = args; + const { shape, value } = attrs; + let { dtype } = attrs; + dtype = dtype || util_exports2.inferDtype(value); + if (dtype === "string") { + const values = util_exports2.getArrayFromDType(dtype, util_exports2.sizeFromShape(shape)); + values.fill(value); + return backend4.makeTensorInfo(shape, dtype, values); + } else { + const program = new FillProgram2(shape, value); + const customValues = [[value]]; + return backend4.runWebGLProgram(program, [], dtype, customValues); + } +} +var fillConfig5 = { + kernelName: Fill2, + backendName: "webgl", + kernelFunc: fill7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/flip_left_right_gpu.js +var FlipLeftRightProgram2 = class { + constructor(imageShape) { + this.variableNames = ["Image"]; + this.outputShape = []; + const imageWidth = imageShape[2]; + this.outputShape = imageShape; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int x = coords[2]; + + int coordX = ${imageWidth} - x - 1; + float outputValue; + if(coordX >= 0 && coordX < ${imageWidth}) { + outputValue = getImage(coords[0], coords[1], coordX, coords[3]); + } else { + outputValue = getImage(coords[0], coords[1], coords[2], coords[3]); + } + setOutput(outputValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FlipLeftRight.js +var flipLeftRightConfig5 = { + kernelName: FlipLeftRight2, + backendName: "webgl", + kernelFunc: ({ inputs, backend: backend4 }) => { + const { image: image9 } = inputs; + const webglBackend = backend4; + const program = new FlipLeftRightProgram2(image9.shape); + const output = webglBackend.runWebGLProgram(program, [image9], image9.dtype); + return output; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Floor.js +var FLOOR2 = `return floor(x);`; +var floor6 = unaryKernelFunc4({ opSnippet: FLOOR2, packedOpSnippet: FLOOR2, cpuKernelImpl: floorImplCPU2 }); +var floorConfig5 = { + kernelName: Floor2, + backendName: "webgl", + kernelFunc: floor6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FloorDiv.js +var INT_DIV2 = ` + float s = sign(a) * sign(b); + int ia = round(a); + int ib = round(b); + if (ib != 0) { + // Windows (D3D) wants guaranteed non-zero int division at compile-time. + return float(idiv(ia, ib, s)); + } else { + return NAN; + } +`; +var INT_DIV_PACKED2 = ` + ivec4 ia = round(a); + ivec4 ib = round(b); + bvec4 cond = notEqual(ib, ivec4(0)); + ivec4 result = ivec4(0); + vec4 s = sign(a) * sign(b); + + // Windows (D3D) wants guaranteed non-zero int division at compile-time. + if (cond[0]) { + result[0] = idiv(ia[0], ib[0], s[0]); + } + if (cond[1]) { + result[1] = idiv(ia[1], ib[1], s[1]); + } + if (cond[2]) { + result[2] = idiv(ia[2], ib[2], s[2]); + } + if (cond[3]) { + result[3] = idiv(ia[3], ib[3], s[3]); + } + return vec4(result); +`; +var floorDiv6 = binaryKernelFunc4({ opSnippet: INT_DIV2, packedOpSnippet: INT_DIV_PACKED2, dtype: "int32" }); +var floorDivConfig5 = { + kernelName: FloorDiv2, + backendName: "webgl", + kernelFunc: floorDiv6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FromPixels_utils/from_pixels_gpu.js +var FromPixelsProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + const glsl = getGlslDifferences2(); + const [height, width] = outputShape; + this.outputShape = outputShape; + this.userCode = ` + void main() { + ivec3 coords = getOutputCoords(); + int texR = coords[0]; + int texC = coords[1]; + int depth = coords[2]; + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${width}.0, ${height}.0); + + vec4 values = ${glsl.texture2D}(A, uv); + float value; + if (depth == 0) { + value = values.r; + } else if (depth == 1) { + value = values.g; + } else if (depth == 2) { + value = values.b; + } else if (depth == 3) { + value = values.a; + } + + setOutput(floor(value * 255.0 + 0.5)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FromPixels_utils/from_pixels_packed_gpu.js +var FromPixelsPackedProgram2 = class { + constructor(outputShape) { + this.variableNames = ["A"]; + this.packedInputs = false; + this.packedOutput = true; + const glsl = getGlslDifferences2(); + const [height, width] = outputShape; + this.outputShape = outputShape; + this.userCode = ` + void main() { + ivec3 coords = getOutputCoords(); + int texR = coords[0]; + int texC = coords[1]; + int depth = coords[2]; + + vec4 result = vec4(0.); + + for(int row=0; row<=1; row++) { + for(int col=0; col<=1; col++) { + texC = coords[1] + row; + depth = coords[2] + col; + + vec2 uv = (vec2(texC, texR) + halfCR) / + vec2(${width}.0, ${height}.0); + vec4 values = ${glsl.texture2D}(A, uv); + float value; + if (depth == 0) { + value = values.r; + } else if (depth == 1) { + value = values.g; + } else if (depth == 2) { + value = values.b; + } else if (depth == 3) { + value = values.a; + } + + result[row * 2 + col] = floor(value * 255.0 + 0.5); + } + } + + ${glsl.output} = result; + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FromPixels.js +var fromPixelsConfig2 = { + kernelName: FromPixels2, + backendName: "webgl", + kernelFunc: fromPixels3 +}; +var fromPixels2DContext3; +function fromPixels3(args) { + const { inputs, backend: backend4, attrs } = args; + let { pixels } = inputs; + const { numChannels } = attrs; + const isVideo = typeof HTMLVideoElement !== "undefined" && pixels instanceof HTMLVideoElement; + const isImage = typeof HTMLImageElement !== "undefined" && pixels instanceof HTMLImageElement; + const [width, height] = isVideo ? [ + pixels.videoWidth, + pixels.videoHeight + ] : [pixels.width, pixels.height]; + const texShape = [height, width]; + const outShape = [height, width, numChannels]; + if (isImage || isVideo) { + if (fromPixels2DContext3 == null) { + fromPixels2DContext3 = document.createElement("canvas").getContext("2d"); + } + fromPixels2DContext3.canvas.width = width; + fromPixels2DContext3.canvas.height = height; + fromPixels2DContext3.drawImage(pixels, 0, 0, width, height); + pixels = fromPixels2DContext3.canvas; + } + const tempPixelHandle = backend4.makeTensorInfo(texShape, "int32"); + backend4.texData.get(tempPixelHandle.dataId).usage = TextureUsage2.PIXELS; + backend4.gpgpu.uploadPixelDataToTexture(backend4.getTexture(tempPixelHandle.dataId), pixels); + const program = env3().getBool("WEBGL_PACK") ? new FromPixelsPackedProgram2(outShape) : new FromPixelsProgram2(outShape); + const res = backend4.runWebGLProgram(program, [tempPixelHandle], "int32"); + backend4.disposeData(tempPixelHandle.dataId); + return res; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FusedConv2D.js +function fusedConv2d3(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter, bias, preluActivationWeights } = inputs; + const { strides, pad: pad4, dataFormat, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const $dataFormat = backend_util_exports2.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad4, dimRoundingMode, false, $dataFormat); + let out; + const intermediates = []; + if (convInfo.filterHeight === 1 && convInfo.filterWidth === 1 && convInfo.dilationHeight === 1 && convInfo.dilationWidth === 1 && convInfo.strideHeight === 1 && convInfo.strideWidth === 1 && (convInfo.padInfo.type === "SAME" || convInfo.padInfo.type === "VALID")) { + out = conv2dByMatMul2({ + x, + filter, + convInfo, + backend: backend4, + bias, + activation: activation2, + preluActivationWeights, + leakyreluAlpha + }); + } else if (env3().getBool("WEBGL_CONV_IM2COL") && x.shape[0] === 1) { + out = conv2dWithIm2Row2({ + x, + filter, + convInfo, + backend: backend4, + bias, + activation: activation2, + preluActivationWeights, + leakyreluAlpha + }); + } else { + const hasBias = bias != null; + const hasPreluActivationWeights = preluActivationWeights != null; + const hasLeakyreluAlpha = activation2 === "leakyrelu"; + const fusedActivation = activation2 ? mapActivationToShaderProgram2(activation2, false) : null; + const program = new Conv2DProgram2(convInfo, hasBias, fusedActivation, hasPreluActivationWeights, hasLeakyreluAlpha); + const inputs2 = [x, filter]; + if (bias) { + inputs2.push(bias); + } + if (preluActivationWeights) { + inputs2.push(preluActivationWeights); + } + if (hasLeakyreluAlpha) { + const $leakyreluAlpha = backend4.makeTensorInfo([], "float32", util_exports2.createScalarValue(leakyreluAlpha, "float32")); + inputs2.push($leakyreluAlpha); + intermediates.push($leakyreluAlpha); + } + out = backend4.runWebGLProgram(program, inputs2, "float32"); + } + const outReshaped = reshape8({ inputs: { x: out }, backend: backend4, attrs: { shape: convInfo.outShape } }); + intermediates.push(out); + intermediates.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return outReshaped; +} +var fusedConv2DConfig5 = { + kernelName: FusedConv2D2, + backendName: "webgl", + kernelFunc: fusedConv2d3 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/FusedDepthwiseConv2D.js +function fusedDepthwiseConv2D4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, filter, bias, preluActivationWeights } = inputs; + const { strides, pad: pad4, dilations, dimRoundingMode, activation: activation2, leakyreluAlpha } = attrs; + const intermediates = []; + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, $dilations), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${strides} and dilations '${$dilations}'`); + const convInfo = backend_util_exports2.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad4, dimRoundingMode, true); + const shouldPackDepthwiseConv = env3().getBool("WEBGL_PACK_DEPTHWISECONV") && convInfo.strideWidth <= 2 && convInfo.outChannels / convInfo.inChannels === 1; + const fusedActivation = activation2 ? mapActivationToShaderProgram2(activation2, shouldPackDepthwiseConv) : null; + const programInputs = [x, filter]; + const hasBias = bias != null; + const hasPreluActivationWeights = preluActivationWeights != null; + const hasLeakyreluAlpha = activation2 === "leakyrelu"; + if (hasBias) { + programInputs.push(bias); + } + if (hasPreluActivationWeights) { + programInputs.push(preluActivationWeights); + } + if (hasLeakyreluAlpha) { + const $leakyreluAlpha = backend4.makeTensorInfo([], "float32", util_exports2.createScalarValue(leakyreluAlpha, "float32")); + programInputs.push($leakyreluAlpha); + intermediates.push($leakyreluAlpha); + } + let program; + if (shouldPackDepthwiseConv) { + program = new DepthwiseConvPacked2DProgram2(convInfo, hasBias, fusedActivation, hasPreluActivationWeights, hasLeakyreluAlpha); + } else { + program = new DepthwiseConv2DProgram2(convInfo, hasBias, fusedActivation, hasPreluActivationWeights, hasLeakyreluAlpha); + } + const customValues = [ + [convInfo.padInfo.top, convInfo.padInfo.left], + [convInfo.strideHeight, convInfo.strideWidth], + [convInfo.dilationHeight, convInfo.dilationWidth], + [convInfo.inHeight, convInfo.inWidth] + ]; + const result = backend4.runWebGLProgram(program, programInputs, "float32", customValues); + intermediates.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var fusedDepthwiseConv2DConfig5 = { + kernelName: FusedDepthwiseConv2D2, + backendName: "webgl", + kernelFunc: fusedDepthwiseConv2D4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/gather_nd_gpu.js +var GatherNDProgram2 = class { + constructor(sliceDim, strides, shape) { + this.sliceDim = sliceDim; + this.strides = strides; + this.variableNames = ["x", "indices"]; + this.outputShape = shape; + const stridesType = getCoordsDataType2(strides.length); + const dtype = getCoordsDataType2(shape.length); + const strideString = this.sliceDim > 1 ? "strides[j]" : "strides"; + this.userCode = ` + ${stridesType} strides = ${stridesType}(${this.strides}); + void main() { + ${dtype} coords = getOutputCoords(); + int flattenIndex = 0; + for (int j = 0; j < ${this.sliceDim}; j++) { + int index = round(getIndices(coords[0], j)); + flattenIndex += index * ${strideString}; + } + setOutput(getX(flattenIndex, coords[1])); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/GatherNd.js +function gatherNd5(args) { + const { inputs, backend: backend4 } = args; + const { params, indices } = inputs; + const indicesShape = indices.shape; + const sliceRank = indicesShape[indicesShape.length - 1]; + const paramsSize = util_exports2.sizeFromShape(params.shape); + const [resultShape, numSlices, sliceSize, strides] = backend_util_exports2.prepareAndValidate(params, indices); + const flattenIndices = reshape8({ inputs: { x: indices }, backend: backend4, attrs: { shape: [numSlices, sliceRank] } }); + const flattenX = reshape8({ + inputs: { x: params }, + backend: backend4, + attrs: { shape: [util_exports2.sizeFromShape(params.shape) / sliceSize, sliceSize] } + }); + if (backend4.shouldExecuteOnCPU([params, indices]) || params.dtype === "string") { + const indicesData = backend4.readSync(indices.dataId); + const paramsBuf = backend4.bufferSync(params); + const outValue = gatherNdImplCPU2(indicesData, paramsBuf, params.dtype, numSlices, sliceRank, sliceSize, strides, params.shape, paramsSize); + return backend4.makeTensorInfo(resultShape, params.dtype, outValue.values); + } + const program = new GatherNDProgram2(sliceRank, strides, [numSlices, sliceSize]); + const res = backend4.runWebGLProgram(program, [flattenX, flattenIndices], flattenX.dtype); + const reshaped = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape: resultShape } }); + backend4.disposeIntermediateTensorInfo(flattenIndices); + backend4.disposeIntermediateTensorInfo(flattenX); + backend4.disposeIntermediateTensorInfo(res); + return reshaped; +} +var gatherNdConfig5 = { + kernelName: GatherNd2, + backendName: "webgl", + kernelFunc: gatherNd5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/gather_gpu.js +var GatherProgram2 = class { + constructor(aShape, outputShape) { + this.variableNames = ["A", "indices"]; + this.outputShape = outputShape; + this.rank = outputShape.length; + const dtype = getCoordsDataType2(this.rank); + const sourceCoords = getSourceCoords5(aShape, 2); + this.userCode = ` + void main() { + ${dtype} resRC = getOutputCoords(); + setOutput(getA(${sourceCoords})); + } + `; + } +}; +function getSourceCoords5(aShape, axis) { + const currentCoords = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"]; + const sourceCoords = []; + for (let i = 0; i < aShape.length; i++) { + if (i === 2) { + sourceCoords.push("int(getIndices(resRC.x, resRC.z))"); + } else { + sourceCoords.push(`${currentCoords[i]}`); + } + } + return sourceCoords.join(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/GatherV2.js +function gatherV25(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, indices } = inputs; + const { axis, batchDims } = attrs; + const parsedAxis = util_exports2.parseAxisParam(axis, x.shape)[0]; + const shapeInfo = backend_util_exports2.segment_util.collectGatherOpShapeInfo(x, indices, parsedAxis, batchDims); + const indicesSize = util_exports2.sizeFromShape(indices.shape); + const toDispose = []; + const flattenX = reshape8({ + inputs: { x }, + backend: backend4, + attrs: { + shape: [ + shapeInfo.batchSize, + shapeInfo.outerSize, + shapeInfo.dimSize, + shapeInfo.sliceSize + ] + } + }); + const flattenIndex = reshape8({ + inputs: { x: indices }, + backend: backend4, + attrs: { shape: [shapeInfo.batchSize, indicesSize / shapeInfo.batchSize] } + }); + toDispose.push(flattenX); + toDispose.push(flattenIndex); + const flattenOutputShape = [ + shapeInfo.batchSize, + shapeInfo.outerSize, + indicesSize / shapeInfo.batchSize, + shapeInfo.sliceSize + ]; + if (backend4.shouldExecuteOnCPU([x, indices]) || x.dtype === "string") { + const indicesBuf = backend4.bufferSync(flattenIndex); + const xBuf = backend4.bufferSync(flattenX); + const outBuf = gatherV2ImplCPU2(xBuf, indicesBuf, flattenOutputShape); + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return backend4.makeTensorInfo(shapeInfo.outputShape, outBuf.dtype, outBuf.values); + } + const program = new GatherProgram2(flattenX.shape, flattenOutputShape); + const res = backend4.runWebGLProgram(program, [flattenX, flattenIndex], flattenX.dtype); + toDispose.push(res); + const reshaped = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape: shapeInfo.outputShape } }); + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return reshaped; +} +var gatherV2Config5 = { + kernelName: GatherV22, + backendName: "webgl", + kernelFunc: gatherV25 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Greater.js +var GREATER2 = `return float(a > b);`; +var GREATER_PACKED2 = ` + return vec4(greaterThan(a, b)); +`; +var greater7 = binaryKernelFunc4({ + opSnippet: GREATER2, + packedOpSnippet: GREATER_PACKED2, + cpuKernelImpl: greaterImplCPU2, + dtype: "bool" +}); +var greaterConfig5 = { + kernelName: Greater2, + backendName: "webgl", + kernelFunc: greater7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/GreaterEqual.js +var GREATER_EQUAL2 = `return float(a >= b);`; +var GREATER_EQUAL_PACKED2 = ` + return vec4(greaterThanEqual(a, b)); +`; +var greaterEqual6 = binaryKernelFunc4({ + opSnippet: GREATER_EQUAL2, + packedOpSnippet: GREATER_EQUAL_PACKED2, + dtype: "bool", + cpuKernelImpl: greaterEqualImplCPU2 +}); +var greaterEqualConfig5 = { + kernelName: GreaterEqual2, + backendName: "webgl", + kernelFunc: greaterEqual6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/IFFT.js +function ifft6(args) { + const { inputs, backend: backend4 } = args; + const { input: input3 } = inputs; + return fftImpl4(input3, true, backend4); +} +var ifftConfig4 = { + kernelName: IFFT2, + backendName: "webgl", + kernelFunc: ifft6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/IsFinite.js +var IS_FINITE2 = `return float(!isnan(x) && !isinf(x));`; +var isFinite7 = unaryKernelFunc4({ opSnippet: IS_FINITE2, dtype: "bool" }); +var isFiniteConfig4 = { + kernelName: IsFinite2, + backendName: "webgl", + kernelFunc: isFinite7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/IsInf.js +var IS_INF2 = `return float(isinf(x));`; +var isInf6 = unaryKernelFunc4({ opSnippet: IS_INF2, dtype: "bool" }); +var isInfConfig4 = { + kernelName: IsInf2, + backendName: "webgl", + kernelFunc: isInf6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/IsNaN.js +var IS_NAN2 = `return float(isnan(x));`; +var isNaN7 = unaryKernelFunc4({ opSnippet: IS_NAN2, dtype: "bool" }); +var isNaNConfig4 = { + kernelName: IsNan2, + backendName: "webgl", + kernelFunc: isNaN7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Less.js +var LESS2 = `return float(a < b);`; +var LESS_PACKED2 = ` + return vec4(lessThan(a, b)); +`; +var less7 = binaryKernelFunc4({ + opSnippet: LESS2, + packedOpSnippet: LESS_PACKED2, + cpuKernelImpl: lessImplCPU2, + dtype: "bool" +}); +var lessConfig5 = { + kernelName: Less2, + backendName: "webgl", + kernelFunc: less7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LessEqual.js +var LESS_EQUAL2 = `return float(a <= b);`; +var LESS_EQUAL_PACKED2 = ` + return vec4(lessThanEqual(a, b)); +`; +var lessEqual6 = binaryKernelFunc4({ + opSnippet: LESS_EQUAL2, + packedOpSnippet: LESS_EQUAL_PACKED2, + cpuKernelImpl: lessEqualImplCPU2, + dtype: "bool" +}); +var lessEqualConfig5 = { + kernelName: LessEqual2, + backendName: "webgl", + kernelFunc: lessEqual6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LinSpace.js +function linSpace4(args) { + const { backend: backend4, attrs } = args; + const { start, stop, num } = attrs; + const outVals = linSpaceImplCPU2(start, stop, num); + return backend4.makeTensorInfo([outVals.length], "float32", outVals); +} +var linSpaceConfig4 = { + kernelName: LinSpace2, + backendName: "webgl", + kernelFunc: linSpace4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Log.js +var LOG2 = `if (x < 0.0) return NAN; + return log(x);`; +var LOG_PACKED2 = ` + vec4 result = log(x); + vec4 isNaN = vec4(lessThan(x, vec4(0.0))); + result.r = isNaN.r == 1.0 ? NAN : result.r; + result.g = isNaN.g == 1.0 ? NAN : result.g; + result.b = isNaN.b == 1.0 ? NAN : result.b; + result.a = isNaN.a == 1.0 ? NAN : result.a; + + return result; +`; +var log12 = unaryKernelFunc4({ opSnippet: LOG2, packedOpSnippet: LOG_PACKED2, cpuKernelImpl: logImplCPU2 }); +var logConfig5 = { + kernelName: Log2, + backendName: "webgl", + kernelFunc: log12 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Log1p.js +var LOG1P2 = `return log(1.0 + x);`; +var log1p6 = unaryKernelFunc4({ opSnippet: LOG1P2 }); +var log1pConfig4 = { + kernelName: Log1p2, + backendName: "webgl", + kernelFunc: log1p6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LogicalAnd.js +var LOGICAL_AND2 = `return float(a >= 1.0 && b >= 1.0);`; +var LOGICAL_AND_PACKED2 = ` + return vec4( + vec4(greaterThanEqual(a, vec4(1.0))) * + vec4(greaterThanEqual(b, vec4(1.0)))); +`; +var logicalAnd6 = binaryKernelFunc4({ + opSnippet: LOGICAL_AND2, + packedOpSnippet: LOGICAL_AND_PACKED2, + dtype: "bool" +}); +var logicalAndConfig5 = { + kernelName: LogicalAnd2, + backendName: "webgl", + kernelFunc: logicalAnd6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LogicalNot.js +var LOGICAL_NOT2 = `return float(!(x >= 1.0));`; +var logicalNot6 = unaryKernelFunc4({ opSnippet: LOGICAL_NOT2 }); +var logicalNotConfig4 = { + kernelName: LogicalNot2, + backendName: "webgl", + kernelFunc: logicalNot6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LogicalOr.js +var LOGICAL_OR2 = `return float(a >= 1.0 || b >= 1.0);`; +var LOGICAL_OR_PACKED2 = ` + return min( + vec4(greaterThanEqual(a, vec4(1.0))) + + vec4(greaterThanEqual(b, vec4(1.0))), + vec4(1.0)); +`; +var logicalOr6 = binaryKernelFunc4({ opSnippet: LOGICAL_OR2, packedOpSnippet: LOGICAL_OR_PACKED2, dtype: "bool" }); +var logicalOrConfig4 = { + kernelName: LogicalOr2, + backendName: "webgl", + kernelFunc: logicalOr6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/lrn_gpu.js +var LRNProgram2 = class { + constructor(xShape, radius, bias, alpha, beta) { + this.variableNames = ["x"]; + this.outputShape = []; + const rad = radius; + const maxD = xShape[3] - 1; + this.outputShape = xShape; + let powOperator; + const basis = `float(${bias}) + float(${alpha}) * sum`; + if (beta === 0.5) { + powOperator = `inversesqrt(${basis})`; + } else if (beta === 1) { + powOperator = `1.0/(${basis})`; + } else { + powOperator = `exp(log(${basis}) * float(-${beta}));`; + } + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int r = coords[1]; + int c = coords[2]; + int d = coords[3]; + float x = getX(b, r, c, d); + float sum = 0.0; + for (int j = -${rad}; j <= ${rad}; j++) { + int idx = d + j; + if (idx >= 0 && idx <= ${maxD}) { + float z = getX(b, r, c, idx); + sum += z * z; + } + } + float val = x * ${powOperator}; + setOutput(val); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/lrn_packed_gpu.js +var LRNPackedProgram2 = class { + constructor(xShape, radius, bias, alpha, beta) { + this.variableNames = ["x"]; + this.outputShape = []; + this.packedInputs = true; + this.packedOutput = true; + const rad = radius; + const maxD = xShape[3] - 1; + this.outputShape = xShape; + let powOperator; + const basis = `float(${bias}) + float(${alpha}) * sum`; + if (beta === 0.5) { + powOperator = `inversesqrt(${basis})`; + } else if (beta === 1) { + powOperator = `1.0/(${basis})`; + } else { + powOperator = `exp(log(${basis}) * float(-${beta}));`; + } + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords.x; + int r = coords.y; + int c = coords.z; + int d = coords.w; + + bool hasNextCol = d < ${this.outputShape[3]}; + bool hasNextRow = c < ${this.outputShape[2]}; + + vec4 sum = vec4(0.); + vec4 xFragAtOutputCoords = getX(b, r, c, d); + + vec4 xAtOutputCoords = vec4( + getChannel(xFragAtOutputCoords, vec2(c, d)), + hasNextCol ? + getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0, + hasNextRow ? + getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0, + (hasNextRow && hasNextCol) ? + getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0 + ); + + int firstChannel = d - ${rad}; + vec2 cache = vec2(0.); + if(firstChannel >= 0){ + vec4 firstChannelFrag = getX(b, r, c, firstChannel); + cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel)); + if(hasNextRow){ + cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel)); + } + } + + ivec2 depth = ivec2(d, d + 1); + for (int j = - ${rad}; j <= ${rad}; j++) { + ivec2 idx = depth + j; + bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0)); + bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${maxD})); + + bool depthInRange = aboveLowerBound.x && belowUpperBound.x; + bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y; + + if(depthInRange || depthPlusOneInRange){ + vec4 z = vec4(0.); + vec4 xFragAtCurrentDepth; + z.xz = cache.xy; + if(depthPlusOneInRange && hasNextCol){ + xFragAtCurrentDepth = idx.y != d ? + getX(b, r, c, idx.y) : xFragAtOutputCoords; + z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y)); + if(hasNextRow){ + z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y)); + } + } + cache.xy = z.yw; + sum += z * z; + } + } + vec4 result = xAtOutputCoords * ${powOperator}; + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LRN.js +var lrn2 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { depthRadius, bias, alpha, beta } = attrs; + const program = env3().getBool("WEBGL_PACK_NORMALIZATION") ? new LRNPackedProgram2(x.shape, depthRadius, bias, alpha, beta) : new LRNProgram2(x.shape, depthRadius, bias, alpha, beta); + return backend4.runWebGLProgram(program, [x], x.dtype); +}; +var LRNConfig2 = { + kernelName: LRN2, + backendName: "webgl", + kernelFunc: lrn2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/lrn_grad_gpu.js +var LRNGradProgram2 = class { + constructor(inputShape, depthRadius, bias, alpha, beta) { + this.variableNames = ["inputImage", "outputImage", "dy"]; + this.outputShape = []; + this.outputShape = inputShape; + this.depth = inputShape[3]; + this.depthRadius = depthRadius; + this.bias = bias; + this.alpha = alpha; + this.beta = beta; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int r = coords[1]; + int c = coords[2]; + + float result = 0.0; + for (int d = 0; d < ${this.depth}; ++d) { + int depthBegin = int(max(0.0, float(d - ${depthRadius}))); + int depthEnd = int(min(float(${this.depth}), + float(d + ${depthRadius} + 1))); + + const int MIN_DEPTH_BEGIN = 0; + const int MAX_DEPTH_END = ${this.depth}; + + float norm = 0.0; + for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) { + if (k < depthBegin){ + continue; + } + else if (k >= depthBegin && k < depthEnd) { + norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k); + } + else { + break; + } + } + + norm = float(${alpha}) * norm + float(${bias}); + + for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ + if (k < depthBegin){ + continue; + } + else if (k >= depthBegin && k < depthEnd){ + float dyi = -2.0 * float(${alpha}) + * float(${beta}) + * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d) + / norm; + if (k == d) { + dyi += pow(norm, -1.0 * ${beta}); + } + if (k == coords[3]) { + dyi *= getDy(b, r, c, d); + result += dyi; + } + } + else { + break; + } + } + } + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/LRNGrad.js +var lrnGrad2 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { x, y, dy } = inputs; + const { depthRadius, bias, alpha, beta } = attrs; + const program = new LRNGradProgram2(x.shape, depthRadius, bias, alpha, beta); + return backend4.runWebGLProgram(program, [x, y, dy], x.dtype); +}; +var LRNGradConfig2 = { + kernelName: LRNGrad2, + backendName: "webgl", + kernelFunc: lrnGrad2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Max_impl.js +function maxImpl4(x, reduceShape, outShape, backend4) { + const inSize = util_exports2.sizeFromShape(reduceShape); + const xSize = util_exports2.sizeFromShape(x.shape); + const batchSize = xSize / inSize; + const reshapedInput = reshape8({ inputs: { x }, attrs: { shape: [batchSize, inSize] }, backend: backend4 }); + const reduced = reduce2(reshapedInput, x.dtype, "max", backend4); + const reshapedOutput = reshape8({ inputs: { x: reduced }, attrs: { shape: outShape }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(reshapedInput); + backend4.disposeIntermediateTensorInfo(reduced); + return reshapedOutput; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Max.js +function max9(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { reductionIndices, keepDims } = attrs; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(reductionIndices, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + const maxInputIsTransposed = permutedAxes != null; + const shouldExecuteOnCPU = backend4.shouldExecuteOnCPU([x]); + let maxInput = x; + if (maxInputIsTransposed) { + if (shouldExecuteOnCPU) { + const xTexData = backend4.texData.get(maxInput.dataId); + const values = xTexData.values; + const newShape = new Array(xRank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[permutedAxes[i]]; + } + const maxInputValues = transposeImplCPU2(values, x.shape, x.dtype, permutedAxes, newShape); + maxInput = backend4.makeTensorInfo(newShape, x.dtype); + const maxInputData = backend4.texData.get(maxInput.dataId); + maxInputData.values = maxInputValues; + } else { + maxInput = transposeImpl4(x, permutedAxes, backend4); + } + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("max", axes, xRank); + const [maxOutShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(maxInput.shape, axes); + let outShape = maxOutShape; + if (keepDims) { + outShape = backend_util_exports2.expandShapeToKeepDim(maxOutShape, origAxes); + } + let out; + if (shouldExecuteOnCPU) { + const xTexData = backend4.texData.get(maxInput.dataId); + const values = xTexData.values; + const outValues = maxImplCPU2(values, util_exports2.sizeFromShape(reduceShape), outShape, x.dtype); + out = backend4.makeTensorInfo(outShape, x.dtype); + const outData = backend4.texData.get(out.dataId); + outData.values = outValues; + } else { + out = maxImpl4(maxInput, reduceShape, outShape, backend4); + } + if (maxInputIsTransposed) { + backend4.disposeIntermediateTensorInfo(maxInput); + } + return out; +} +var maxConfig5 = { + kernelName: Max2, + backendName: "webgl", + kernelFunc: max9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Maximum.js +var MAXIMUM2 = CHECK_NAN_SNIPPET5 + ` + return max(a, b); +`; +var MAXIMUM_PACKED2 = ` + vec4 result = vec4(max(a, b)); + vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); + ` + CHECK_NAN_SNIPPET6 + ` + return result; +`; +var maximum7 = binaryKernelFunc4({ + opSnippet: MAXIMUM2, + packedOpSnippet: MAXIMUM_PACKED2, + cpuKernelImpl: maximumImplCPU2 +}); +var maximumConfig5 = { + kernelName: Maximum3, + backendName: "webgl", + kernelFunc: maximum7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPool.js +function maxPool7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + assertNotComplex4(x, "maxPool"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = 1; + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 && util_exports2.arraysEqual(convInfo.inShape, convInfo.outShape)) { + return identity6({ inputs: { x }, backend: backend4 }); + } + const maxPoolProgram = new Pool2DProgram2(convInfo, "max", false); + return backend4.runWebGLProgram(maxPoolProgram, [x], x.dtype); +} +var maxPoolConfig5 = { + kernelName: MaxPool2, + backendName: "webgl", + kernelFunc: maxPool7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPool3D.js +function maxPool3d4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { filterSize, strides, pad: pad4, dataFormat, dimRoundingMode } = attrs; + const dilations = [1, 1, 1]; + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode, dataFormat); + const maxPoolProgram = new Pool3DProgram2(convInfo, "max", false); + return backend4.runWebGLProgram(maxPoolProgram, [x], x.dtype); +} +var maxPool3DConfig4 = { + kernelName: MaxPool3D2, + backendName: "webgl", + kernelFunc: maxPool3d4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/max_pool_backprop_gpu.js +var MaxPool2DBackpropProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy", "maxPos"]; + this.outputShape = convInfo.inShape; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationHeight = convInfo.dilationHeight; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const lastIndex = effectiveFilterHeight * effectiveFilterWidth - 1; + this.userCode = ` + const ivec2 pads = ivec2(${padTop}, ${padLeft}); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + + ivec2 dyRCCorner = coords.yz - pads; + int dyRCorner = dyRCCorner.x; + int dyCCorner = dyRCCorner.y; + + // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${effectiveFilterWidth}; wC++) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(b, idyR, idyC, d); + int maxPosValue = ${lastIndex} - int(getMaxPos(b, idyR, idyC, d)); + + // Get the current value, check it against the value from the + // position matrix. + int curPosValue = wR * ${effectiveFilterWidth} + wC; + float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); + + dotProd += dyValue * mask; + } + } + setOutput(dotProd); + } + `; + } +}; +var MaxPool3DBackpropProgram2 = class { + constructor(convInfo) { + this.variableNames = ["dy", "maxPos"]; + this.outputShape = convInfo.inShape; + const strideDepth = convInfo.strideDepth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const dilationDepth = convInfo.dilationDepth; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const effectiveFilterDepth = convInfo.effectiveFilterDepth; + const effectiveFilterHeight = convInfo.effectiveFilterHeight; + const effectiveFilterWidth = convInfo.effectiveFilterWidth; + const padFront = effectiveFilterDepth - 1 - convInfo.padInfo.front; + const padTop = effectiveFilterHeight - 1 - convInfo.padInfo.top; + const padLeft = effectiveFilterWidth - 1 - convInfo.padInfo.left; + const lastIndex = effectiveFilterDepth * effectiveFilterHeight * effectiveFilterWidth - 1; + this.userCode = ` + const ivec3 pads = ivec3(${padFront}, ${padTop}, ${padLeft}); + + void main() { + ivec5 coords = getOutputCoords(); + int batch = coords.x; + int ch = coords.u; + + ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; + int dyDCorner = dyCorner.x; + int dyRCorner = dyCorner.y; + int dyCCorner = dyCorner.z; + + // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get + // dx(xD, xR, xC, ch). + // ? = to be determined. : = across all values in that axis. + float dotProd = 0.0; + + for (int wD = 0; wD < ${effectiveFilterDepth}; + wD += ${dilationDepth}) { + float dyD = float(dyDCorner + wD) / ${strideDepth}.0; + + if (dyD < 0.0 || dyD >= ${convInfo.outDepth}.0 || fract(dyD) > 0.0) { + continue; + } + int idyD = int(dyD); + + for (int wR = 0; wR < ${effectiveFilterHeight}; + wR += ${dilationHeight}) { + float dyR = float(dyRCorner + wR) / ${strideHeight}.0; + + if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || + fract(dyR) > 0.0) { + continue; + } + int idyR = int(dyR); + + for (int wC = 0; wC < ${effectiveFilterWidth}; + wC += ${dilationWidth}) { + float dyC = float(dyCCorner + wC) / ${strideWidth}.0; + + if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 || + fract(dyC) > 0.0) { + continue; + } + int idyC = int(dyC); + + float dyValue = getDy(batch, idyD, idyR, idyC, ch); + int maxPosValue = ${lastIndex} - + int(getMaxPos(batch, idyD, idyR, idyC, ch)); + + // Get the current value, check it against the value from the + // position matrix. + int curPosValue = + wD * ${effectiveFilterHeight} * ${effectiveFilterWidth} + + wR * ${effectiveFilterWidth} + wC; + float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); + + dotProd += dyValue * mask; + } + } + } + setOutput(dotProd); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPool3DGrad.js +function maxPool3DGrad4(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3 } = inputs; + const x = input3; + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const dilations = [1, 1, 1]; + const convInfo = backend_util_exports2.computePool3DInfo(x.shape, filterSize, strides, dilations, pad4, dimRoundingMode); + const maxPool3dPositionsProgram = new Pool3DProgram2(convInfo, "max", true); + const maxPool3dPositions3 = backend4.runWebGLProgram(maxPool3dPositionsProgram, [x], x.dtype); + const maxPoolBackpropProgram = new MaxPool3DBackpropProgram2(convInfo); + const result = backend4.runWebGLProgram(maxPoolBackpropProgram, [dy, maxPool3dPositions3], x.dtype); + backend4.disposeIntermediateTensorInfo(maxPool3dPositions3); + return result; +} +var maxPoolGrad3DConfig2 = { + kernelName: MaxPool3DGrad2, + backendName: "webgl", + kernelFunc: maxPool3DGrad4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPoolGrad.js +function maxPoolGrad6(args) { + const { inputs, backend: backend4, attrs } = args; + const { dy, input: input3, output } = inputs; + const x = input3; + assertNotComplex4([input3, output], "maxPoolGrad"); + const { filterSize, strides, pad: pad4, dimRoundingMode } = attrs; + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, 1, pad4, dimRoundingMode); + const getPositions = true; + const maxPoolPositionsProgram = new Pool2DProgram2(convInfo, "max", getPositions); + const maxPoolPositions3 = backend4.runWebGLProgram(maxPoolPositionsProgram, [x], x.dtype); + const maxPoolBackPropProgram = new MaxPool2DBackpropProgram2(convInfo); + const result = backend4.runWebGLProgram(maxPoolBackPropProgram, [dy, maxPoolPositions3], x.dtype); + backend4.disposeIntermediateTensorInfo(maxPoolPositions3); + return result; +} +var maxPoolGradConfig6 = { + kernelName: MaxPoolGrad2, + backendName: "webgl", + kernelFunc: maxPoolGrad6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPoolWithArgmax_impl.js +function maxPoolWithArgmaxImpl4(x, includeBatchInIndex, convInfo, backend4) { + let program = new Pool2DProgram2(convInfo, "max", false); + const poolOutput = backend4.runWebGLProgram(program, [x], "float32"); + program = new Pool2DProgram2(convInfo, "max", true, true, includeBatchInIndex); + const indexOutput = backend4.runWebGLProgram(program, [x], "float32"); + return [poolOutput, indexOutput]; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MaxPoolWithArgmax.js +var maxPoolWithArgmaxConfig4 = { + kernelName: MaxPoolWithArgmax2, + backendName: "webgl", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { x } = inputs; + const { filterSize, strides, pad: pad4, includeBatchInIndex } = attrs; + const webglBackend = backend4; + util_exports2.assert(x.shape.length === 4, () => `Error in maxPool: input must be rank 4 but got rank ${x.shape.length}.`); + const dilations = [1, 1]; + util_exports2.assert(backend_util_exports2.eitherStridesOrDilationsAreOne(strides, dilations), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${strides} and dilations '${dilations}'`); + const convInfo = backend_util_exports2.computePool2DInfo(x.shape, filterSize, strides, dilations, pad4); + const [result, indexes] = maxPoolWithArgmaxImpl4(x, includeBatchInIndex, convInfo, webglBackend); + return [result, indexes]; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Mean_impl.js +function meanImpl2(x, reduceShape, outShape, backend4) { + const inSize = util_exports2.sizeFromShape(reduceShape); + const xSize = util_exports2.sizeFromShape(x.shape); + const batchSize = xSize / inSize; + const reshapedInput = reshape8({ inputs: { x }, attrs: { shape: [batchSize, inSize] }, backend: backend4 }); + const reduced = reduce2(reshapedInput, "float32", "mean", backend4); + const reshapedOutput = reshape8({ inputs: { x: reduced }, attrs: { shape: outShape }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(reshapedInput); + backend4.disposeIntermediateTensorInfo(reduced); + return reshapedOutput; +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Mean.js +var meanConfig5 = { + kernelName: Mean2, + backendName: "webgl", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { x } = inputs; + const { keepDims, axis } = attrs; + const webglBackend = backend4; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + const meanInputIsTransposed = permutedAxes != null; + const shouldExecuteOnCPU = webglBackend.shouldExecuteOnCPU([x]); + const intermediates = []; + let meanInput = x; + if (meanInputIsTransposed) { + if (shouldExecuteOnCPU) { + const xTexData = webglBackend.texData.get(meanInput.dataId); + const values = xTexData.values; + const newShape = new Array(xRank); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[permutedAxes[i]]; + } + const meanInputValues = transposeImplCPU2(values, x.shape, x.dtype, permutedAxes, newShape); + meanInput = webglBackend.makeTensorInfo(newShape, x.dtype); + const meanInputData = webglBackend.texData.get(meanInput.dataId); + meanInputData.values = meanInputValues; + } else { + meanInput = transposeImpl4(x, permutedAxes, webglBackend); + } + intermediates.push(meanInput); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + } + backend_util_exports2.assertAxesAreInnerMostDims("sum", axes, xRank); + const [meanOutShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(meanInput.shape, axes); + let outShape = meanOutShape; + if (keepDims) { + outShape = backend_util_exports2.expandShapeToKeepDim(meanOutShape, origAxes); + } + const out = meanImpl2(meanInput, reduceShape, outShape, webglBackend); + for (const i of intermediates) { + webglBackend.disposeIntermediateTensorInfo(i); + } + return out; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Min.js +function min9(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + const xRank = x.shape.length; + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + let permutedX = x; + if (permutedAxes != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, x.shape.length); + } + backend_util_exports2.assertAxesAreInnerMostDims("min", axes, xRank); + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(permutedX.shape, axes); + const inSize = util_exports2.sizeFromShape(reduceShape); + const a2D = reshape8({ inputs: { x: permutedX }, backend: backend4, attrs: { shape: [-1, inSize] } }); + const reduced = reduce2(a2D, a2D.dtype, "min", backend4); + let res; + if (keepDims) { + const newShape = backend_util_exports2.expandShapeToKeepDim(outShape, origAxes); + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: newShape } }); + } else { + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: outShape } }); + } + backend4.disposeIntermediateTensorInfo(a2D); + backend4.disposeIntermediateTensorInfo(reduced); + if (permutedAxes != null) { + backend4.disposeIntermediateTensorInfo(permutedX); + } + return res; +} +var minConfig5 = { + kernelName: Min2, + backendName: "webgl", + kernelFunc: min9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Minimum.js +var MINIMUM2 = CHECK_NAN_SNIPPET5 + ` + return min(a, b); +`; +var MINIMUM_PACKED2 = ` + vec4 result = vec4(min(a, b)); + vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); + ` + CHECK_NAN_SNIPPET6 + ` + return result; +`; +var minimum7 = binaryKernelFunc4({ + opSnippet: MINIMUM2, + packedOpSnippet: MINIMUM_PACKED2, + cpuKernelImpl: minimumImplCPU2 +}); +var minimumConfig5 = { + kernelName: Minimum3, + backendName: "webgl", + kernelFunc: minimum7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/mirror_pad_gpu.js +var MirrorPadProgram2 = class { + constructor(xShape, paddings, mode) { + this.variableNames = ["x"]; + this.outputShape = paddings.map((p3, i) => p3[0] + xShape[i] + p3[1]); + const rank = xShape.length; + const dtype = getCoordsDataType2(rank); + const start = paddings.map((p3) => p3[0]).join(","); + const end = paddings.map((p3, i) => p3[0] + xShape[i]).join(","); + const unpackedCoords = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, rank); + const offset = mode === "reflect" ? 0 : 1; + if (rank === 1) { + this.userCode = ` + int start = ${start}; + int end = ${end}; + + void main() { + int outC = getOutputCoords(); + if (outC < start) { + outC = start * 2 - outC - ${offset}; + } else if(outC >= end) { + outC = (end - 1) * 2 - outC + ${offset}; + } + setOutput(getX(outC - start)); + } + `; + return; + } + this.userCode = ` + ${dtype} start = ${dtype}(${start}); + ${dtype} end = ${dtype}(${end}); + + void main() { + ${dtype} outC = getOutputCoords(); + for (int i = 0; i < ${rank}; i++) { + if (outC[i] < start[i]) { + outC[i] = start[i] * 2 - outC[i] - ${offset}; + } else if(outC[i] >= end[i]) { + outC[i] = (end[i] - 1) * 2 - outC[i] + ${offset}; + } + } + ${dtype} coords = outC - start; + setOutput(getX(${unpackedCoords})); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/mirror_pad_packed_gpu.js +var MirrorPadPackedProgram2 = class { + constructor(xShape, paddings, mode) { + this.variableNames = ["x"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = paddings.map((p3, i) => p3[0] + xShape[i] + p3[1]); + const rank = xShape.length; + const dtype = getCoordsDataType2(rank); + const start = paddings.map((p3) => p3[0]).join(","); + const end = paddings.map((p3, i) => p3[0] + xShape[i]).join(","); + const coords9 = getChannels2("rc", rank); + const source = getChannels2("source", rank); + const cLimit = `${coords9[rank - 1]} < ${this.outputShape[rank - 1]}`; + const innerDims = rank === 1 ? "source" : `vec2(${source.slice(-2).join()})`; + const offset = mode === "reflect" ? 0 : 1; + let mainLoop = ""; + if (rank === 1) { + const padSetup = ` + ${dtype} source = rc; + if (source < start) { + source = start * 2 - source - ${offset}; + } else if (source >= end) { + source = (end - 1) * 2 - source + ${offset}; + } + source -= start; + `; + mainLoop = ` + ${dtype} rc = outputLoc; + ${padSetup} + result[0] = getChannel(getX(${source.join()}), ${innerDims}); + ${coords9[rank - 1]} += 1; + if(${cLimit}) { + ${padSetup} + result[1] = getChannel(getX(${source.join()}), ${innerDims}); + } + `; + } else { + const padSetup = ` + ${dtype} source = rc; + ${dtype} lt = ${dtype}(lessThan(source, start)); + ${dtype} gte = ${dtype}(greaterThanEqual(source, end)); + ${dtype} orig = 1 - (lt + gte); + source = orig * source + + lt * (start * 2 - source - ${offset}) + + gte * ((end - 1) * 2 - source + ${offset}); + source -= start; + `; + mainLoop = ` + ${dtype} rc = outputLoc; + ${padSetup} + result[0] = getChannel(getX(${source.join()}), ${innerDims}); + ${coords9[rank - 1]} += 1; + if(${cLimit}) { + ${padSetup} + result[1] = getChannel(getX(${source.join()}), ${innerDims}); + } + rc = outputLoc; + ${coords9[rank - 2]} += 1; + if(${coords9[rank - 2]} < ${this.outputShape[rank - 2]}) { + ${padSetup} + result[2] = getChannel(getX(${source.join()}), ${innerDims}); + ${coords9[rank - 1]} += 1; + if(${cLimit}) { + ${padSetup} + result[3] = getChannel(getX(${source.join()}), ${innerDims}); + } + } + `; + } + this.userCode = ` + const ${dtype} start = ${dtype}(${start}); + const ${dtype} end = ${dtype}(${end}); + + void main() { + ${dtype} outputLoc = getOutputCoords(); + vec4 result = vec4(0.); + ${mainLoop} + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/MirrorPad.js +var mirrorPadKernelFunc2 = ({ inputs, backend: backend4, attrs }) => { + const { x } = inputs; + const { paddings, mode } = attrs; + const program = env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new MirrorPadPackedProgram2(x.shape, paddings, mode) : new MirrorPadProgram2(x.shape, paddings, mode); + const output = backend4.runWebGLProgram(program, [x], x.dtype); + return output; +}; +var mirrorPadConfig5 = { + kernelName: MirrorPad2, + backendName: "webgl", + kernelFunc: mirrorPadKernelFunc2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Mod.js +var MOD2 = `if (b == 0.0) return NAN; + return mod(a, b);`; +var MOD_PACKED2 = ` + vec4 result = mod(a, b); + vec4 isNaN = vec4(equal(b, vec4(0.0))); + ` + CHECK_NAN_SNIPPET6 + ` + return result; +`; +var mod6 = binaryKernelFunc4({ + opSnippet: MOD2, + packedOpSnippet: MOD_PACKED2 +}); +var modConfig4 = { + kernelName: Mod2, + backendName: "webgl", + kernelFunc: mod6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/multinomial_gpu.js +var MultinomialProgram2 = class { + constructor(batchSize, numOutcomes, numSamples) { + this.variableNames = ["probs"]; + this.customUniforms = [{ name: "seed", type: "float" }]; + this.outputShape = [batchSize, numSamples]; + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + + float r = random(seed); + float cdf = 0.0; + + for (int i = 0; i < ${numOutcomes - 1}; i++) { + cdf += getProbs(batch, i); + + if (r < cdf) { + setOutput(float(i)); + return; + } + } + + // If no other event happened, last event happened. + setOutput(float(${numOutcomes - 1})); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/RealDiv.js +var DIV2 = ` +if (a == b) { + return 1.0; +}; +return a / b;`; +var DIV_PACKED2 = ` + // vec4 one = vec4(equal(a, b)); + // return one + (vec4(1.0) - one) * a / b; + vec4 result = a / b; + if(a.x == b.x) { + result.x = 1.; + } + if(a.y == b.y) { + result.y = 1.; + } + if(a.z == b.z) { + result.z = 1.; + } + if(a.w == b.w) { + result.w = 1.; + } + + return result; +`; +var realDiv2 = binaryKernelFunc4({ opSnippet: DIV2, packedOpSnippet: DIV_PACKED2, checkOutOfBounds: true }); +var realDivConfig5 = { + kernelName: RealDiv2, + backendName: "webgl", + kernelFunc: realDiv2 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sub.js +var SUB2 = "return a - b;"; +var sub6 = binaryKernelFunc4({ + opSnippet: SUB2, + packedOpSnippet: SUB2, + supportsComplex: true, + cpuKernelImpl: subImplCPU2 +}); +var subConfig5 = { + kernelName: Sub2, + backendName: "webgl", + kernelFunc: sub6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Softmax.js +function softmax8(args) { + const { inputs, backend: backend4, attrs } = args; + const { logits } = inputs; + const { dim } = attrs; + const axes = util_exports2.parseAxisParam([dim], logits.shape); + const maxLogit = max9({ + inputs: { x: logits }, + backend: backend4, + attrs: { reductionIndices: axes, keepDims: false } + }); + const expandedShape = backend_util_exports2.expandShapeToKeepDim(maxLogit.shape, axes); + const maxLogitsReshaped = reshape8({ inputs: { x: maxLogit }, backend: backend4, attrs: { shape: expandedShape } }); + const a = sub6({ inputs: { a: logits, b: maxLogitsReshaped }, backend: backend4 }); + const b = exp6({ inputs: { x: a }, backend: backend4 }); + const sumExp = sum9({ inputs: { x: b }, backend: backend4, attrs: { axis: axes, keepDims: false } }); + const sumExpReshaped = reshape8({ inputs: { x: sumExp }, backend: backend4, attrs: { shape: expandedShape } }); + const res = realDiv2({ inputs: { a: b, b: sumExpReshaped }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(maxLogit); + backend4.disposeIntermediateTensorInfo(maxLogitsReshaped); + backend4.disposeIntermediateTensorInfo(a); + backend4.disposeIntermediateTensorInfo(b); + backend4.disposeIntermediateTensorInfo(sumExp); + backend4.disposeIntermediateTensorInfo(sumExpReshaped); + return res; +} +var softmaxConfig5 = { + kernelName: Softmax4, + backendName: "webgl", + kernelFunc: softmax8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Multinomial.js +function multinomial6(args) { + const { inputs, backend: backend4, attrs } = args; + const { logits } = inputs; + const { numSamples, seed, normalized } = attrs; + const probs = normalized ? logits : softmax8({ inputs: { logits }, backend: backend4, attrs: { dim: logits.shape.length - 1 } }); + const batchSize = probs.shape[0]; + const numOutcomes = probs.shape[1]; + const program = new MultinomialProgram2(batchSize, numOutcomes, numSamples); + const customValues = [[seed]]; + const res = backend4.runWebGLProgram(program, [probs], "int32", customValues); + if (!normalized) { + backend4.disposeIntermediateTensorInfo(probs); + } + return res; +} +var multinomialConfig4 = { + kernelName: Multinomial2, + backendName: "webgl", + kernelFunc: multinomial6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Neg.js +var NEG2 = `return -x;`; +function neg6(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (backend4.shouldExecuteOnCPU([x])) { + const xData = backend4.texData.get(x.dataId); + const [outValues, newShape] = negImplCPU2(xData.values, x.shape, x.dtype); + return backend4.makeTensorInfo(newShape, x.dtype, outValues); + } + let program; + if (env3().getBool("WEBGL_PACK_UNARY_OPERATIONS")) { + program = new UnaryOpPackedProgram2(x.shape, NEG2); + } else { + program = new UnaryOpProgram2(x.shape, NEG2); + } + return backend4.runWebGLProgram(program, [x], x.dtype); +} +var negConfig5 = { + kernelName: Neg2, + backendName: "webgl", + kernelFunc: neg6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/NonMaxSuppressionV3.js +var nonMaxSuppressionV3Impl6 = kernel_impls_exports2.nonMaxSuppressionV3Impl; +function nonMaxSuppressionV34(args) { + backend_util_exports2.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold } = attrs; + const boxesVals = backend4.readSync(boxes.dataId); + const scoresVals = backend4.readSync(scores.dataId); + const { selectedIndices } = nonMaxSuppressionV3Impl6(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + return backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)); +} +var nonMaxSuppressionV3Config5 = { + kernelName: NonMaxSuppressionV32, + backendName: "webgl", + kernelFunc: nonMaxSuppressionV34 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/NonMaxSuppressionV4.js +var nonMaxSuppressionV4Impl6 = kernel_impls_exports2.nonMaxSuppressionV4Impl; +function nonMaxSuppressionV45(args) { + backend_util_exports2.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize } = attrs; + const boxesVals = backend4.readSync(boxes.dataId); + const scoresVals = backend4.readSync(scores.dataId); + const { selectedIndices, validOutputs } = nonMaxSuppressionV4Impl6(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize); + return [ + backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)), + backend4.makeTensorInfo([], "int32", new Int32Array([validOutputs])) + ]; +} +var nonMaxSuppressionV4Config5 = { + kernelName: NonMaxSuppressionV42, + backendName: "webgl", + kernelFunc: nonMaxSuppressionV45 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/NonMaxSuppressionV5.js +var nonMaxSuppressionV5Impl6 = kernel_impls_exports2.nonMaxSuppressionV5Impl; +function nonMaxSuppressionV54(args) { + backend_util_exports2.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + const { inputs, backend: backend4, attrs } = args; + const { boxes, scores } = inputs; + const { maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma } = attrs; + const boxesVals = backend4.readSync(boxes.dataId); + const scoresVals = backend4.readSync(scores.dataId); + const maxOutputSizeVal = maxOutputSize; + const iouThresholdVal = iouThreshold; + const scoreThresholdVal = scoreThreshold; + const softNmsSigmaVal = softNmsSigma; + const { selectedIndices, selectedScores } = nonMaxSuppressionV5Impl6(boxesVals, scoresVals, maxOutputSizeVal, iouThresholdVal, scoreThresholdVal, softNmsSigmaVal); + return [ + backend4.makeTensorInfo([selectedIndices.length], "int32", new Int32Array(selectedIndices)), + backend4.makeTensorInfo([selectedScores.length], "float32", new Float32Array(selectedScores)) + ]; +} +var nonMaxSuppressionV5Config5 = { + kernelName: NonMaxSuppressionV52, + backendName: "webgl", + kernelFunc: nonMaxSuppressionV54 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/onehot_gpu.js +var OneHotProgram2 = class { + constructor(numIndices, depth, onValue, offValue) { + this.variableNames = ["indices"]; + this.outputShape = [numIndices, depth]; + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + int index = round(getIndices(coords.x)); + setOutput(mix(float(${offValue}), float(${onValue}), + float(index == coords.y))); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/OneHot.js +var oneHot7 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { indices } = inputs; + const { depth, onValue, offValue } = attrs; + const indicesSize = util_exports2.sizeFromShape(indices.shape); + const program = new OneHotProgram2(indicesSize, depth, onValue, offValue); + const reshaped = reshape8({ inputs: { x: indices }, backend: backend4, attrs: { shape: [indicesSize] } }); + const result = backend4.runWebGLProgram(program, [reshaped], indices.dtype); + backend4.disposeIntermediateTensorInfo(reshaped); + const outShape = [...indices.shape, depth]; + const out = reshape8({ inputs: { x: result }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo(result); + return out; +}; +var oneHotConfig5 = { + kernelName: OneHot2, + backendName: "webgl", + kernelFunc: oneHot7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ZerosLike.js +function zerosLike7(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (x.dtype === "complex64") { + const realPart = real6({ inputs: { input: x }, backend: backend4 }); + const r = zerosLike7({ inputs: { x: realPart }, backend: backend4 }); + const imagPart = imag6({ inputs: { input: x }, backend: backend4 }); + const i = zerosLike7({ inputs: { x: imagPart }, backend: backend4 }); + const result = complex6({ inputs: { real: r, imag: i }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(r); + backend4.disposeIntermediateTensorInfo(imagPart); + backend4.disposeIntermediateTensorInfo(i); + return result; + } else { + return fill7({ + attrs: { + shape: x.shape, + dtype: x.dtype, + value: x.dtype === "string" ? "" : 0 + }, + backend: backend4 + }); + } +} +var zerosLikeConfig5 = { + kernelName: ZerosLike2, + backendName: "webgl", + kernelFunc: zerosLike7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/OnesLike.js +function onesLike7(args) { + const { inputs, backend: backend4 } = args; + const { x } = inputs; + if (x.dtype === "string") { + throw new Error("onesLike is not supported under string dtype"); + } else if (x.dtype === "complex64") { + const realPart = real6({ inputs: { input: x }, backend: backend4 }); + const r = onesLike7({ inputs: { x: realPart }, backend: backend4 }); + const imagPart = imag6({ inputs: { input: x }, backend: backend4 }); + const i = zerosLike7({ inputs: { x: imagPart }, backend: backend4 }); + const result = complex6({ inputs: { real: r, imag: i }, backend: backend4 }); + backend4.disposeIntermediateTensorInfo(realPart); + backend4.disposeIntermediateTensorInfo(r); + backend4.disposeIntermediateTensorInfo(imagPart); + backend4.disposeIntermediateTensorInfo(i); + return result; + } else { + return fill7({ attrs: { shape: x.shape, dtype: x.dtype, value: 1 }, backend: backend4 }); + } +} +var onesLikeConfig5 = { + kernelName: OnesLike2, + backendName: "webgl", + kernelFunc: onesLike7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Pack.js +function pack5(args) { + const { inputs, backend: backend4, attrs } = args; + const { axis } = attrs; + if (inputs.length === 1) { + return expandDims9({ inputs: { input: inputs[0] }, backend: backend4, attrs: { dim: axis } }); + } + const shape = inputs[0].shape; + const dtype = inputs[0].dtype; + inputs.forEach((t) => { + util_exports2.assertShapesMatch(shape, t.shape, "All tensors passed to stack must have matching shapes"); + util_exports2.assert(dtype === t.dtype, () => "All tensors passed to stack must have matching dtypes"); + }); + const intermediateTensorInfos = []; + const expandedTensors = inputs.map((t) => { + const expandedT = expandDims9({ inputs: { input: t }, backend: backend4, attrs: { dim: axis } }); + intermediateTensorInfos.push(expandedT); + return expandedT; + }); + const result = concat7({ inputs: expandedTensors, backend: backend4, attrs: { axis } }); + intermediateTensorInfos.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var packConfig5 = { + kernelName: Pack2, + backendName: "webgl", + kernelFunc: pack5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/pad_gpu.js +var PadProgram2 = class { + constructor(xShape, paddings, constantValue) { + this.variableNames = ["x"]; + this.customUniforms = [{ name: "value", type: "float" }]; + this.outputShape = paddings.map((p3, i) => p3[0] + xShape[i] + p3[1]); + const rank = xShape.length; + const type = getCoordsDataType2(rank); + const start = paddings.map((p3) => p3[0]).join(","); + const end = paddings.map((p3, i) => p3[0] + xShape[i]).join(","); + const unpackedCoords = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, rank); + if (rank === 1) { + this.userCode = ` + int start = ${start}; + int end = ${end}; + + void main() { + int outC = getOutputCoords(); + if (outC < start || outC >= end) { + setOutput(value); + } else { + setOutput(getX(outC - start)); + } + } + `; + return; + } + this.userCode = ` + ${type} start = ${type}(${start}); + ${type} end = ${type}(${end}); + + void main() { + ${type} outC = getOutputCoords(); + if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { + setOutput(value); + } else { + ${type} coords = outC - start; + setOutput(getX(${unpackedCoords})); + } + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/pad_packed_gpu.js +var PadPackedProgram2 = class { + constructor(xShape, paddings, constantValue) { + this.variableNames = ["x"]; + this.packedInputs = true; + this.packedOutput = true; + this.customUniforms = [{ name: "value", type: "float" }]; + this.outputShape = paddings.map((p3, i) => p3[0] + xShape[i] + p3[1]); + const rank = xShape.length; + const dtype = getCoordsDataType2(rank); + const start = paddings.map((p3) => p3[0]).join(","); + const end = paddings.map((p3, i) => p3[0] + xShape[i]).join(","); + const coords9 = getChannels2("rc", rank); + const source = getChannels2("source", rank); + const cLimit = `${coords9[rank - 1]} < ${this.outputShape[rank - 1]}`; + const innerDims = rank === 1 ? "source" : `vec2(${source.slice(-2).join()})`; + const componentSetup = [ + `${dtype} rc = outputLoc;`, + `${coords9[rank - 1]} += 1; + if(${cLimit}) { + `, + rank === 1 ? "" : `} + rc = outputLoc; + ${coords9[rank - 2]} += 1; + if(${coords9[rank - 2]} < ${this.outputShape[rank - 2]}) {`, + rank === 1 ? "" : ` ${coords9[rank - 1]} += 1; + if(${cLimit}) {` + ]; + const paddingArea = rank === 1 ? "rc < start || rc >= end" : "any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))"; + let mainLoop = ""; + for (let i = 0, j = rank === 1 ? 2 : 4; i < j; i++) { + mainLoop += ` + ${componentSetup[i]} + if (${paddingArea}) { + result[${i}] = float(value); + } else { + ${dtype} source = rc - start; + result[${i}] = getChannel(getX(${source.join()}), ${innerDims}); + } + `; + } + mainLoop += rank === 1 ? `} ` : `}}`; + this.userCode = ` + const ${dtype} start = ${dtype}(${start}); + const ${dtype} end = ${dtype}(${end}); + + void main() { + ${dtype} outputLoc = getOutputCoords(); + vec4 result = vec4(0.); + ${mainLoop} + setOutput(result); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/PadV2.js +var padV24 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { paddings, constantValue } = attrs; + if (util_exports2.sizeFromShape(x.shape) === 0) { + const outputShape = paddings.map((p3, i) => p3[0] + x.shape[i] + p3[1]); + return fill7({ + backend: backend4, + attrs: { shape: outputShape, value: constantValue, dtype: x.dtype } + }); + } + const program = env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new PadPackedProgram2(x.shape, paddings, constantValue) : new PadProgram2(x.shape, paddings, constantValue); + const customValues = [[constantValue]]; + return backend4.runWebGLProgram(program, [x], x.dtype, customValues); +}; +var padV2Config5 = { + kernelName: PadV22, + backendName: "webgl", + kernelFunc: padV24 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Pow.js +var POW2 = ` + if(a < 0.0 && floor(b) < b){ + return NAN; + } + if (b == 0.0) { + return 1.0; + } + return (round(mod(b, 2.0)) != 1) ? + pow(abs(a), b) : sign(a) * pow(abs(a), b); +`; +var POW_PACKED2 = ` + // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. + vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); + vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); + vec4 result = multiplier * pow(abs(a), b); + + // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS + bvec4 isExpZero = equal(b, vec4(0.0)); + result.r = isExpZero.r ? 1.0 : result.r; + result.g = isExpZero.g ? 1.0 : result.g; + result.b = isExpZero.b ? 1.0 : result.b; + result.a = isExpZero.a ? 1.0 : result.a; + + vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b)); + ` + CHECK_NAN_SNIPPET6 + ` + return result; +`; +var pow6 = binaryKernelFunc4({ opSnippet: POW2, packedOpSnippet: POW_PACKED2 }); +var powConfig5 = { + kernelName: Pow2, + backendName: "webgl", + kernelFunc: pow6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Prod.js +function prod7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { axis, keepDims } = attrs; + const xRank = x.shape.length; + const toDispose = []; + const origAxes = util_exports2.parseAxisParam(axis, x.shape); + let axes = origAxes; + const permutedAxes = backend_util_exports2.getAxesPermutation(axes, xRank); + let permutedX = x; + if (permutedAxes != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutedAxes } }); + axes = backend_util_exports2.getInnerMostAxes(axes.length, xRank); + toDispose.push(permutedX); + } + backend_util_exports2.assertAxesAreInnerMostDims("prod", axes, xRank); + let res; + if (backend4.shouldExecuteOnCPU([permutedX])) { + const xVals = backend4.texData.get(permutedX.dataId).values; + const { outVals, outShape, outDtype } = prodImplCPU2(permutedX.shape, permutedX.dtype, xVals, axes); + res = backend4.makeTensorInfo(outShape, outDtype, outVals); + } else { + const [outShape, reduceShape] = backend_util_exports2.computeOutAndReduceShapes(permutedX.shape, axes); + const inSize = util_exports2.sizeFromShape(reduceShape); + const a2D = reshape8({ inputs: { x: permutedX }, backend: backend4, attrs: { shape: [-1, inSize] } }); + const outputDType = sumOutType2(x.dtype); + const reduced = reduce2(a2D, outputDType, "prod", backend4); + res = reshape8({ inputs: { x: reduced }, backend: backend4, attrs: { shape: outShape } }); + toDispose.push(a2D); + toDispose.push(reduced); + } + if (keepDims) { + toDispose.push(res); + const newShape = backend_util_exports2.expandShapeToKeepDim(res.shape, origAxes); + res = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape: newShape } }); + } + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return res; +} +var prodConfig5 = { + kernelName: Prod2, + backendName: "webgl", + kernelFunc: prod7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Range.js +var range9 = (args) => { + const { backend: backend4, attrs } = args; + const { start, stop, step: step8, dtype } = attrs; + const values = rangeImplCPU2(start, stop, step8, dtype); + return backend4.makeTensorInfo([values.length], dtype, values); +}; +var rangeConfig5 = { + kernelName: Range2, + backendName: "webgl", + kernelFunc: range9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Reciprocal.js +var RECIPROCAL2 = `return 1.0 / x;`; +var reciprocal6 = unaryKernelFunc4({ opSnippet: RECIPROCAL2 }); +var reciprocalConfig4 = { + kernelName: Reciprocal2, + backendName: "webgl", + kernelFunc: reciprocal6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Relu.js +var RELU7 = CHECK_NAN_SNIPPET4 + ` + return (x < 0.0) ? 0.0 : x; +`; +var RELU_PACKED2 = ` + vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`; +var relu7 = unaryKernelFunc4({ opSnippet: RELU7, packedOpSnippet: RELU_PACKED2 }); +var reluConfig5 = { + kernelName: Relu3, + backendName: "webgl", + kernelFunc: relu7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Relu6.js +var RELU66 = CHECK_NAN_SNIPPET4 + ` + return (x < 0.0) ? 0.0 : min(6.0, x); +`; +var RELU6_PACKED2 = ` + vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); + bvec4 isNaN = isnan(x); + + result.r = isNaN.r ? x.r : result.r; + result.g = isNaN.g ? x.g : result.g; + result.b = isNaN.b ? x.b : result.b; + result.a = isNaN.a ? x.a : result.a; + + return result; +`; +var relu66 = unaryKernelFunc4({ opSnippet: RELU66, packedOpSnippet: RELU6_PACKED2 }); +var relu6Config5 = { + kernelName: Relu63, + backendName: "webgl", + kernelFunc: relu66 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_bilinear_gpu.js +var ResizeBilinearProgram2 = class { + constructor(inputShape, newHeight, newWidth, alignCorners, halfPixelCenters) { + this.variableNames = ["A"]; + this.outputShape = []; + const [batch, oldHeight, oldWidth, depth] = inputShape; + this.outputShape = [batch, newHeight, newWidth, depth]; + const effectiveInSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + let sourceFracIndexRC; + if (halfPixelCenters) { + sourceFracIndexRC = `(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)`; + } else { + sourceFracIndexRC = `vec2(yRC) * effectiveInputOverOutputRatioRC`; + } + this.userCode = ` + const vec2 effectiveInputOverOutputRatioRC = vec2( + ${effectiveInSize[0] / effectiveOutSize[0]}, + ${effectiveInSize[1] / effectiveOutSize[1]}); + const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + ivec2 yRC = coords.yz; + + // Fractional source index. + vec2 sourceFracIndexRC = ${sourceFracIndexRC}; + + // Compute the four integer indices. + ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); + ivec2 sourceCeilRC = ivec2( + min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); + + float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d); + float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d); + float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d); + float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d); + + vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC); + + float top = topLeft + (topRight - topLeft) * fracRC.y; + float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y; + float newValue = top + (bottom - top) * fracRC.x; + + setOutput(newValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_bilinear_packed_gpu.js +var ResizeBilinearPackedProgram2 = class { + constructor(inputShape, newHeight, newWidth, alignCorners, halfPixelCenters) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = []; + const [batch, oldHeight, oldWidth, depth] = inputShape; + this.outputShape = [batch, newHeight, newWidth, depth]; + const effectiveInSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + let sourceFracIndexRC; + if (halfPixelCenters) { + sourceFracIndexRC = `(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)`; + } else { + sourceFracIndexRC = `vec3(yRC) * effectiveInputOverOutputRatioRC`; + } + this.userCode = ` + const vec3 effectiveInputOverOutputRatioRC = vec3( + ${effectiveInSize[0] / effectiveOutSize[0]}, + ${effectiveInSize[1] / effectiveOutSize[1]}, + ${effectiveInSize[1] / effectiveOutSize[1]}); + const vec3 inputShapeRC = vec3(${oldHeight}.0, ${oldWidth}.0, + ${oldWidth}.0); + + float getAValue(int b, int r, int c, int d) { + return getChannel(getA(b, r, c, d), vec2(c, d)); + } + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + // Calculate values for next column in yRC.z. + ivec3 yRC = coords.yzz + ivec3(0, 0, 1); + + // Fractional source index. + vec3 sourceFracIndexRC = ${sourceFracIndexRC}; + + // Compute the four integer indices. + ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); + ivec3 sourceCeilRC = ivec3( + min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); + + // Should we calculate next column and row elements in 2x2 packed cell. + bool hasNextCol = d < ${depth - 1}; + bool hasNextRow = coords.z < ${newWidth - 1}; + + // In parallel, construct four corners for all four components in + // packed 2x2 cell. + vec4 topLeft = vec4( + getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d), + hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0); + + vec4 bottomLeft = vec4( + getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d), + hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0); + + vec4 topRight = vec4( + getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d), + hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0); + + vec4 bottomRight = vec4( + getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d), + hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0); + + vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC); + + vec4 top = mix(topLeft, topRight, fracRC.yyzz); + vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz); + vec4 newValue = mix(top, bottom, fracRC.x); + + setOutput(newValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ResizeBilinear.js +function resizeBilinear7(args) { + const { inputs, backend: backend4, attrs } = args; + const { images } = inputs; + const { alignCorners, halfPixelCenters, size: size2 } = attrs; + const [newHeight, newWidth] = size2; + const program = env3().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new ResizeBilinearPackedProgram2(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters) : new ResizeBilinearProgram2(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters); + return backend4.runWebGLProgram(program, [images], "float32"); +} +var resizeBilinearConfig5 = { + kernelName: ResizeBilinear2, + backendName: "webgl", + kernelFunc: resizeBilinear7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_bilinear_backprop_gpu.js +var ResizeBilinearBackpropProgram2 = class { + constructor(dyShape, inputShape, alignCorners) { + this.variableNames = ["dy"]; + this.outputShape = []; + this.outputShape = inputShape; + const [, xHeight, xWidth] = inputShape; + const [, yHeight, yWidth] = dyShape; + const effectiveXSize = [ + alignCorners && yHeight > 1 ? xHeight - 1 : xHeight, + alignCorners && yWidth > 1 ? xWidth - 1 : xWidth + ]; + const effectiveYSize = [ + alignCorners && yHeight > 1 ? yHeight - 1 : yHeight, + alignCorners && yWidth > 1 ? yWidth - 1 : yWidth + ]; + const heightScale = effectiveXSize[0] / effectiveYSize[0]; + const widthScale = effectiveXSize[1] / effectiveYSize[1]; + const invHeightScale = 1 / heightScale; + const invWidthScale = 1 / widthScale; + const winHeight = Math.ceil(invHeightScale) * 2 + 2; + const winWidth = Math.ceil(invWidthScale) * 2 + 2; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + int r = coords[1]; + int c = coords[2]; + + float accumulator = 0.0; + + const float heightScale = float(${heightScale}); + const float widthScale = float(${widthScale}); + + const float invHeightScale = float(${invHeightScale}); + const float invWidthScale = float(${invWidthScale}); + + const int winHeight = int(${winHeight}); + const int winWidth = int(${winWidth}); + + // Compute bounds for where in dy we will look + float startRLerp = floor(float(r) * invHeightScale); + int startDyR = int(startRLerp - float(winHeight / 2)); + + float startCLerp = floor(float(c) * invWidthScale); + int startDyC = int(startCLerp - float(winWidth / 2)); + + // Loop over dy + for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { + int dyR = dyROffset + startDyR; + + // Guard against the window exceeding the bounds of dy + if (dyR < 0 || dyR >= ${yHeight}) { + continue; + } + + for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { + int dyC = dyCOffset + startDyC; + + // Guard against the window exceeding the bounds of dy + if (dyC < 0 || dyC >= ${yWidth}) { + continue; + } + + float dxR = float(dyR) * heightScale; + int topDxRIndex = int(floor(dxR)); + int bottomDxRIndex = int(min(ceil(dxR), ${xHeight - 1}.0)); + float dxRLerp = dxR - float(topDxRIndex); + float inverseDxRLerp = 1.0 - dxRLerp; + + float dxC = float(dyC) * widthScale; + int leftDxCIndex = int(floor(dxC)); + int rightDxCIndex = int(min(ceil(dxC), ${xWidth - 1}.0)); + float dxCLerp = dxC - float(leftDxCIndex); + float inverseDxCLerp = 1.0 - dxCLerp; + + if (r == topDxRIndex && c == leftDxCIndex) { + // topLeft + accumulator += + getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp; + } + + if (r == topDxRIndex && c == rightDxCIndex) { + // topRight + accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp; + } + + if (r == bottomDxRIndex && c == leftDxCIndex) { + // bottomLeft + accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp; + } + + if (r == bottomDxRIndex && c == rightDxCIndex) { + // bottomRight + accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp; + } + } + } + // End loop over dy + + setOutput(accumulator); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ResizeBilinearGrad.js +function resizeBilinearGrad4(args) { + const { inputs, backend: backend4, attrs } = args; + const { images, dy } = inputs; + const { alignCorners } = attrs; + const program = new ResizeBilinearBackpropProgram2(dy.shape, images.shape, alignCorners); + return backend4.runWebGLProgram(program, [dy], dy.dtype); +} +var resizeBilinearGradConfig6 = { + kernelName: ResizeBilinearGrad2, + backendName: "webgl", + kernelFunc: resizeBilinearGrad4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_nearest_neighbor_gpu.js +var ResizeNearestNeighborProgram2 = class { + constructor(inputShape, newHeight, newWidth, alignCorners, halfPixelCenters) { + this.variableNames = ["A"]; + this.outputShape = []; + const [batch, oldHeight, oldWidth, depth] = inputShape; + this.outputShape = [batch, newHeight, newWidth, depth]; + const effectiveInSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + const roundBase = alignCorners ? "0.5" : "0.0"; + let sourceFracIndexRC; + if (halfPixelCenters) { + sourceFracIndexRC = `max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))`; + } else { + sourceFracIndexRC = `vec2(yRC) * effectiveInputOverOutputRatioRC`; + } + this.userCode = ` + const vec2 effectiveInputOverOutputRatioRC = vec2( + ${effectiveInSize[0] / effectiveOutSize[0]}, + ${effectiveInSize[1] / effectiveOutSize[1]}); + const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0); + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + ivec2 yRC = coords.yz; + + // Fractional source index. + vec2 sourceFracIndexRC = ${sourceFracIndexRC}; + + // Compute the coordinators of nearest neighbor point. + ivec2 sourceNearestRC = ivec2( + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${roundBase}))); + float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); + + setOutput(newValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_nearest_neighbor_packed_gpu.js +var ResizeNearestNeighborPackedProgram2 = class { + constructor(inputShape, newHeight, newWidth, alignCorners, halfPixelCenters) { + this.variableNames = ["A"]; + this.packedInputs = true; + this.packedOutput = true; + this.outputShape = []; + const [batch, oldHeight, oldWidth, depth] = inputShape; + this.outputShape = [batch, newHeight, newWidth, depth]; + const effectiveInSize = [ + alignCorners && newHeight > 1 ? oldHeight - 1 : oldHeight, + alignCorners && newWidth > 1 ? oldWidth - 1 : oldWidth + ]; + const effectiveOutSize = [ + alignCorners && newHeight > 1 ? newHeight - 1 : newHeight, + alignCorners && newWidth > 1 ? newWidth - 1 : newWidth + ]; + const roundBase = alignCorners ? "0.5" : "0.0"; + let sourceFracIndexRC; + if (halfPixelCenters) { + sourceFracIndexRC = `max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))`; + } else { + sourceFracIndexRC = `vec3(yRC) * effectiveInputOverOutputRatioRC`; + } + this.userCode = ` + const vec3 effectiveInputOverOutputRatioRC = vec3( + ${effectiveInSize[0] / effectiveOutSize[0]}, + ${effectiveInSize[1] / effectiveOutSize[1]}, + ${effectiveInSize[1] / effectiveOutSize[1]}); + const vec3 inputShapeRC = vec3(${oldHeight}.0, ${oldWidth}.0, + ${oldWidth}.0); + + float getAValue(int b, int r, int c, int d) { + return getChannel(getA(b, r, c, d), vec2(c, d)); + } + + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + // Calculate values for next column in yRC.z. + ivec3 yRC = coords.yzz + ivec3(0, 0, 1); + + // Fractional source index. + vec3 sourceFracIndexRC = ${sourceFracIndexRC}; + + // Compute the coordinators of nearest neighbor point. + ivec3 sourceNearestRC = ivec3( + min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${roundBase}))); + + // Should we calculate next column and row elements in 2x2 packed cell. + bool hasNextCol = d < ${depth - 1}; + bool hasNextRow = coords.z < ${newWidth - 1}; + + vec4 newValue = vec4( + getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d), + hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1) + : 0.0, + hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d) + : 0.0, + (hasNextRow && hasNextCol) ? + getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0); + + setOutput(newValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ResizeNearestNeighbor.js +function resizeNearestNeighbor6(args) { + const { inputs, backend: backend4, attrs } = args; + const { images } = inputs; + const { alignCorners, halfPixelCenters, size: size2 } = attrs; + const [newHeight, newWidth] = size2; + const program = env3().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new ResizeNearestNeighborPackedProgram2(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters) : new ResizeNearestNeighborProgram2(images.shape, newHeight, newWidth, alignCorners, halfPixelCenters); + return backend4.runWebGLProgram(program, [images], images.dtype); +} +var resizeNearestNeighborConfig4 = { + kernelName: ResizeNearestNeighbor2, + backendName: "webgl", + kernelFunc: resizeNearestNeighbor6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/resize_nearest_neighbor_backprop_gpu.js +var ResizeNearestNeigborBackpropProgram2 = class { + constructor(dyShape, inputShape, alignCorners) { + this.variableNames = ["dy"]; + this.outputShape = []; + this.outputShape = inputShape; + const [, xHeight, xWidth] = inputShape; + const [, yHeight, yWidth] = dyShape; + const effectiveXSize = [ + alignCorners && yHeight > 1 ? xHeight - 1 : xHeight, + alignCorners && yWidth > 1 ? xWidth - 1 : xWidth + ]; + const effectiveYSize = [ + alignCorners && yHeight > 1 ? yHeight - 1 : yHeight, + alignCorners && yWidth > 1 ? yWidth - 1 : yWidth + ]; + const heightScale = effectiveXSize[0] / effectiveYSize[0]; + const widthScale = effectiveXSize[1] / effectiveYSize[1]; + const invHeightScale = 1 / heightScale; + const invWidthScale = 1 / widthScale; + const winHeight = Math.ceil(invHeightScale) * 2 + 2; + const winWidth = Math.ceil(invWidthScale) * 2 + 2; + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int b = coords[0]; + int d = coords[3]; + int r = coords[1]; + int c = coords[2]; + + float accumulator = 0.0; + + const float heightScale = float(${heightScale}); + const float widthScale = float(${widthScale}); + + const float invHeightScale = float(${invHeightScale}); + const float invWidthScale = float(${invWidthScale}); + + const int winHeight = int(${winHeight}); + const int winWidth = int(${winWidth}); + + // Compute bounds for where in dy we will look + float startRLerp = floor(float(r) * invHeightScale); + int startDyR = int(floor(startRLerp - float(winHeight / 2))); + + float startCLerp = floor(float(c) * invWidthScale); + int startDyC = int(floor(startCLerp - float(winWidth / 2))); + + // Loop over dy + for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { + int dyR = dyROffset + startDyR; + + // Guard against the window exceeding the bounds of dy + if (dyR < 0 || dyR >= ${yHeight}) { + continue; + } + + for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { + int dyC = dyCOffset + startDyC; + + // Guard against the window exceeding the bounds of dy + if (dyC < 0 || dyC >= ${yWidth}) { + continue; + } + + float sourceFracRow = + float(${effectiveXSize[0]}) * + (float(dyR) / float(${effectiveYSize[0]})); + + float sourceFracCol = + float(${effectiveXSize[1]}) * + (float(dyC) / float(${effectiveYSize[1]})); + + int sourceNearestRow = int(min( + float(int(${xHeight}) - 1), + ${alignCorners} ? float(round(sourceFracRow)) : + float(floor(sourceFracRow)))); + + int sourceNearestCol = int(min( + float(int(${xWidth}) - 1), + ${alignCorners} ? float(round(sourceFracCol)) : + float(floor(sourceFracCol)))); + + if (r == sourceNearestRow && c == sourceNearestCol) { + accumulator += getDy(b, dyR, dyC, d); + } + } + } + // End loop over dy + + setOutput(accumulator); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ResizeNearestNeighborGrad.js +function resizeNearestNeighborGrad4(args) { + const { inputs, backend: backend4, attrs } = args; + const { images, dy } = inputs; + const { alignCorners } = attrs; + const program = new ResizeNearestNeigborBackpropProgram2(dy.shape, images.shape, alignCorners); + return backend4.runWebGLProgram(program, [dy], dy.dtype); +} +var resizeNearestNeighborGradConfig6 = { + kernelName: ResizeNearestNeighborGrad2, + backendName: "webgl", + kernelFunc: resizeNearestNeighborGrad4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/reverse_gpu.js +var ReverseProgram2 = class { + constructor(xShape, axis) { + this.variableNames = ["x"]; + const rank = xShape.length; + if (rank > 4) { + throw new Error(`WebGL backend: Reverse of rank-${rank} tensor is not yet supported`); + } + this.outputShape = xShape; + if (rank === 1) { + this.userCode = ` + void main() { + int coord = getOutputCoords(); + setOutput(getX(${xShape[0]} - coord - 1)); + } + `; + return; + } + const getInCoord = (i) => { + if (axis.indexOf(i) !== -1 && xShape[i] !== 1) { + return `${xShape[i]} - coords[${i}] - 1`; + } + return `coords[${i}]`; + }; + const inCoords = xShape.map((_, i) => getInCoord(i)).join(","); + const type = getCoordsDataType2(rank); + this.userCode = ` + void main() { + ${type} coords = getOutputCoords(); + setOutput(getX(${inCoords})); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/reverse_packed_gpu.js +var ReversePackedProgram2 = class { + constructor(xShape, axis) { + this.variableNames = ["x"]; + this.packedInputs = true; + this.packedOutput = true; + const rank = xShape.length; + if (rank > 4) { + throw new Error(`WebGL backend: Reverse of rank-${rank} tensor is not yet supported`); + } + this.outputShape = xShape; + const channels = getChannels2("rc", rank); + const nextColumn = `${channels[rank - 1]} + 1 < ${this.outputShape[rank - 1]}`; + const nextRow = `${channels[rank - 2]} + 1 < ${this.outputShape[rank - 2]}`; + const type = getCoordsDataType2(rank); + if (rank === 1) { + this.userCode = ` + void main(){ + int rc = getOutputCoords(); + vec4 result = vec4(0.); + result.r = getChannel(getX(${xShape[0]} - rc - 1), + ${xShape[0]} - rc - 1); + if(${nextColumn}){ + result.g = getChannel(getX(${xShape[0]} - (rc + 1) - 1), + ${xShape[0]} - (rc + 1) - 1); + } + setOutput(result); + } + `; + } else { + this.userCode = ` + void main() { + ${type} rc = getOutputCoords(); + vec4 result = vec4(0.); + result.r = ${getR(channels.slice())}; + if(${nextColumn}){ + result.g = ${getG(channels.slice())}; + } + if(${nextRow}) { + result.b = ${getB(channels.slice())}; + if(${nextColumn}) { + result.a = ${getA(channels.slice())}; + } + } + setOutput(result); + } + `; + } + function getR(channels2) { + return getChannel(channels2); + } + function getG(channels2) { + channels2[rank - 1] = "(" + channels2[rank - 1] + ` + 1)`; + return getChannel(channels2); + } + function getB(channels2) { + channels2[rank - 2] = "(" + channels2[rank - 2] + ` + 1)`; + return getChannel(channels2); + } + function getA(channels2) { + channels2[rank - 1] = "(" + channels2[rank - 1] + ` + 1)`; + channels2[rank - 2] = "(" + channels2[rank - 2] + ` + 1)`; + return getChannel(channels2); + } + function getChannel(channels2) { + const inCoordsArray = xShape.map((_, i) => getInCoord(i, channels2)); + const inCoords = inCoordsArray.join(","); + const innerDims = inCoordsArray.slice(-2).join(","); + return `getChannel(getX(${inCoords}), vec2(${innerDims}))`; + } + function getInCoord(i, channels1) { + if (axis.indexOf(i) !== -1 && xShape[i] !== 1) { + return `${xShape[i]} - ${channels1[i]} - 1`; + } else { + return `${channels1[i]}`; + } + } + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Reverse.js +function reverse7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { dims } = attrs; + const xRank = x.shape.length; + const $dims = util_exports2.parseAxisParam(dims, x.shape); + if (xRank === 0) { + return identity6({ inputs: { x }, backend: backend4 }); + } + const program = env3().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new ReversePackedProgram2(x.shape, $dims) : new ReverseProgram2(x.shape, $dims); + return backend4.runWebGLProgram(program, [x], x.dtype); +} +var reverseConfig5 = { + kernelName: Reverse2, + backendName: "webgl", + kernelFunc: reverse7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/rotate_gpu.js +var RotateProgram2 = class { + constructor(imageShape, fillValue) { + this.variableNames = ["Image"]; + this.outputShape = []; + this.customUniforms = [{ name: "params", type: "vec4" }]; + const imageHeight = imageShape[1]; + const imageWidth = imageShape[2]; + this.outputShape = imageShape; + let fillSnippet = ""; + if (typeof fillValue === "number") { + fillSnippet = `float outputValue = ${fillValue.toFixed(2)};`; + } else { + fillSnippet = ` + vec3 fill = vec3(${fillValue.join(",")}); + float outputValue = fill[coords[3]];`; + } + this.userCode = ` + void main() { + ivec4 coords = getOutputCoords(); + int x = coords[2]; + int y = coords[1]; + float coordXFloat = (float(x) - params[0]) * params[3] - + (float(y) - params[1]) * params[2]; + float coordYFloat = (float(x) - params[0]) * params[2] + + (float(y) - params[1]) * params[3]; + int coordX = int(round(coordXFloat + params[0])); + int coordY = int(round(coordYFloat + params[1])); + ${fillSnippet} + if(coordX >= 0 && coordX < ${imageWidth} && coordY >= 0 && coordY < ${imageHeight}) { + outputValue = getImage(coords[0], coordY, coordX, coords[3]); + } + setOutput(outputValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/RotateWithOffset.js +var rotateWithOffsetConfig5 = { + kernelName: RotateWithOffset2, + backendName: "webgl", + kernelFunc: ({ inputs, attrs, backend: backend4 }) => { + const { image: image9 } = inputs; + const { radians, fillValue, center } = attrs; + const webglBackend = backend4; + const program = new RotateProgram2(image9.shape, fillValue); + const [centerX, centerY] = backend_util_exports2.getImageCenter(center, image9.shape[1], image9.shape[2]); + const customValues = [[centerX, centerY, Math.sin(radians), Math.cos(radians)]]; + const output = webglBackend.runWebGLProgram(program, [image9], image9.dtype, customValues); + return output; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Round.js +var ROUND2 = ` + // OpenGL ES does not support round function. + // The algorithm is based on banker's rounding. + float base = floor(x); + if ((x - base) < 0.5) { + return floor(x); + } else if ((x - base) > 0.5) { + return ceil(x); + } else { + if (mod(base, 2.0) == 0.0) { + return base; + } else { + return base + 1.0; + } + } +`; +var round8 = unaryKernelFunc4({ opSnippet: ROUND2 }); +var roundConfig5 = { + kernelName: Round2, + backendName: "webgl", + kernelFunc: round8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Rsqrt.js +var RSQRT2 = `return inversesqrt(x);`; +var rsqrt6 = unaryKernelFunc4({ opSnippet: RSQRT2, cpuKernelImpl: rsqrtImplCPU2 }); +var rsqrtConfig5 = { + kernelName: Rsqrt2, + backendName: "webgl", + kernelFunc: rsqrt6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/scatter_gpu.js +var ScatterProgram2 = class { + constructor(updateSize, sliceDim, indicesRank, updatesRank, strides, shape, summingDupeIndex = true) { + this.variableNames = ["updates", "indices", "defaultValue"]; + this.outputShape = shape; + const stridesType = getCoordsDataType2(strides.length); + const dtype = getCoordsDataType2(shape.length); + let indicesString = ""; + if (indicesRank === 1) { + indicesString = "i"; + } else if (indicesRank === 2) { + indicesString = "i, j"; + } + const indicesSnippet = `getIndices(${indicesString})`; + let updatesString = ""; + if (updatesRank === 1) { + updatesString = "i"; + } else if (updatesRank === 2) { + updatesString = "i, coords[1]"; + } + const updatesSnippet = `getUpdates(${updatesString})`; + const strideString = sliceDim > 1 ? "strides[j]" : "strides"; + this.userCode = ` + ${stridesType} strides = ${stridesType}(${strides}); + + void main() { + ${dtype} coords = getOutputCoords(); + float sum = 0.0; + bool found = false; + for (int i = 0; i < ${updateSize}; i++) { + int flattenedIndex = 0; + for (int j = 0; j < ${sliceDim}; j++) { + int index = round(${indicesSnippet}); + flattenedIndex += index * ${strideString}; + } + if (flattenedIndex == coords[0]) { + sum += ${updatesSnippet}; + found = true; + } + } + setOutput(mix(getDefaultValue(), sum, float(found))); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/ScatterNd.js +function scatterNd5(args) { + const { inputs, backend: backend4, attrs } = args; + const { indices, updates } = inputs; + const { shape } = attrs; + const { sliceRank, numUpdates, sliceSize, strides, outputSize: outputSize2 } = backend_util_exports2.calculateShapes(updates, indices, shape); + const flattenShape = [outputSize2 / sliceSize, sliceSize]; + if (outputSize2 === 0) { + return backend4.makeTensorInfo(shape, indices.dtype); + } + const flattenIndices = reshape8({ inputs: { x: indices }, backend: backend4, attrs: { shape: [numUpdates, sliceRank] } }); + const flattenX = reshape8({ inputs: { x: updates }, backend: backend4, attrs: { shape: [numUpdates, sliceSize] } }); + const defaultValue = backend4.makeTensorInfo([], "float32", new Float32Array([0])); + const program = new ScatterProgram2(numUpdates, sliceRank, flattenIndices.shape.length, flattenX.shape.length, strides, flattenShape); + const res = backend4.runWebGLProgram(program, [flattenX, flattenIndices, defaultValue], flattenX.dtype); + const reshaped = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape } }); + backend4.disposeIntermediateTensorInfo(flattenIndices); + backend4.disposeIntermediateTensorInfo(flattenX); + backend4.disposeIntermediateTensorInfo(res); + backend4.disposeIntermediateTensorInfo(defaultValue); + return reshaped; +} +var scatterNdConfig5 = { + kernelName: ScatterNd2, + backendName: "webgl", + kernelFunc: scatterNd5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/select_gpu.js +var SelectProgram2 = class { + constructor(cRank, shape, rank) { + this.variableNames = ["c", "a", "b"]; + this.outputShape = shape; + let cCoords; + let abCoords; + if (rank > 4) { + throw Error(`Where for rank ${rank} is not yet supported`); + } + if (rank === 1) { + abCoords = `resRC`; + cCoords = `resRC`; + } else { + const currentCoords = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"]; + const cCoordVars = []; + const abCoordVars = []; + for (let i = 0; i < shape.length; i++) { + abCoordVars.push(`${currentCoords[i]}`); + if (i < cRank) { + cCoordVars.push(`${currentCoords[i]}`); + } + } + cCoords = cCoordVars.join(); + abCoords = abCoordVars.join(); + } + const dtype = getCoordsDataType2(rank); + this.userCode = ` + void main() { + ${dtype} resRC = getOutputCoords(); + float cVal = getC(${cCoords}); + if (cVal >= 1.0) { + setOutput(getA(${abCoords})); + } else { + setOutput(getB(${abCoords})); + } + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Select.js +function select7(args) { + const { inputs, backend: backend4 } = args; + const { condition, t, e } = inputs; + const program = new SelectProgram2(condition.shape.length, t.shape, t.shape.length); + return backend4.runWebGLProgram(program, [condition, t, e], upcastType2(t.dtype, e.dtype)); +} +var selectConfig5 = { + kernelName: Select2, + backendName: "webgl", + kernelFunc: select7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Selu.js +var SELU2 = ` + // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. + // see: https://arxiv.org/abs/1706.02515 + float scaleAlpha = ${backend_util_exports2.SELU_SCALEALPHA}; + float scale = ${backend_util_exports2.SELU_SCALE}; + return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); +`; +var selu6 = unaryKernelFunc4({ opSnippet: SELU2 }); +var seluConfig4 = { + kernelName: Selu3, + backendName: "webgl", + kernelFunc: selu6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sigmoid.js +var SIGMOID6 = `return 1.0 / (1.0 + exp(-1.0 * x));`; +var sigmoid7 = unaryKernelFunc4({ + opSnippet: SIGMOID6, + packedOpSnippet: SIGMOID6, + cpuKernelImpl: sigmoidImplCPU2 +}); +var sigmoidConfig5 = { + kernelName: Sigmoid3, + backendName: "webgl", + kernelFunc: sigmoid7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sign.js +var SIGN2 = ` + if (isnan(x)) { return 0.0; } + return sign(x); +`; +var sign6 = unaryKernelFunc4({ opSnippet: SIGN2 }); +var signConfig4 = { + kernelName: Sign2, + backendName: "webgl", + kernelFunc: sign6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sin.js +var SIN2 = CHECK_NAN_SNIPPET_UNARY2 + ` + return sin(x); +`; +var sin6 = unaryKernelFunc4({ opSnippet: SIN2 }); +var sinConfig5 = { + kernelName: Sin2, + backendName: "webgl", + kernelFunc: sin6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sinh.js +var SINH2 = ` + float e2x = exp(x); + return (e2x - 1.0 / e2x) / 2.0; +`; +var sinh6 = unaryKernelFunc4({ opSnippet: SINH2 }); +var sinhConfig4 = { + kernelName: Sinh2, + backendName: "webgl", + kernelFunc: sinh6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Softplus.js +var SOFTPLUS2 = ` + float epsilon = 1.1920928955078125e-7; + float threshold = log(epsilon) + 2.0; + + bool too_large = x > -threshold; + bool too_small = x < threshold; + + float result; + float exp_x = exp(x); + + if (too_large){ + result = x; + } + else if (too_small){ + result = exp_x; + } + else{ + result = log(exp_x + 1.0); + } + return result; +`; +var softplus6 = unaryKernelFunc4({ opSnippet: SOFTPLUS2 }); +var softplusConfig4 = { + kernelName: Softplus3, + backendName: "webgl", + kernelFunc: softplus6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SpaceToBatchND.js +var spaceToBatchND7 = (args) => { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { blockShape, paddings } = attrs; + util_exports2.assert(x.shape.length <= 4, () => "spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"); + const prod8 = blockShape.reduce((a, b) => a * b); + const completePaddings = [[0, 0]]; + completePaddings.push(...paddings); + for (let i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + const toDispose = []; + const paddedX = padV24({ + inputs: { x }, + backend: backend4, + attrs: { paddings: completePaddings, constantValue: 0 } + }); + const reshapedPaddedShape = backend_util_exports2.getReshaped(paddedX.shape, blockShape, prod8, false); + const permutedReshapedPaddedPermutation = backend_util_exports2.getPermuted(reshapedPaddedShape.length, blockShape.length, false); + const flattenShape = backend_util_exports2.getReshapedPermuted(paddedX.shape, blockShape, prod8, false); + const reshapedPaddedX = reshape8({ inputs: { x: paddedX }, backend: backend4, attrs: { shape: reshapedPaddedShape } }); + const paddedXT = transpose7({ + inputs: { x: reshapedPaddedX }, + backend: backend4, + attrs: { perm: permutedReshapedPaddedPermutation } + }); + const result = reshape8({ inputs: { x: paddedXT }, backend: backend4, attrs: { shape: flattenShape } }); + toDispose.push(paddedX); + toDispose.push(reshapedPaddedX); + toDispose.push(paddedXT); + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +}; +var spaceToBatchNDConfig5 = { + kernelName: SpaceToBatchND2, + backendName: "webgl", + kernelFunc: spaceToBatchND7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SparseFillEmptyRows.js +function sparseFillEmptyRows6(args) { + const { inputs, backend: backend4 } = args; + const { indices, values, denseShape, defaultValue } = inputs; + if (denseShape.shape.length !== 1) { + throw new Error(`Dense shape must be a vector, saw: + ${denseShape.shape}`); + } + if (indices.shape.length !== 2) { + throw new Error(`Indices must be a matrix, saw: + ${indices.shape}`); + } + if (values.shape.length !== 1) { + throw new Error(`Values must be a vector, saw: + ${values.shape}`); + } + if (defaultValue.shape.length !== 0) { + throw new Error(`Default value must be a scalar, saw: + ${defaultValue.shape}`); + } + const $indices = backend4.readSync(indices.dataId); + const $values = backend4.readSync(values.dataId); + const $denseShape = backend4.readSync(denseShape.dataId); + const $defaultValue = backend4.readSync(defaultValue.dataId)[0]; + const [outputIndices, outputIndicesShape, outputValues, emptyRowIndicator, reverseIndexMap] = sparseFillEmptyRowsImplCPU2($indices, indices.shape, indices.dtype, $values, values.dtype, $denseShape, $defaultValue); + return [ + backend4.makeTensorInfo(outputIndicesShape, indices.dtype, outputIndices), + backend4.makeTensorInfo([outputIndicesShape[0]], values.dtype, outputValues), + backend4.makeTensorInfo([emptyRowIndicator.length], "bool", new Uint8Array(emptyRowIndicator.map((value) => Number(value)))), + backend4.makeTensorInfo([reverseIndexMap.length], indices.dtype, new Int32Array(reverseIndexMap)) + ]; +} +var sparseFillEmptyRowsConfig4 = { + kernelName: SparseFillEmptyRows2, + backendName: "webgl", + kernelFunc: sparseFillEmptyRows6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SparseReshape.js +function sparseReshape6(args) { + const { inputs, backend: backend4 } = args; + const { inputIndices, inputShape, newShape } = inputs; + if (inputIndices.shape.length !== 2) { + throw new Error(`Input indices should be a matrix but received shape ${inputIndices.shape}`); + } + if (inputShape.shape.length !== 1) { + throw new Error(`Input shape should be a vector but received shape ${inputShape.shape}`); + } + if (newShape.shape.length !== 1) { + throw new Error(`Target shape should be a vector but received shape ${newShape.shape}`); + } + const $inputShape = Array.from(backend4.readSync(inputShape.dataId)); + const $inputIndices = backend4.readSync(inputIndices.dataId); + const targetShape = Array.from(backend4.readSync(newShape.dataId)); + const [newIndices, indicesShape, outputShape] = sparseReshapeImplCPU2($inputIndices, inputIndices.shape, inputIndices.dtype, $inputShape, targetShape); + return [ + backend4.makeTensorInfo(indicesShape, inputIndices.dtype, newIndices), + backend4.makeTensorInfo([outputShape.length], newShape.dtype, new Int32Array(outputShape)) + ]; +} +var sparseReshapeConfig4 = { + kernelName: SparseReshape2, + backendName: "webgl", + kernelFunc: sparseReshape6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SparseSegmentMean.js +function sparseSegmentMean6(args) { + const { inputs, backend: backend4 } = args; + const { data, indices, segmentIds } = inputs; + if (data.shape.length < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if (indices.shape.length !== 1) { + throw new Error(`Indices should be a vector but received shape + ${indices.shape}`); + } + if (segmentIds.shape.length !== 1) { + throw new Error(`Segment ids should be a vector but received shape + ${segmentIds.shape}`); + } + const $data = backend4.readSync(data.dataId); + const $indices = backend4.readSync(indices.dataId); + const $segmentIds = backend4.readSync(segmentIds.dataId); + const [outputData, outputDataShape] = sparseSegmentReductionImplCPU2($data, data.shape, data.dtype, $indices, $segmentIds, true); + return backend4.makeTensorInfo(outputDataShape, data.dtype, outputData); +} +var sparseSegmentMeanConfig4 = { + kernelName: SparseSegmentMean2, + backendName: "webgl", + kernelFunc: sparseSegmentMean6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SparseSegmentSum.js +function sparseSegmentSum6(args) { + const { inputs, backend: backend4 } = args; + const { data, indices, segmentIds } = inputs; + if (data.shape.length < 1) { + throw new Error(`Data should be at least 1 dimensional but received scalar`); + } + if (indices.shape.length !== 1) { + throw new Error(`Indices should be a vector but received shape + ${indices.shape}`); + } + if (segmentIds.shape.length !== 1) { + throw new Error(`Segment ids should be a vector but received shape + ${segmentIds.shape}`); + } + const $data = backend4.readSync(data.dataId); + const $indices = backend4.readSync(indices.dataId); + const $segmentIds = backend4.readSync(segmentIds.dataId); + const [outputData, outputDataShape] = sparseSegmentReductionImplCPU2($data, data.shape, data.dtype, $indices, $segmentIds); + return backend4.makeTensorInfo(outputDataShape, data.dtype, outputData); +} +var sparseSegmentSumConfig4 = { + kernelName: SparseSegmentSum2, + backendName: "webgl", + kernelFunc: sparseSegmentSum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SparseToDense.js +function sparseToDense6(args) { + const { inputs, backend: backend4, attrs } = args; + const { sparseIndices, sparseValues, defaultValue } = inputs; + const { outputShape } = attrs; + const { sliceRank, numUpdates, strides, outputSize: outputSize2 } = backend_util_exports2.calculateShapes(sparseValues, sparseIndices, outputShape); + const sumDupeIndices = false; + const program = new ScatterProgram2(numUpdates, sliceRank, sparseIndices.shape.length, sparseValues.shape.length, strides, [outputSize2, 1], sumDupeIndices); + const res = backend4.runWebGLProgram(program, [sparseValues, sparseIndices, defaultValue], sparseValues.dtype); + const reshaped = reshape8({ inputs: { x: res }, backend: backend4, attrs: { shape: outputShape } }); + backend4.disposeIntermediateTensorInfo(res); + return reshaped; +} +var sparseToDenseConfig4 = { + kernelName: SparseToDense2, + backendName: "webgl", + kernelFunc: sparseToDense6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SplitV.js +function splitV5(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { numOrSizeSplits, axis } = attrs; + const $axis = util_exports2.parseAxisParam(axis, x.shape)[0]; + const splitSizes = backend_util_exports2.prepareSplitSize(x, numOrSizeSplits, $axis); + const xRank = x.shape.length; + const begin = new Array(xRank).fill(0); + const size2 = x.shape.slice(); + return splitSizes.map((s) => { + const sliceSize = [...size2]; + sliceSize[$axis] = s; + const sliceT = slice7({ inputs: { x }, backend: backend4, attrs: { begin, size: sliceSize } }); + begin[$axis] += s; + return sliceT; + }); +} +var splitVConfig5 = { + kernelName: SplitV2, + backendName: "webgl", + kernelFunc: splitV5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Sqrt.js +var SQRT2 = `return sqrt(x);`; +var sqrt6 = unaryKernelFunc4({ opSnippet: SQRT2, packedOpSnippet: SQRT2, cpuKernelImpl: sqrtImplCPU2 }); +var sqrtConfig5 = { + kernelName: Sqrt2, + backendName: "webgl", + kernelFunc: sqrt6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Square.js +var SQUARE2 = `return x * x;`; +var square6 = unaryKernelFunc4({ opSnippet: SQUARE2 }); +var squareConfig5 = { + kernelName: Square2, + backendName: "webgl", + kernelFunc: square6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/SquaredDifference.js +var SQUARED_DIFFERENCE2 = "return (a - b) * (a - b);"; +var squaredDifference6 = binaryKernelFunc4({ opSnippet: SQUARED_DIFFERENCE2, packedOpSnippet: SQUARED_DIFFERENCE2 }); +var squaredDifferenceConfig5 = { + kernelName: SquaredDifference2, + backendName: "webgl", + kernelFunc: squaredDifference6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Step.js +function step7({ inputs, attrs, backend: backend4 }) { + const { x } = inputs; + const opSnippet = CHECK_NAN_SNIPPET4 + ` + return x > 0.0 ? 1.0 : float(${attrs.alpha}); + `; + const program = new UnaryOpProgram2(x.shape, opSnippet); + return backend4.runWebGLProgram(program, [x], x.dtype); +} +var stepConfig5 = { + kernelName: Step2, + backendName: "webgl", + kernelFunc: step7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/strided_slice_gpu.js +var StridedSliceProgram2 = class { + constructor(begin, strides, size2) { + this.variableNames = ["x"]; + this.outputShape = size2; + const rank = size2.length; + const inputDtype = getCoordsDataType2(size2.length); + const dtype = getCoordsDataType2(size2.length); + let newCoords = ""; + if (rank === 1) { + newCoords = "coords * strides + begin"; + } else { + let outputAxis = 0; + newCoords = size2.map((_, i) => { + outputAxis++; + return size2.length === 1 ? `coords * strides[${i}] + begin[${i}]` : `coords[${outputAxis - 1}] * strides[${i}] + begin[${i}]`; + }).join(","); + } + this.userCode = ` + ${inputDtype} begin = ${inputDtype}(${begin}); + ${inputDtype} strides = ${inputDtype}(${strides}); + + void main() { + ${dtype} coords = getOutputCoords(); + setOutput(getX(${newCoords})); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/StridedSlice.js +function stridedSlice7(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask } = attrs; + const { nonStrided, $begin, $strides, size: size2, newShape, outShape } = slice_util_exports2.sliceInfo(x.shape, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); + const $x = reshape8({ inputs: { x }, backend: backend4, attrs: { shape: newShape } }); + let result; + if (nonStrided) { + const sliced = slice7({ inputs: { x: $x }, backend: backend4, attrs: { begin: $begin, size: size2 } }); + result = reshape8({ inputs: { x: sliced }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo(sliced); + } else if (outShape.some((axis) => axis === 0)) { + result = backend4.makeTensorInfo(outShape, x.dtype, []); + } else { + const shouldExecuteOnCPU = backend4.shouldExecuteOnCPU([$x]); + if (shouldExecuteOnCPU) { + const xTexData = backend4.texData.get($x.dataId); + const values = xTexData.values; + const xBuf = buffer2($x.shape, $x.dtype, values); + const resultValues = stridedSliceImplCPU2(outShape, xBuf, $strides, $begin); + result = backend4.makeTensorInfo(outShape, $x.dtype, resultValues.values); + } else { + const program = new StridedSliceProgram2($begin, $strides, outShape); + result = backend4.runWebGLProgram(program, [$x], $x.dtype); + } + } + const resultReshaped = reshape8({ inputs: { x: result }, backend: backend4, attrs: { shape: outShape } }); + backend4.disposeIntermediateTensorInfo($x); + backend4.disposeIntermediateTensorInfo(result); + return resultReshaped; +} +var stridedSliceConfig5 = { + kernelName: StridedSlice2, + backendName: "webgl", + kernelFunc: stridedSlice7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/StringNGrams.js +function stringNGrams6(args) { + const { inputs, backend: backend4, attrs } = args; + const { separator, nGramWidths, leftPad, rightPad: rightPad3, padWidth, preserveShortSequences } = attrs; + const { data, dataSplits } = inputs; + const $data = backend4.readSync(data.dataId); + const $dataSplits = backend4.readSync(dataSplits.dataId); + const [nGrams, nGramsSplits] = stringNGramsImplCPU2($data, $dataSplits, separator, nGramWidths, leftPad, rightPad3, padWidth, preserveShortSequences); + return [ + backend4.makeTensorInfo([nGrams.length], "string", nGrams), + backend4.makeTensorInfo(dataSplits.shape, "int32", nGramsSplits) + ]; +} +var stringNGramsConfig4 = { + kernelName: StringNGrams2, + backendName: "webgl", + kernelFunc: stringNGrams6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/StringSplit.js +function stringSplit6(args) { + const { inputs, backend: backend4, attrs } = args; + const { skipEmpty } = attrs; + const { input: input3, delimiter } = inputs; + if (input3.dtype !== "string") { + throw new Error("Input must be of datatype string"); + } + if (input3.shape.length !== 1) { + throw new Error(`Input must be a vector, got shape: ${input3.shape}`); + } + if (delimiter.shape.length !== 0) { + throw new Error(`Delimiter must be a scalar, got shape: ${delimiter.shape}`); + } + const $input = backend4.readSync(input3.dataId); + const $delimiter = backend4.readSync(delimiter.dataId)[0]; + const [indices, values, shape] = stringSplitImplCPU2($input, $delimiter, skipEmpty); + const outputSize2 = values.length; + return [ + backend4.makeTensorInfo([outputSize2, 2], "int32", indices), + backend4.makeTensorInfo([outputSize2], "string", values), + backend4.makeTensorInfo([2], "int32", new Int32Array(shape)) + ]; +} +var stringSplitConfig4 = { + kernelName: StringSplit2, + backendName: "webgl", + kernelFunc: stringSplit6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/StringToHashBucketFast.js +function stringToHashBucketFast6(args) { + const { inputs, backend: backend4, attrs } = args; + const { numBuckets } = attrs; + const { input: input3 } = inputs; + if (input3.dtype !== "string") { + throw new Error("Input must be of datatype string"); + } + if (numBuckets <= 0) { + throw new Error(`Number of buckets must be at least 1`); + } + const $input = backend4.readSync(input3.dataId); + const output = stringToHashBucketFastImplCPU2($input, numBuckets); + return backend4.makeTensorInfo(input3.shape, "int32", output); +} +var stringToHashBucketFastConfig4 = { + kernelName: StringToHashBucketFast2, + backendName: "webgl", + kernelFunc: stringToHashBucketFast6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Tan.js +var TAN2 = `return tan(x);`; +var tan6 = unaryKernelFunc4({ opSnippet: TAN2 }); +var tanConfig5 = { + kernelName: Tan2, + backendName: "webgl", + kernelFunc: tan6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Tanh.js +var TANH2 = ` + float e2x = exp(-2.0 * abs(x)); + return sign(x) * (1.0 - e2x) / (1.0 + e2x); +`; +var tanh8 = unaryKernelFunc4({ opSnippet: TANH2 }); +var tanhConfig5 = { + kernelName: Tanh3, + backendName: "webgl", + kernelFunc: tanh8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/tile_gpu.js +var TileProgram2 = class { + constructor(aShape, reps) { + this.variableNames = ["A"]; + const outputShape = new Array(aShape.length); + for (let i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[i] * reps[i]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + const dtype = getCoordsDataType2(this.rank); + const sourceCoords = getSourceCoords6(aShape); + this.userCode = ` + void main() { + ${dtype} resRC = getOutputCoords(); + setOutput(getA(${sourceCoords})); + } + `; + } +}; +function getSourceCoords6(aShape) { + const rank = aShape.length; + if (rank > 5) { + throw Error(`Tile for rank ${rank} is not yet supported`); + } + if (rank === 1) { + return `imod(resRC, ${aShape[0]})`; + } + const currentCoords = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u"]; + const sourceCoords = []; + for (let i = 0; i < aShape.length; i++) { + sourceCoords.push(`imod(${currentCoords[i]}, ${aShape[i]})`); + } + return sourceCoords.join(); +} + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Tile.js +function tile9(params) { + const { inputs, backend: backend4, attrs } = params; + const { x } = inputs; + const { reps } = attrs; + if (x.dtype === "string" || x.shape.length > 5) { + const data = backend4.readSync(x.dataId); + const value = x.dtype === "string" ? data.map((d) => util_exports2.decodeString(d)) : data; + const buf = buffer2(x.shape, x.dtype, value); + const outBuf = tileImplCPU2(buf, reps); + return backend4.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values); + } + const program = new TileProgram2(x.shape, reps); + const output = backend4.runWebGLProgram(program, [x], x.dtype); + return output; +} +var tileConfig5 = { + kernelName: Tile2, + backendName: "webgl", + kernelFunc: tile9 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/top_k_gpu.js +var SwapProgram2 = class { + constructor(shape) { + this.variableNames = ["x", "indices"]; + this.customUniforms = [ + { name: "n", type: "int" }, + { name: "firstPass", type: "int" }, + { name: "negativeInf", type: "float" }, + { name: "dir", type: "int" }, + { name: "inc", type: "int" } + ]; + this.outputShape = shape; + this.userCode = ` + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int elemIdx = coords[1]; + + // We compare elements pair-wise within a group of size 2 * inc. + // The comparing rule for each group alternates between ascending + // and descending. Within each group, we compare each pair at + // positions i and i+inc. To decide whether an element at position i + // is x0 or x1, we mod it by 2 * inc, if the result is smaller than + // inc, it is in the first half of the group, we denote it as x0, + // otherwise we denote it as x1. + // For example, as shown in the Bitonic top K paper referenced above, + // Figure5(a) shows that element[1] is in the + // second half of the group when group size is 2, but it is in the + // first half of the group when group size is 4. + + bool isFirstInPair = imod(elemIdx, 2 * inc) < inc; + int i = isFirstInPair ? elemIdx : elemIdx - inc; + + int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); + int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc)); + float x0 = i0 < n ? getX(batch, i0) : negativeInf; + float x1 = i1 < n ? getX(batch, i1) : negativeInf; + + // Denotes which direction indices are in (ascending or descending). + bool reverse = imod(elemIdx, 2 * dir) >= dir; + bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0); + if (reverse == isGreater) { // Elements in opposite order of direction + int iTemp = i0; + i0 = i1; + i1 = iTemp; + } + if (isFirstInPair) { + setOutput(float(i0)); + } else { + setOutput(float(i1)); + } + } + `; + } +}; +var MergeProgram2 = class { + constructor(shape) { + this.variableNames = ["x", "indices"]; + this.customUniforms = [ + { name: "n", type: "int" }, + { name: "firstPass", type: "int" }, + { name: "k", type: "int" } + ]; + this.outputShape = shape; + this.userCode = ` + void main() { + // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int elemIdx = coords[1]; + + // The output size is half of the previous size. + // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4), + // we only need to output the indices at positions |, the indices at + // positions _ can be thrown away, see Figure5(b) After Phase 2 + // (Merge phase) in the Bitonic Top K paper referenced above. + // For example, the paper shows we only need to output the orange bars. + // The output sequence should look like this | | | | | | | |. + // Because the sequence is halved, to map the output index back + // to the previous sequence to find the corresponding value, + // we need to double the index. When we double the index, + // we basically interpolate a position, so 2i looks like + // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position + // of each 2k positions by - elemIdx % k. E.g. for output at + // index 4,5,6,7, we want to get the corresponding element at + // original index 8,9,10,11, for output at index 8,9,10,11, + // we want to get the corresponding element at original index + // 16,17,18,19, so on and so forth. + + int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k)); + int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); + int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k)); + + float x0 = getX(batch, i0); + float x1 = i1 < n ? getX(batch, i1) : x0; + + setOutput(x0 >= x1 ? float(i0) : float(i1)); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/TopK.js +function disposeIntermediateTensorInfoOrNull2(backend4, tensorInfo) { + if (tensorInfo !== null) { + backend4.disposeIntermediateTensorInfo(tensorInfo); + } +} +function roundUpToPow22(num) { + let pow22 = 1; + while (pow22 < num) { + pow22 *= 2; + } + return pow22; +} +function topK4(args) { + const { inputs, backend: backend4, attrs } = args; + const { x } = inputs; + const { k, sorted } = attrs; + const TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD = env3().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"); + const TOPK_K_CPU_HANDOFF_THRESHOLD = env3().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"); + const xShape = x.shape; + const lastDim = xShape[xShape.length - 1]; + if (backend4.shouldExecuteOnCPU([x]) || lastDim < TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD || k > TOPK_K_CPU_HANDOFF_THRESHOLD) { + const xVals = backend4.readSync(x.dataId); + const [allTopKVals, allTopKIndices] = topKImplCPU2(xVals, xShape, x.dtype, k, sorted); + return [ + backend4.makeTensorInfo(allTopKVals.shape, allTopKVals.dtype, allTopKVals.values), + backend4.makeTensorInfo(allTopKIndices.shape, allTopKIndices.dtype, allTopKIndices.values) + ]; + } + if (k === 0) { + xShape[xShape.length - 1] = 0; + return [ + backend4.makeTensorInfo(xShape, x.dtype, []), + backend4.makeTensorInfo(xShape, "int32", []) + ]; + } + if (lastDim === 1) { + return [ + x, + fill7({ attrs: { shape: xShape, dtype: "int32", value: 0 }, backend: backend4 }) + ]; + } + const xtexData = backend4.texData.get(x.dataId); + const xIsPacked = xtexData !== null && xtexData.isPacked; + const xUnPacked = xIsPacked ? backend4.unpackTensor(x) : x; + const xSize = util_exports2.sizeFromShape(xShape); + const batch = xSize / lastDim; + const x2D = reshape8({ inputs: { x: xUnPacked }, attrs: { shape: [batch, lastDim] }, backend: backend4 }); + if (xIsPacked) { + disposeIntermediateTensorInfoOrNull2(backend4, xUnPacked); + } + const kPow2 = roundUpToPow22(k); + const lastDimPow2 = roundUpToPow22(lastDim); + let indices = null; + const getInputs = () => indices === null ? [x2D, x2D] : [x2D, indices]; + const runSwap = (dir, inc, shape) => { + const inputs2 = getInputs(); + const program = new SwapProgram2(shape); + const fistPass = indices === null ? 1 : 0; + const customValues = [[lastDim], [fistPass], [Number.NEGATIVE_INFINITY], [dir], [inc]]; + const prevIndices2 = indices; + indices = backend4.runWebGLProgram(program, inputs2, "int32", customValues); + disposeIntermediateTensorInfoOrNull2(backend4, prevIndices2); + }; + for (let len = 1; len < kPow2; len *= 2) { + const dir = len * 2; + for (let inc = len; inc >= 1; inc /= 2) { + runSwap(dir, inc, [batch, lastDimPow2]); + } + } + for (let indicesSize = lastDimPow2; indicesSize > kPow2; indicesSize /= 2) { + const inputs2 = getInputs(); + const mergeProgram = new MergeProgram2([batch, indicesSize / 2]); + const firstPass = indices === null ? 1 : 0; + const customValues = [[lastDim], [firstPass], [kPow2]]; + const prevIndices2 = indices; + indices = backend4.runWebGLProgram(mergeProgram, inputs2, "int32", customValues); + disposeIntermediateTensorInfoOrNull2(backend4, prevIndices2); + const len = kPow2 / 2; + const dir = len * 2; + for (let inc = len; inc >= 1; inc /= 2) { + runSwap(dir, inc, indices.shape); + } + } + let prevIndices = indices; + indices = slice7({ inputs: { x: indices }, backend: backend4, attrs: { begin: 0, size: [batch, k] } }); + disposeIntermediateTensorInfoOrNull2(backend4, prevIndices); + let values = gatherV25({ inputs: { x: x2D, indices }, backend: backend4, attrs: { axis: 1, batchDims: 1 } }); + disposeIntermediateTensorInfoOrNull2(backend4, x2D); + const newShape = xShape.slice(0, -1); + newShape.push(k); + prevIndices = indices; + indices = reshape8({ inputs: { x: indices }, attrs: { shape: newShape }, backend: backend4 }); + disposeIntermediateTensorInfoOrNull2(backend4, prevIndices); + const prevValues = values; + values = reshape8({ inputs: { x: values }, attrs: { shape: newShape }, backend: backend4 }); + disposeIntermediateTensorInfoOrNull2(backend4, prevValues); + return [values, indices]; +} +var topKConfig5 = { + kernelName: TopK2, + backendName: "webgl", + kernelFunc: topK4 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/transform_gpu.js +var TransformProgram2 = class { + constructor(imageHeight, imageWidth, interpolation, fillMode, fillValue, outShape) { + this.variableNames = ["Image", "Transforms"]; + this.outputShape = outShape; + const interpolationModeId = interpolation === "nearest" ? 1 : 2; + let fillModeId; + switch (fillMode) { + case "constant": + fillModeId = 1; + break; + case "reflect": + fillModeId = 2; + break; + case "wrap": + fillModeId = 3; + break; + case "nearest": + fillModeId = 4; + break; + default: + fillModeId = 1; + break; + } + this.userCode = ` + float mapCoord(float outCoord, float len) { + float inCoord = outCoord; + if(${fillModeId} == 2) { + if (inCoord < 0.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz2 = 2.0 * len; + if (inCoord < sz2) { + inCoord = sz2 * float(int(float(-inCoord / sz2))) + + inCoord; + } + inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0; + } + } else if (inCoord > len - 1.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz2 = 2.0 * len; + inCoord -= sz2 * float(int(float(inCoord / sz2))); + if (inCoord >= len) { + inCoord = sz2 - inCoord - 1.0; + } + } + } + return clamp(inCoord, 0.0, len - 1.0); + } else if (${fillModeId} == 3) { + if (inCoord < 0.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz = len - 1.0; + inCoord += len * (float(int(float(-inCoord / sz))) + 1.0); + } + } else if (inCoord > len - 1.0) { + if (len <= 1.0) { + inCoord = 0.0; + } else { + float sz = len - 1.0; + inCoord -= len * float(int(float(inCoord / sz))); + } + } + return clamp(inCoord, 0.0, len - 1.0); + } else if (${fillModeId} == 4) { + return clamp(outCoord, 0.0, len - 1.0); + } else { + return outCoord; + } + } + + float readWithFillValue(int batch, int coordY, int coordX, + int channel) { + float outputValue; + if (0 <= coordY && coordY < ${imageHeight} && 0 <= coordX && coordX < ${imageWidth}) { + outputValue = getImage(batch, coordY, coordX, channel); + } else { + outputValue = float(${fillValue}); + } + return outputValue; + } + + void main() { + ivec4 coords = getOutputCoords(); + float outputValue; + int batch = coords[0]; + int x = coords[2]; + int y = coords[1]; + int channel = coords[3]; + float xf = float(x); + float yf = float(y); + float a1 = getTransforms(batch, 0); + float a2 = getTransforms(batch, 1); + float a3 = getTransforms(batch, 2); + float b1 = getTransforms(batch, 3); + float b2 = getTransforms(batch, 4); + float b3 = getTransforms(batch, 5); + float c1 = getTransforms(batch, 6); + float c2 = getTransforms(batch, 7); + float projection = c1 * xf + c2 * yf + 1.0; + if (projection == 0.0) { + outputValue = float(${fillValue}); + } else { + float inX = (a1 * xf + a2 * yf + a3) / projection; + float inY = (b1 * xf + b2 * yf + b3) / projection; + float mapX = mapCoord(inX, float(${imageWidth})); + float mapY = mapCoord(inY, float(${imageHeight})); + + if (${interpolationModeId} == 1) { + int coordY = int(round(mapY)); + int coordX = int(round(mapX)); + outputValue = readWithFillValue(batch, coordY, coordX, + channel); + } else { + float yFloor = floor(mapY); + float xFloor = floor(mapX); + float yCeil = yFloor + 1.0; + float xCeil = xFloor + 1.0; + float valueYFloor = (xCeil - mapX) * + readWithFillValue(batch, int(yFloor), int(xFloor), channel) + + (mapX - xFloor) * + readWithFillValue(batch, int(yFloor), int(xCeil), channel); + float valueYCeil = (xCeil - mapX) * + readWithFillValue(batch, int(yCeil), int(xFloor), channel) + + (mapX - xFloor) * + readWithFillValue(batch, int(yCeil), int(xCeil), channel); + outputValue = (yCeil - mapY) * valueYFloor + + (mapY - yFloor) * valueYCeil; + } + } + setOutput(outputValue); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Transform.js +function transform7(args) { + const { inputs, backend: backend4, attrs } = args; + const { image: image9, transforms } = inputs; + const { interpolation, fillMode, fillValue, outputShape } = attrs; + const [batch, imageHeight, imageWidth, numChannels] = image9.shape; + const [outHeight, outWidth] = outputShape != null ? outputShape : [imageHeight, imageWidth]; + const outShape = [ + batch, + outHeight, + outWidth, + numChannels + ]; + const program = new TransformProgram2(imageHeight, imageWidth, interpolation, fillMode, fillValue, outShape); + return backend4.runWebGLProgram(program, [image9, transforms], "float32"); +} +var transformConfig5 = { + kernelName: Transform2, + backendName: "webgl", + kernelFunc: transform7 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Unique.js +function unique8(args) { + const { inputs, attrs, backend: backend4 } = args; + const { axis } = attrs; + const { x } = inputs; + assertNotComplex4(x, "unique"); + console.warn("WARNING: ", "UI might be locked temporarily as data is being downloaded"); + const values = backend4.readSync(x.dataId); + const { outputValues, outputShape, indices } = uniqueImplCPU2(values, axis, x.shape, x.dtype); + return [ + backend4.makeTensorInfo(outputShape, x.dtype, outputValues), + backend4.makeTensorInfo([indices.length], "int32", indices) + ]; +} +var uniqueConfig4 = { + kernelName: Unique2, + backendName: "webgl", + kernelFunc: unique8 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Unpack.js +function unpack5(args) { + const { inputs, backend: backend4, attrs } = args; + const { value } = inputs; + let { axis } = attrs; + if (axis < 0) { + axis += value.shape.length; + } + const x = value; + const xRank = x.shape.length; + const num = value.shape[axis]; + const outShape = new Array(xRank - 1); + let outIndex = 0; + for (let i = 0; i < xRank; i++) { + if (i !== axis) { + outShape[outIndex++] = x.shape[i]; + } + } + const toDispose = []; + const begin = new Array(xRank).fill(0); + const size2 = x.shape.slice(); + size2[axis] = 1; + const res = new Array(num); + for (let i = 0; i < res.length; i++) { + begin[axis] = i; + const sliced = slice7({ inputs: { x }, backend: backend4, attrs: { begin, size: size2 } }); + const reshaped = reshape8({ inputs: { x: sliced }, backend: backend4, attrs: { shape: outShape } }); + res[i] = reshaped; + toDispose.push(sliced); + } + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return res; +} +var unpackConfig5 = { + kernelName: Unpack2, + backendName: "webgl", + kernelFunc: unpack5 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/segment_gpu.js +var SegmentOpProgram2 = class { + constructor(segOpInfo, segOpType) { + this.variableNames = ["x", "segmentIds"]; + const windowSize = segOpInfo.windowSize; + const batchSize = segOpInfo.batchSize; + const inSize = segOpInfo.inSize; + const numSegments = segOpInfo.numSegments; + const outSize = numSegments * Math.ceil(inSize / windowSize); + this.outputShape = [batchSize, outSize]; + const initializationValue = "0.0"; + const returnValue = `sumValue`; + const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + const windowSizeVec4Remainder = windowSize % 4; + const updateSnippet = ` + sumValue += dot(values, segFilter); + `; + let checkValueOutOfBounds = ""; + if (inSize % windowSize > 0) { + checkValueOutOfBounds = ` + if (inIdx < 0 || inIdx >= ${inSize}) { + return initializationValue; + } + `; + } + let checkSegmentIdOutOfBounds = ""; + if (inSize % windowSize > 0) { + checkSegmentIdOutOfBounds = ` + if (inIdx < 0 || inIdx >= ${inSize}) { + return -1.0; + } + `; + } + this.userCode = ` + const float initializationValue = ${initializationValue}; + + float getValue(int batch, int inIdx) { + ${checkValueOutOfBounds} + return getX(batch, inIdx); + } + + float getSegmentIdAtIndex(int inIdx) { + ${checkSegmentIdOutOfBounds} + return getSegmentIds(inIdx); + } + + void main() { + ivec2 coords = getOutputCoords(); + int batch = coords[0]; + int outIdx = coords[1]; + int inOffset = int(floor(float(outIdx) / float( + ${numSegments})) * float(${windowSize})); + int currentSeg = int(mod(float(outIdx), float(${numSegments}))); + + float sumValue = 0.0; + + for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) { + int inIdx = inOffset + i; + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + getValue(batch, inIdx + 3) + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 + ); + + ${updateSnippet} + } + + int inIdx = inOffset + ${windowSizeNearestVec4}; + if (${windowSizeVec4Remainder === 1}) { + vec4 values = vec4( + getValue(batch, inIdx), + initializationValue, + initializationValue, + initializationValue + ); + + int inIdxSeg = int(getSegmentIdAtIndex(inIdx)); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + 0, + 0, + 0 + ); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 2}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + initializationValue, + initializationValue + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + 0, + 0 + ); + + ${updateSnippet} + } else if (${windowSizeVec4Remainder === 3}) { + vec4 values = vec4( + getValue(batch, inIdx), + getValue(batch, inIdx + 1), + getValue(batch, inIdx + 2), + initializationValue + ); + + vec4 segFilter = vec4( + int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, + int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, + 0 + ); + + ${updateSnippet} + } + setOutput(${returnValue}); + } + `; + } +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/UnsortedSegmentSum.js +function unsortedSegmentSum6(args) { + const { inputs, backend: backend4, attrs } = args; + const { x, segmentIds } = inputs; + const { numSegments } = attrs; + const xRank = x.shape.length; + const toDispose = []; + let axis = 0; + const permutation = backend_util_exports2.getAxesPermutation([axis], xRank); + let permutedX = x; + if (permutation != null) { + permutedX = transpose7({ inputs: { x }, backend: backend4, attrs: { perm: permutation } }); + toDispose.push(permutedX); + axis = backend_util_exports2.getInnerMostAxes(1, xRank)[0]; + } + const outShape = backend_util_exports2.segment_util.computeOutShape(permutedX.shape, axis, numSegments); + const inSize = util_exports2.sizeFromShape([permutedX.shape[axis]]); + const a2D = reshape8({ inputs: { x: permutedX }, backend: backend4, attrs: { shape: [-1, inSize] } }); + toDispose.push(a2D); + const outputDType = sumOutType2(x.dtype); + const segOpCompute = (x2, segOpType, segmentIds2, dtype, numSegments2) => { + const batchSize = x2.shape[0]; + const inSize2 = x2.shape[1]; + const windowSize = backend_util_exports2.segment_util.segOpComputeOptimalWindowSize(inSize2, numSegments2); + const segOpInfo = { windowSize, inSize: inSize2, batchSize, numSegments: numSegments2 }; + const program = new SegmentOpProgram2(segOpInfo, segOpType); + const output = backend4.compileAndRun(program, [x2, segmentIds2], dtype); + toDispose.push(output); + if (output.shape[1] === numSegments2) { + return output; + } + const rangeInfo = range9({ + backend: backend4, + attrs: { start: 0, stop: numSegments2, step: 1, dtype: "float32" } + }); + const tileInfo = tile9({ + inputs: { x: rangeInfo }, + backend: backend4, + attrs: { reps: [inSize2 / windowSize] } + }); + toDispose.push(rangeInfo); + toDispose.push(tileInfo); + const result2 = segOpCompute(output, segOpType, tileInfo, dtype, numSegments2); + return result2; + }; + const segOpResult = segOpCompute(a2D, "unsortedSegmentSum", segmentIds, outputDType, numSegments); + const reshaped = reshape8({ inputs: { x: segOpResult }, backend: backend4, attrs: { shape: outShape } }); + let result = reshaped; + if (permutation != null) { + toDispose.push(reshaped); + const perm = backend_util_exports2.getUndoAxesPermutation(permutation); + result = transpose7({ inputs: { x: result }, backend: backend4, attrs: { perm } }); + } + toDispose.forEach((t) => backend4.disposeIntermediateTensorInfo(t)); + return result; +} +var unsortedSegmentSumConfig4 = { + kernelName: UnsortedSegmentSum2, + backendName: "webgl", + kernelFunc: unsortedSegmentSum6 +}; + +// node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/dist/register_all_kernels.js +var kernelConfigs5 = [ + LRNConfig2, + LRNGradConfig2, + _fusedMatMulConfig4, + absConfig5, + acosConfig4, + acoshConfig4, + addConfig5, + addNConfig5, + allConfig5, + anyConfig5, + argMaxConfig5, + argMinConfig4, + asinConfig4, + asinhConfig4, + atan2Config4, + atanConfig4, + atanhConfig4, + avgPool3DConfig4, + avgPoolConfig5, + avgPoolGrad3DConfig2, + avgPoolGradConfig6, + batchMatMulConfig5, + batchNormConfig4, + batchToSpaceNDConfig5, + bincountConfig4, + castConfig5, + ceilConfig5, + clipByValueConfig3, + complexAbsConfig4, + complexConfig4, + concatConfig5, + conv2DBackpropFilterConfig4, + conv2DBackpropInputConfig5, + conv2DConfig5, + conv3DBackpropFilterV2Config4, + conv3DBackpropInputConfig2, + conv3DConfig4, + cosConfig5, + coshConfig5, + cropAndResizeConfig5, + cumsumConfig5, + denseBincountConfig4, + depthToSpaceConfig5, + depthwiseConv2dNativeBackpropFilterConfig4, + depthwiseConv2dNativeBackpropInputConfig4, + depthwiseConv2dNativeConfig5, + diagConfig4, + dilation2DConfig2, + einsumConfig4, + eluConfig5, + eluGradConfig6, + equalConfig5, + erfConfig4, + expConfig5, + expandDimsConfig5, + expm1Config4, + fftConfig4, + fillConfig5, + flipLeftRightConfig5, + floorConfig5, + floorDivConfig5, + fromPixelsConfig2, + fusedConv2DConfig5, + fusedDepthwiseConv2DConfig5, + gatherNdConfig5, + gatherV2Config5, + greaterConfig5, + greaterEqualConfig5, + identityConfig5, + ifftConfig4, + imagConfig4, + isFiniteConfig4, + isInfConfig4, + isNaNConfig4, + leakyReluConfig5, + lessConfig5, + lessEqualConfig5, + linSpaceConfig4, + log1pConfig4, + logConfig5, + logicalAndConfig5, + logicalNotConfig4, + logicalOrConfig4, + maxConfig5, + maxPool3DConfig4, + maxPoolConfig5, + maxPoolGrad3DConfig2, + maxPoolGradConfig6, + maxPoolWithArgmaxConfig4, + maximumConfig5, + meanConfig5, + minConfig5, + minimumConfig5, + mirrorPadConfig5, + modConfig4, + multinomialConfig4, + multiplyConfig5, + negConfig5, + nonMaxSuppressionV3Config5, + nonMaxSuppressionV4Config5, + nonMaxSuppressionV5Config5, + notEqualConfig5, + oneHotConfig5, + onesLikeConfig5, + packConfig5, + padV2Config5, + powConfig5, + preluConfig5, + prodConfig5, + rangeConfig5, + realConfig4, + realDivConfig5, + reciprocalConfig4, + relu6Config5, + reluConfig5, + reshapeConfig5, + resizeBilinearConfig5, + resizeBilinearGradConfig6, + resizeNearestNeighborConfig4, + resizeNearestNeighborGradConfig6, + reverseConfig5, + rotateWithOffsetConfig5, + roundConfig5, + rsqrtConfig5, + scatterNdConfig5, + selectConfig5, + seluConfig4, + sigmoidConfig5, + signConfig4, + sinConfig5, + sinhConfig4, + sliceConfig5, + softmaxConfig5, + softplusConfig4, + spaceToBatchNDConfig5, + sparseFillEmptyRowsConfig4, + sparseReshapeConfig4, + sparseSegmentMeanConfig4, + sparseSegmentSumConfig4, + sparseToDenseConfig4, + splitVConfig5, + sqrtConfig5, + squareConfig5, + squaredDifferenceConfig5, + stepConfig5, + stridedSliceConfig5, + stringNGramsConfig4, + stringSplitConfig4, + stringToHashBucketFastConfig4, + subConfig5, + sumConfig5, + tanConfig5, + tanhConfig5, + tileConfig5, + topKConfig5, + transformConfig5, + transposeConfig5, + uniqueConfig4, + unpackConfig5, + unsortedSegmentSumConfig4, + zerosLikeConfig5 +]; +for (const kernelConfig of kernelConfigs5) { + registerKernel2(kernelConfig); +} + +// src/body/blazeposecoords.ts +var kpt = [ "nose", "leftEyeInside", "leftEye", @@ -69555,58 +122249,38 @@ var full = [ "rightHeel", "leftFoot", "rightFoot", - "midHip", - "forehead", + "bodyCenter", + "bodyTop", "leftThumb", "leftHand", "rightThumb", "rightHand" ]; -var upper = [ - "nose", - "leftEyeInside", - "leftEye", - "leftEyeOutside", - "rightEyeInside", - "rightEye", - "rightEyeOutside", - "leftEar", - "rightEar", - "leftMouth", - "rightMouth", - "leftShoulder", - "rightShoulder", - "leftElbow", - "rightElbow", - "left:15", - "right:16", - "left:17", - "right:18", - "left:19", - "right:20", - "left:21", - "right:22", - "leftChest", - "rightChest", - "neck", - "forehead", - "left:27", - "right:28", - "left:29", - "right:30" -]; +var connected = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle", "leftHeel", "leftFoot"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle", "rightHeel", "rightFoot"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist", "leftPalm"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist", "rightPalm"], + leftHand: [], + rightHand: [], + head: [] +}; // src/body/blazepose.ts +var env4 = { initial: true }; var models2 = [null, null]; -var outputNodes = ["ld_3d", "activation_segmentation", "activation_heatmap", "world_3d", "output_poseflag"]; var inputSize5 = [[0, 0], [0, 0]]; -var outputSize2 = [0, 0]; +var skipped5 = Number.MAX_SAFE_INTEGER; +var outputNodes; +var cache2 = null; +var padding = [[0, 0], [0, 0], [0, 0], [0, 0]]; async function loadDetect2(config3) { - var _a; - if (env2.initial) + var _a, _b; + if (env4.initial) models2[0] = null; - if (!models2[0]) { - models2[0] = await loadGraphModel(join(config3.modelBasePath, ((_a = config3.body.detector) == null ? void 0 : _a.modelPath) || "")); + if (!models2[0] && ((_a = config3.body.detector) == null ? void 0 : _a.modelPath) || "") { + models2[0] = await loadGraphModel2(join(config3.modelBasePath, ((_b = config3.body.detector) == null ? void 0 : _b.modelPath) || "")); const inputs = Object.values(models2[0].modelSignature["inputs"]); inputSize5[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize5[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; @@ -69614,18 +122288,23 @@ async function loadDetect2(config3) { log("load model failed:", config3.object.modelPath); else if (config3.debug) log("load model:", models2[0]["modelUrl"]); - } else if (config3.debug) + } else if (config3.debug && models2[0]) log("cached model:", models2[0]["modelUrl"]); return models2[0]; } async function loadPose(config3) { - if (env2.initial) + var _a; + if (env4.initial) models2[1] = null; if (!models2[1]) { - models2[1] = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); + models2[1] = await loadGraphModel2(join(config3.modelBasePath, config3.body.modelPath || "")); const inputs = Object.values(models2[1].modelSignature["inputs"]); inputSize5[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize5[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; + if ((_a = config3.body.modelPath) == null ? void 0 : _a.includes("lite")) + outputNodes = ["ld_3d", "output_segmentation", "output_heatmap", "world_3d", "output_poseflag"]; + else + outputNodes = ["Identity", "Identity_2", "Identity_3", "Identity_4", "Identity_1"]; if (!models2[1] || !models2[1]["modelUrl"]) log("load model failed:", config3.object.modelPath); else if (config3.debug) @@ -69634,136 +122313,198 @@ async function loadPose(config3) { log("cached model:", models2[1]["modelUrl"]); return models2[1]; } -async function detectParts(input2, config3) { - var _a; - const t = {}; - t.resize = image.resizeBilinear(input2, [inputSize5[1][0], inputSize5[1][1]]); - [t.ld, t.segmentation, t.heatmap, t.world, t.poseflag] = await ((_a = models2[1]) == null ? void 0 : _a.execute(t.resize, outputNodes)); - const points = await t.ld.data(); - const keypoints3 = []; - const labels2 = (points == null ? void 0 : points.length) === 195 ? full : upper; - const depth = 5; - for (let i = 0; i < points.length / depth; i++) { - const score3 = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; - if (score3 > (config3.body.minConfidence || 0)) { - keypoints3.push({ - part: labels2[i], - position: [ - Math.trunc(outputSize2[0] * points[depth * i + 0] / 255), - Math.trunc(outputSize2[1] * points[depth * i + 1] / 255), - Math.trunc(points[depth * i + 2]) + 0 - ], - positionRaw: [ - points[depth * i + 0] / 255, - points[depth * i + 1] / 255, - points[depth * i + 2] + 0 - ], - score: score3 - }); - } - } +function calculateBoxes(keypoints3, outputSize2) { const x = keypoints3.map((a) => a.position[0]); const y = keypoints3.map((a) => a.position[1]); - const box4 = [ - Math.min(...x), - Math.min(...y), - Math.max(...x) - Math.min(...x), - Math.max(...y) - Math.min(...x) - ]; - const boxRaw2 = [0, 0, 0, 0]; - const score2 = keypoints3.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); - return { id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints3 }; + const keypointsBox = [Math.min(...x), Math.min(...y), Math.max(...x) - Math.min(...x), Math.max(...y) - Math.min(...y)]; + const keypointsBoxRaw = [keypointsBox[0] / outputSize2[0], keypointsBox[1] / outputSize2[1], keypointsBox[2] / outputSize2[0], keypointsBox[3] / outputSize2[1]]; + return { keypointsBox, keypointsBoxRaw }; } -async function predict7(input2, config3) { - outputSize2 = [input2.shape[2] || 0, input2.shape[1] || 0]; - const bodies = []; - const body4 = await detectParts(input2, config3); - bodies.push(body4); - return bodies; +async function prepareImage(input3) { + const t = {}; + if (!input3.shape || !input3.shape[1] || !input3.shape[2]) + return input3; + padding = [ + [0, 0], + [input3.shape[2] > input3.shape[1] ? Math.trunc((input3.shape[2] - input3.shape[1]) / 2) : 0, input3.shape[2] > input3.shape[1] ? Math.trunc((input3.shape[2] - input3.shape[1]) / 2) : 0], + [input3.shape[1] > input3.shape[2] ? Math.trunc((input3.shape[1] - input3.shape[2]) / 2) : 0, input3.shape[1] > input3.shape[2] ? Math.trunc((input3.shape[1] - input3.shape[2]) / 2) : 0], + [0, 0] + ]; + t.pad = pad3(input3, padding); + t.resize = image3.resizeBilinear(t.pad, [inputSize5[1][0], inputSize5[1][1]]); + const final = div3(t.resize, 255); + Object.keys(t).forEach((tensor3) => dispose2(t[tensor3])); + return final; +} +function rescaleKeypoints(keypoints3, outputSize2) { + for (const kpt4 of keypoints3) { + kpt4.position = [ + kpt4.position[0] * (outputSize2[0] + padding[2][0] + padding[2][1]) / outputSize2[0] - padding[2][0], + kpt4.position[1] * (outputSize2[1] + padding[1][0] + padding[1][1]) / outputSize2[1] - padding[1][0], + kpt4.position[2] + ]; + kpt4.positionRaw = [ + kpt4.position[0] / outputSize2[0], + kpt4.position[1] / outputSize2[1], + kpt4.position[2] + ]; + } + return keypoints3; +} +async function detectParts(input3, config3, outputSize2) { + var _a; + const t = {}; + t.input = await prepareImage(input3); + [t.ld, t.segmentation, t.heatmap, t.world, t.poseflag] = await ((_a = models2[1]) == null ? void 0 : _a.execute(t.input, outputNodes)); + const points = await t.ld.data(); + const keypointsRelative = []; + const depth = 5; + for (let i = 0; i < points.length / depth; i++) { + const score2 = (100 - Math.trunc(100 / (1 + Math.exp(points[depth * i + 3])))) / 100; + const positionRaw = [points[depth * i + 0] / inputSize5[1][0], points[depth * i + 1] / inputSize5[1][1], points[depth * i + 2] + 0]; + const position = [Math.trunc(outputSize2[0] * positionRaw[0]), Math.trunc(outputSize2[1] * positionRaw[1]), positionRaw[2]]; + keypointsRelative.push({ part: kpt[i], positionRaw, position, score: score2 }); + } + const avgScore = Math.round(100 * keypointsRelative.reduce((prev, curr) => prev += curr.score, 0) / keypointsRelative.length) / 100; + if (avgScore < (config3.body.minConfidence || 0)) + return null; + const keypoints3 = rescaleKeypoints(keypointsRelative, outputSize2); + const boxes = calculateBoxes(keypoints3, [outputSize2[0], outputSize2[1]]); + Object.keys(t).forEach((tensor3) => dispose2(t[tensor3])); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints3.find((kpt4) => kpt4.part === indexes[i]); + const pt1 = keypoints3.find((kpt4) => kpt4.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + return { id: 0, score: avgScore, box: boxes.keypointsBox, boxRaw: boxes.keypointsBoxRaw, keypoints: keypoints3, annotations: annotations2 }; +} +async function predict7(input3, config3) { + const outputSize2 = [input3.shape[2] || 0, input3.shape[1] || 0]; + if (skipped5 < (config3.body.skipFrames || 0) && config3.skipFrame) { + skipped5++; + } else { + cache2 = await detectParts(input3, config3, outputSize2); + skipped5 = 0; + } + if (cache2) + return [cache2]; + return []; } +// src/body/efficientposecoords.ts +var kpt2 = [ + "head", + "neck", + "rightShoulder", + "rightElbow", + "rightWrist", + "chest", + "leftShoulder", + "leftElbow", + "leftWrist", + "bodyCenter", + "rightHip", + "rightKnee", + "rightAnkle", + "leftHip", + "leftKnee", + "leftAnkle" +]; +var connected2 = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist"], + head: [] +}; + // src/body/efficientpose.ts -var model8; +var model9; var keypoints = []; var box3 = [0, 0, 0, 0]; var boxRaw = [0, 0, 0, 0]; var score = 0; -var skipped5 = Number.MAX_SAFE_INTEGER; -var bodyParts = ["head", "neck", "rightShoulder", "rightElbow", "rightWrist", "chest", "leftShoulder", "leftElbow", "leftWrist", "pelvis", "rightHip", "rightKnee", "rightAnkle", "leftHip", "leftKnee", "leftAnkle"]; +var skipped6 = Number.MAX_SAFE_INTEGER; async function load8(config3) { if (env2.initial) - model8 = null; - if (!model8) { - model8 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); - if (!model8 || !model8["modelUrl"]) + model9 = null; + if (!model9) { + model9 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); + if (!model9 || !model9["modelUrl"]) log("load model failed:", config3.body.modelPath); else if (config3.debug) - log("load model:", model8["modelUrl"]); + log("load model:", model9["modelUrl"]); } else if (config3.debug) - log("cached model:", model8["modelUrl"]); - return model8; + log("cached model:", model9["modelUrl"]); + return model9; } function max2d(inputs, minScore) { const [width, height] = inputs.shape; return tidy(() => { - const mod4 = (a, b) => sub(a, mul(div(a, scalar(b, "int32")), scalar(b, "int32"))); + const mod7 = (a, b) => sub(a, mul(div(a, scalar(b, "int32")), scalar(b, "int32"))); const reshaped = reshape(inputs, [height * width]); const newScore = max(reshaped, 0).dataSync()[0]; if (newScore > minScore) { - const coords5 = argMax(reshaped, 0); - const x = mod4(coords5, width).dataSync()[0]; - const y = div(coords5, scalar(width, "int32")).dataSync()[0]; + const coordinates = argMax(reshaped, 0); + const x = mod7(coordinates, width).dataSync()[0]; + const y = div(coordinates, scalar(width, "int32")).dataSync()[0]; return [x, y, newScore]; } return [0, 0, newScore]; }); } -async function predict8(image7, config3) { +async function predict8(image9, config3) { var _a; - if (skipped5 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) { - skipped5++; - return [{ id: 0, score, box: box3, boxRaw, keypoints }]; + if (skipped6 < (((_a = config3.body) == null ? void 0 : _a.skipFrames) || 0) && config3.skipFrame && Object.keys(keypoints).length > 0) { + skipped6++; + return [{ id: 0, score, box: box3, boxRaw, keypoints, annotations: {} }]; } - skipped5 = 0; + skipped6 = 0; return new Promise(async (resolve) => { var _a2; - const tensor2 = tidy(() => { - if (!(model8 == null ? void 0 : model8.inputs[0].shape)) + const tensor3 = tidy(() => { + if (!(model9 == null ? void 0 : model9.inputs[0].shape)) return null; - const resize = image.resizeBilinear(image7, [model8.inputs[0].shape[2], model8.inputs[0].shape[1]], false); + const resize = image.resizeBilinear(image9, [model9.inputs[0].shape[2], model9.inputs[0].shape[1]], false); const enhance2 = mul(resize, 2); - const norm2 = enhance2.sub(1); - return norm2; + const norm3 = enhance2.sub(1); + return norm3; }); let resT; if (config3.body.enabled) - resT = await (model8 == null ? void 0 : model8.predict(tensor2)); - dispose(tensor2); + resT = await (model9 == null ? void 0 : model9.predict(tensor3)); + dispose(tensor3); if (resT) { keypoints.length = 0; - const squeeze2 = resT.squeeze(); + const squeeze3 = resT.squeeze(); dispose(resT); - const stack2 = squeeze2.unstack(2); - dispose(squeeze2); - for (let id = 0; id < stack2.length; id++) { - const [x2, y2, partScore] = max2d(stack2[id], config3.body.minConfidence); + const stack3 = squeeze3.unstack(2); + dispose(squeeze3); + for (let id = 0; id < stack3.length; id++) { + const [x2, y2, partScore] = max2d(stack3[id], config3.body.minConfidence); if (score > (((_a2 = config3.body) == null ? void 0 : _a2.minConfidence) || 0)) { keypoints.push({ score: Math.round(100 * partScore) / 100, - part: bodyParts[id], + part: kpt2[id], positionRaw: [ - x2 / model8.inputs[0].shape[2], - y2 / model8.inputs[0].shape[1] + x2 / model9.inputs[0].shape[2], + y2 / model9.inputs[0].shape[1] ], position: [ - Math.round(image7.shape[2] * x2 / model8.inputs[0].shape[2]), - Math.round(image7.shape[1] * y2 / model8.inputs[0].shape[1]) + Math.round(image9.shape[2] * x2 / model9.inputs[0].shape[2]), + Math.round(image9.shape[1] * y2 / model9.inputs[0].shape[1]) ] }); } } - stack2.forEach((s) => dispose(s)); + stack3.forEach((s) => dispose(s)); } score = keypoints.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); const x = keypoints.map((a) => a.position[0]); @@ -69782,33 +122523,72 @@ async function predict8(image7, config3) { Math.max(...xRaw) - Math.min(...xRaw), Math.max(...yRaw) - Math.min(...yRaw) ]; - resolve([{ id: 0, score, box: box3, boxRaw, keypoints }]); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected2)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints.find((kpt4) => kpt4.part === indexes[i]); + const pt1 = keypoints.find((kpt4) => kpt4.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + resolve([{ id: 0, score, box: box3, boxRaw, keypoints, annotations: annotations2 }]); }); } +// src/body/movenetcoords.ts +var kpt3 = [ + "nose", + "leftEye", + "rightEye", + "leftEar", + "rightEar", + "leftShoulder", + "rightShoulder", + "leftElbow", + "rightElbow", + "leftWrist", + "rightWrist", + "leftHip", + "rightHip", + "leftKnee", + "rightKnee", + "leftAnkle", + "rightAnkle" +]; +var connected3 = { + leftLeg: ["leftHip", "leftKnee", "leftAnkle"], + rightLeg: ["rightHip", "rightKnee", "rightAnkle"], + torso: ["leftShoulder", "rightShoulder", "rightHip", "leftHip", "leftShoulder"], + leftArm: ["leftShoulder", "leftElbow", "leftWrist"], + rightArm: ["rightShoulder", "rightElbow", "rightWrist"], + head: [] +}; + // src/body/movenet.ts -var model9; +var model10; var inputSize6 = 0; var cachedBoxes = []; -var skipped6 = Number.MAX_SAFE_INTEGER; +var skipped7 = Number.MAX_SAFE_INTEGER; var keypoints2 = []; -var bodyParts2 = ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"]; async function load9(config3) { if (env2.initial) - model9 = null; - if (!model9) { + model10 = null; + if (!model10) { fakeOps(["size"], config3); - model9 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); - if (!model9 || !model9["modelUrl"]) + model10 = await loadGraphModel(join(config3.modelBasePath, config3.body.modelPath || "")); + if (!model10 || !model10["modelUrl"]) log("load model failed:", config3.body.modelPath); else if (config3.debug) - log("load model:", model9["modelUrl"]); + log("load model:", model10["modelUrl"]); } else if (config3.debug) - log("cached model:", model9["modelUrl"]); - inputSize6 = model9.inputs[0].shape ? model9.inputs[0].shape[2] : 0; + log("cached model:", model10["modelUrl"]); + inputSize6 = model10.inputs[0].shape ? model10.inputs[0].shape[2] : 0; if (inputSize6 === -1) inputSize6 = 256; - return model9; + return model10; } function createBox2(points) { const x = points.map((a) => a.position[0]); @@ -69829,24 +122609,24 @@ function createBox2(points) { ]; return [box4, boxRaw2]; } -async function parseSinglePose(res, config3, image7, inputBox) { - const kpt = res[0][0]; +async function parseSinglePose(res, config3, image9, inputBox) { + const kpt4 = res[0][0]; keypoints2.length = 0; let score2 = 0; - for (let id = 0; id < kpt.length; id++) { - score2 = kpt[id][2]; + for (let id = 0; id < kpt4.length; id++) { + score2 = kpt4[id][2]; if (score2 > config3.body.minConfidence) { const positionRaw = [ - (inputBox[3] - inputBox[1]) * kpt[id][1] + inputBox[1], - (inputBox[2] - inputBox[0]) * kpt[id][0] + inputBox[0] + (inputBox[3] - inputBox[1]) * kpt4[id][1] + inputBox[1], + (inputBox[2] - inputBox[0]) * kpt4[id][0] + inputBox[0] ]; keypoints2.push({ score: Math.round(100 * score2) / 100, - part: bodyParts2[id], + part: kpt3[id], positionRaw, position: [ - Math.round((image7.shape[2] || 0) * positionRaw[0]), - Math.round((image7.shape[1] || 0) * positionRaw[1]) + Math.round((image9.shape[2] || 0) * positionRaw[0]), + Math.round((image9.shape[1] || 0) * positionRaw[1]) ] }); } @@ -69854,37 +122634,58 @@ async function parseSinglePose(res, config3, image7, inputBox) { score2 = keypoints2.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); const bodies = []; const [box4, boxRaw2] = createBox2(keypoints2); - bodies.push({ id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints2 }); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected3)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints2.find((kp) => kp.part === indexes[i]); + const pt1 = keypoints2.find((kp) => kp.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + bodies.push({ id: 0, score: score2, box: box4, boxRaw: boxRaw2, keypoints: keypoints2, annotations: annotations2 }); return bodies; } -async function parseMultiPose(res, config3, image7, inputBox) { +async function parseMultiPose(res, config3, image9, inputBox) { const bodies = []; for (let id = 0; id < res[0].length; id++) { - const kpt = res[0][id]; - const totalScore = Math.round(100 * kpt[51 + 4]) / 100; + const kpt4 = res[0][id]; + const totalScore = Math.round(100 * kpt4[51 + 4]) / 100; if (totalScore > config3.body.minConfidence) { keypoints2.length = 0; for (let i = 0; i < 17; i++) { - const score2 = kpt[3 * i + 2]; + const score2 = kpt4[3 * i + 2]; if (score2 > config3.body.minConfidence) { const positionRaw = [ - (inputBox[3] - inputBox[1]) * kpt[3 * i + 1] + inputBox[1], - (inputBox[2] - inputBox[0]) * kpt[3 * i + 0] + inputBox[0] + (inputBox[3] - inputBox[1]) * kpt4[3 * i + 1] + inputBox[1], + (inputBox[2] - inputBox[0]) * kpt4[3 * i + 0] + inputBox[0] ]; keypoints2.push({ - part: bodyParts2[i], + part: kpt3[i], score: Math.round(100 * score2) / 100, positionRaw, position: [ - Math.round((image7.shape[2] || 0) * positionRaw[0]), - Math.round((image7.shape[1] || 0) * positionRaw[1]) + Math.round((image9.shape[2] || 0) * positionRaw[0]), + Math.round((image9.shape[1] || 0) * positionRaw[1]) ] }); } } - const boxRaw2 = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]]; - const box4 = [Math.trunc(boxRaw2[0] * (image7.shape[2] || 0)), Math.trunc(boxRaw2[1] * (image7.shape[1] || 0)), Math.trunc(boxRaw2[2] * (image7.shape[2] || 0)), Math.trunc(boxRaw2[3] * (image7.shape[1] || 0))]; - bodies.push({ id, score: totalScore, boxRaw: boxRaw2, box: box4, keypoints: [...keypoints2] }); + const [box4, boxRaw2] = createBox2(keypoints2); + const annotations2 = {}; + for (const [name, indexes] of Object.entries(connected3)) { + const pt = []; + for (let i = 0; i < indexes.length - 1; i++) { + const pt0 = keypoints2.find((kp) => kp.part === indexes[i]); + const pt1 = keypoints2.find((kp) => kp.part === indexes[i + 1]); + if (pt0 && pt1 && pt0.score > (config3.body.minConfidence || 0) && pt1.score > (config3.body.minConfidence || 0)) + pt.push([pt0.position, pt1.position]); + } + annotations2[name] = pt; + } + bodies.push({ id, score: totalScore, boxRaw: boxRaw2, box: box4, keypoints: [...keypoints2], annotations: annotations2 }); } } bodies.sort((a, b) => b.score - a.score); @@ -69892,40 +122693,40 @@ async function parseMultiPose(res, config3, image7, inputBox) { bodies.length = config3.body.maxDetected; return bodies; } -async function predict9(input2, config3) { - if (!model9 || !(model9 == null ? void 0 : model9.inputs[0].shape)) +async function predict9(input3, config3) { + if (!model10 || !(model10 == null ? void 0 : model10.inputs[0].shape)) return []; return new Promise(async (resolve) => { const t = {}; let bodies = []; if (!config3.skipFrame) cachedBoxes.length = 0; - skipped6++; + skipped7++; for (let i = 0; i < cachedBoxes.length; i++) { - t.crop = image.cropAndResize(input2, [cachedBoxes[i]], [0], [inputSize6, inputSize6], "bilinear"); + t.crop = image.cropAndResize(input3, [cachedBoxes[i]], [0], [inputSize6, inputSize6], "bilinear"); t.cast = cast(t.crop, "int32"); - t.res = await (model9 == null ? void 0 : model9.predict(t.cast)); + t.res = await (model10 == null ? void 0 : model10.predict(t.cast)); const res = await t.res.array(); - const newBodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input2, cachedBoxes[i]) : await parseMultiPose(res, config3, input2, cachedBoxes[i]); + const newBodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input3, cachedBoxes[i]) : await parseMultiPose(res, config3, input3, cachedBoxes[i]); bodies = bodies.concat(newBodies); - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); } - if (bodies.length !== config3.body.maxDetected && skipped6 > (config3.body.skipFrames || 0)) { - t.resized = image.resizeBilinear(input2, [inputSize6, inputSize6], false); + if (bodies.length !== config3.body.maxDetected && skipped7 > (config3.body.skipFrames || 0)) { + t.resized = image.resizeBilinear(input3, [inputSize6, inputSize6], false); t.cast = cast(t.resized, "int32"); - t.res = await (model9 == null ? void 0 : model9.predict(t.cast)); + t.res = await (model10 == null ? void 0 : model10.predict(t.cast)); const res = await t.res.array(); - bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input2, [0, 0, 1, 1]) : await parseMultiPose(res, config3, input2, [0, 0, 1, 1]); - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + bodies = t.res.shape[2] === 17 ? await parseSinglePose(res, config3, input3, [0, 0, 1, 1]) : await parseMultiPose(res, config3, input3, [0, 0, 1, 1]); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); cachedBoxes.length = 0; - skipped6 = 0; + skipped7 = 0; } if (config3.skipFrame) { cachedBoxes.length = 0; for (let i = 0; i < bodies.length; i++) { if (bodies[i].keypoints.length > 10) { - const kpts = bodies[i].keypoints.map((kpt) => kpt.position); - const newBox = scale2(kpts, 1.5, [input2.shape[2], input2.shape[1]]); + const kpts = bodies[i].keypoints.map((kpt4) => kpt4.position); + const newBox = scale2(kpts, 1.5, [input3.shape[2], input3.shape[1]]); cachedBoxes.push([...newBox.yxBox]); } } @@ -70019,24 +122820,24 @@ var labels = [ ]; // src/object/nanodet.ts -var model10; +var model11; var last3 = []; -var skipped7 = Number.MAX_SAFE_INTEGER; +var skipped8 = Number.MAX_SAFE_INTEGER; var scaleBox = 2.5; async function load10(config3) { - if (!model10 || env2.initial) { - model10 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || "")); - const inputs = Object.values(model10.modelSignature["inputs"]); - model10.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null; - if (!model10.inputSize) + if (!model11 || env2.initial) { + model11 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || "")); + const inputs = Object.values(model11.modelSignature["inputs"]); + model11.inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : null; + if (!model11.inputSize) throw new Error(`cannot determine model inputSize: ${config3.object.modelPath}`); - if (!model10 || !model10.modelUrl) + if (!model11 || !model11.modelUrl) log("load model failed:", config3.object.modelPath); else if (config3.debug) - log("load model:", model10.modelUrl); + log("load model:", model11.modelUrl); } else if (config3.debug) - log("cached model:", model10.modelUrl); - return model10; + log("cached model:", model11.modelUrl); + return model11; } async function process3(res, inputSize8, outputShape, config3) { let id = 0; @@ -70099,51 +122900,51 @@ async function process3(res, inputSize8, outputShape, config3) { results = results.filter((_val, idx) => nmsIdx.includes(idx)).sort((a, b) => b.score - a.score); return results; } -async function predict10(image7, config3) { - if (skipped7 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) { - skipped7++; +async function predict10(image9, config3) { + if (skipped8 < (config3.object.skipFrames || 0) && config3.skipFrame && last3.length > 0) { + skipped8++; return last3; } - skipped7 = 0; + skipped8 = 0; if (!env2.kernels.includes("mod") || !env2.kernels.includes("sparsetodense")) return last3; return new Promise(async (resolve) => { - const outputSize3 = [image7.shape[2], image7.shape[1]]; - const resize = image.resizeBilinear(image7, [model10.inputSize, model10.inputSize], false); - const norm2 = div(resize, 255); - const transpose5 = norm2.transpose([0, 3, 1, 2]); - dispose(norm2); + const outputSize2 = [image9.shape[2], image9.shape[1]]; + const resize = image.resizeBilinear(image9, [model11.inputSize, model11.inputSize], false); + const norm3 = div(resize, 255); + const transpose8 = norm3.transpose([0, 3, 1, 2]); + dispose(norm3); dispose(resize); let objectT; if (config3.object.enabled) - objectT = await model10.predict(transpose5); - dispose(transpose5); - const obj = await process3(objectT, model10.inputSize, outputSize3, config3); + objectT = await model11.predict(transpose8); + dispose(transpose8); + const obj = await process3(objectT, model11.inputSize, outputSize2, config3); last3 = obj; resolve(obj); }); } // src/object/centernet.ts -var model11; +var model12; var inputSize7 = 0; var last4 = []; -var skipped8 = Number.MAX_SAFE_INTEGER; +var skipped9 = Number.MAX_SAFE_INTEGER; async function load11(config3) { if (env2.initial) - model11 = null; - if (!model11) { + model12 = null; + if (!model12) { fakeOps(["floormod"], config3); - model11 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || "")); - const inputs = Object.values(model11.modelSignature["inputs"]); + model12 = await loadGraphModel(join(config3.modelBasePath, config3.object.modelPath || "")); + const inputs = Object.values(model12.modelSignature["inputs"]); inputSize7 = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; - if (!model11 || !model11["modelUrl"]) + if (!model12 || !model12["modelUrl"]) log("load model failed:", config3.object.modelPath); else if (config3.debug) - log("load model:", model11["modelUrl"]); + log("load model:", model12["modelUrl"]); } else if (config3.debug) - log("cached model:", model11["modelUrl"]); - return model11; + log("cached model:", model12["modelUrl"]); + return model12; } async function process4(res, outputShape, config3) { if (!res) @@ -70191,56 +122992,56 @@ async function process4(res, outputShape, config3) { } return results; } -async function predict11(input2, config3) { - if (skipped8 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) { - skipped8++; +async function predict11(input3, config3) { + if (skipped9 < (config3.object.skipFrames || 0) && config3.skipFrame && last4.length > 0) { + skipped9++; return last4; } - skipped8 = 0; + skipped9 = 0; if (!env2.kernels.includes("mod") || !env2.kernels.includes("sparsetodense")) return last4; return new Promise(async (resolve) => { - const outputSize3 = [input2.shape[2], input2.shape[1]]; - const resize = image.resizeBilinear(input2, [inputSize7, inputSize7]); - const objectT = config3.object.enabled ? model11 == null ? void 0 : model11.execute(resize, ["tower_0/detections"]) : null; + const outputSize2 = [input3.shape[2], input3.shape[1]]; + const resize = image.resizeBilinear(input3, [inputSize7, inputSize7]); + const objectT = config3.object.enabled ? model12 == null ? void 0 : model12.execute(resize, ["tower_0/detections"]) : null; dispose(resize); - const obj = await process4(objectT, outputSize3, config3); + const obj = await process4(objectT, outputSize2, config3); last4 = obj; resolve(obj); }); } // src/segmentation/segmentation.ts -var model12; +var model13; var busy = false; async function load12(config3) { - if (!model12 || env2.initial) { - model12 = await loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || "")); - if (!model12 || !model12["modelUrl"]) + if (!model13 || env2.initial) { + model13 = await loadGraphModel(join(config3.modelBasePath, config3.segmentation.modelPath || "")); + if (!model13 || !model13["modelUrl"]) log("load model failed:", config3.segmentation.modelPath); else if (config3.debug) - log("load model:", model12["modelUrl"]); + log("load model:", model13["modelUrl"]); } else if (config3.debug) - log("cached model:", model12["modelUrl"]); - return model12; + log("cached model:", model13["modelUrl"]); + return model13; } -async function process5(input2, background, config3) { +async function process5(input3, background, config3) { var _a, _b; if (busy) return { data: [], canvas: null, alpha: null }; busy = true; - if (!model12) + if (!model13) await load12(config3); - const inputImage = process2(input2, config3); + const inputImage = process2(input3, config3); const width = ((_a = inputImage.canvas) == null ? void 0 : _a.width) || 0; const height = ((_b = inputImage.canvas) == null ? void 0 : _b.height) || 0; if (!inputImage.tensor) return { data: [], canvas: null, alpha: null }; const t = {}; - t.resize = image.resizeBilinear(inputImage.tensor, [model12.inputs[0].shape ? model12.inputs[0].shape[1] : 0, model12.inputs[0].shape ? model12.inputs[0].shape[2] : 0], false); + t.resize = image.resizeBilinear(inputImage.tensor, [model13.inputs[0].shape ? model13.inputs[0].shape[1] : 0, model13.inputs[0].shape ? model13.inputs[0].shape[2] : 0], false); dispose(inputImage.tensor); t.norm = div(t.resize, 255); - t.res = model12.predict(t.norm); + t.res = model13.predict(t.norm); t.squeeze = squeeze(t.res, 0); if (t.squeeze.shape[2] === 2) { t.softmax = softmax(t.squeeze); @@ -70256,7 +123057,7 @@ async function process5(input2, background, config3) { if (env2.node && !env2.Canvas && typeof ImageData === "undefined") { if (config3.debug) log("canvas support missing"); - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); return { data, canvas: null, alpha: null }; } const alphaCanvas = canvas(width, height); @@ -70288,26 +123089,26 @@ async function process5(input2, background, config3) { ctxMerge.drawImage(bgImage.canvas, 0, 0, mergedCanvas.width, mergedCanvas.height); ctxMerge.drawImage(compositeCanvas, 0, 0); } - Object.keys(t).forEach((tensor2) => dispose(t[tensor2])); + Object.keys(t).forEach((tensor3) => dispose(t[tensor3])); busy = false; return { data, canvas: mergedCanvas || compositeCanvas, alpha: alphaCanvas }; } // src/gear/gear-agegenderrace.ts -var model13; -var skipped9 = Number.MAX_SAFE_INTEGER; +var model14; +var skipped10 = Number.MAX_SAFE_INTEGER; async function load13(config3) { if (env2.initial) - model13 = null; - if (!model13) { - model13 = await loadGraphModel(join(config3.modelBasePath, config3.face.agegenderrace.modelPath)); - if (!model13 || !model13["modelUrl"]) + model14 = null; + if (!model14) { + model14 = await loadGraphModel(join(config3.modelBasePath, config3.face.agegenderrace.modelPath)); + if (!model14 || !model14["modelUrl"]) log("load model failed:", config3.face.agegenderrace.modelPath); else if (config3.debug) - log("load model:", model13["modelUrl"]); + log("load model:", model14["modelUrl"]); } else if (config3.debug) - log("cached model:", model13["modelUrl"]); - return model13; + log("cached model:", model14["modelUrl"]); + return model14; } // src/models.ts @@ -70336,8 +123137,8 @@ var Models = class { } }; function reset(instance) { - for (const model14 of Object.keys(instance.models)) - instance.models[model14] = null; + for (const model15 of Object.keys(instance.models)) + instance.models[model15] = null; } async function load14(instance) { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D; @@ -70383,9 +123184,9 @@ async function load14(instance) { instance.models.segmentation = load12(instance.config); if (instance.config.face.enabled && ((_D = instance.config.face["agegenderrace"]) == null ? void 0 : _D.enabled) && !instance.models.agegenderrace) instance.models.agegenderrace = load13(instance.config); - for await (const model14 of Object.keys(instance.models)) { - if (instance.models[model14] && typeof instance.models[model14] !== "undefined") - instance.models[model14] = await instance.models[model14]; + for await (const model15 of Object.keys(instance.models)) { + if (instance.models[model15] && typeof instance.models[model15] !== "undefined") + instance.models[model15] = await instance.models[model15]; } } async function validate2(instance) { @@ -70394,32 +123195,32 @@ async function validate2(instance) { if (instance.models[defined]) { let models5 = []; if (Array.isArray(instance.models[defined])) { - models5 = instance.models[defined].filter((model14) => model14 !== null).map((model14) => model14 && model14.executor ? model14 : model14.model); + models5 = instance.models[defined].filter((model15) => model15 !== null).map((model15) => model15 && model15.executor ? model15 : model15.model); } else { models5 = [instance.models[defined]]; } - for (const model14 of models5) { - if (!model14) { + for (const model15 of models5) { + if (!model15) { if (instance.config.debug) log("model marked as loaded but not defined:", defined); continue; } const ops = []; - const executor = model14 == null ? void 0 : model14.executor; + const executor = model15 == null ? void 0 : model15.executor; if (executor && executor.graph.nodes) { for (const kernel of Object.values(executor.graph.nodes)) { - const op2 = kernel.op.toLowerCase(); - if (!ops.includes(op2)) - ops.push(op2); + const op3 = kernel.op.toLowerCase(); + if (!ops.includes(op3)) + ops.push(op3); } } else { if (!executor && instance.config.debug) log("model signature not determined:", defined); } const missing = []; - for (const op2 of ops) { - if (!simpleOps.includes(op2) && !instance.env.kernels.includes(op2) && !instance.env.kernels.includes(op2.replace("_", "")) && !instance.env.kernels.includes(op2.replace("native", "")) && !instance.env.kernels.includes(op2.replace("v2", ""))) { - missing.push(op2); + for (const op3 of ops) { + if (!simpleOps.includes(op3) && !instance.env.kernels.includes(op3) && !instance.env.kernels.includes(op3.replace("_", "")) && !instance.env.kernels.includes(op3.replace("native", "")) && !instance.env.kernels.includes(op3.replace("v2", ""))) { + missing.push(op3); } } if (missing.length > 0 && instance.config.debug) @@ -70475,7 +123276,6 @@ async function register(instance) { log("error: humangl:", e.type); log("possible browser memory leak using webgl"); instance.emit("error"); - throw new Error("browser webgl error"); }); config2.canvas.addEventListener("webglcontextrestored", (e) => { log("error: humangl context restored:", e); @@ -70610,10 +123410,8 @@ async function check(instance, force = false) { log(`gl version:${gl.getParameter(gl.VERSION)} renderer:${gl.getParameter(gl.RENDERER)}`); } } - if (getBackend() === "humangl") { + if (getBackend() === "webgpu") { ENV.set("WEBGPU_USE_GLSL", true); - ENV.set("WEBGL_PACK_DEPTHWISECONV", false); - ENV.set("WEBGL_USE_SHAPES_UNIFORMS", true); } enableProdMode(); await ready(); @@ -70659,9 +123457,9 @@ var options2 = { useCurves: false, bufferedOutput: true }; -var getCanvasContext = (input2) => { - if (input2 && input2.getContext) - return input2.getContext("2d"); +var getCanvasContext = (input3) => { + if (input3 && input3.getContext) + return input3.getContext("2d"); throw new Error("invalid canvas"); }; var rad2deg = (theta) => Math.round(theta * 180 / Math.PI); @@ -70738,12 +123536,12 @@ async function gesture(inCanvas2, result, drawOptions) { ctx.fillStyle = localOptions.color; let i = 1; for (let j = 0; j < result.length; j++) { - let where2 = []; + let where3 = []; let what = []; - [where2, what] = Object.entries(result[j]); + [where3, what] = Object.entries(result[j]); if (what.length > 1 && what[1].length > 0) { - const who = where2[1] > 0 ? `#${where2[1]}` : ""; - const label = `${where2[0]} ${who}: ${what[1]}`; + const who = where3[1] > 0 ? `#${where3[1]}` : ""; + const label = `${where3[0]} ${who}: ${what[1]}`; if (localOptions.shadowColor && localOptions.shadowColor !== "") { ctx.fillStyle = localOptions.shadowColor; ctx.fillText(label, 8, 2 + i * localOptions.lineHeight); @@ -70885,109 +123683,24 @@ async function body(inCanvas2, result, drawOptions) { ctx.fillText(`body ${100 * result[i].score}%`, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]); } } - if (localOptions.drawPoints) { + if (localOptions.drawPoints && result[i].keypoints) { for (let pt = 0; pt < result[i].keypoints.length; pt++) { ctx.fillStyle = localOptions.useDepth && result[i].keypoints[pt].position[2] ? `rgba(${127.5 + 2 * (result[i].keypoints[pt].position[2] || 0)}, ${127.5 - 2 * (result[i].keypoints[pt].position[2] || 0)}, 255, 0.5)` : localOptions.color; point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions); } } - if (localOptions.drawLabels) { + if (localOptions.drawLabels && result[i].keypoints) { ctx.font = localOptions.font; - if (result[i].keypoints) { - for (const pt of result[i].keypoints) { - ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + 2 * pt.position[2]}, ${127.5 - 2 * pt.position[2]}, 255, 0.5)` : localOptions.color; - ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4); - } + for (const pt of result[i].keypoints) { + ctx.fillStyle = localOptions.useDepth && pt.position[2] ? `rgba(${127.5 + 2 * pt.position[2]}, ${127.5 - 2 * pt.position[2]}, 255, 0.5)` : localOptions.color; + ctx.fillText(`${pt.part} ${Math.trunc(100 * pt.score)}%`, pt.position[0] + 4, pt.position[1] + 4); } } - if (localOptions.drawPolygons && result[i].keypoints) { - let part; - const points = []; - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - if (points.length === 4) - lines(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftKnee"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftAnkle"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftHeel"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftFoot"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightHip"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightKnee"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightAnkle"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightHeel"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightFoot"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "leftShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftElbow"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftWrist"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "leftPalm"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); - points.length = 0; - part = result[i].keypoints.find((a) => a.part === "rightShoulder"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightElbow"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightWrist"); - if (part) - points.push([part.position[0], part.position[1]]); - part = result[i].keypoints.find((a) => a.part === "rightPalm"); - if (part) - points.push([part.position[0], part.position[1]]); - curves(ctx, points, localOptions); + if (localOptions.drawPolygons && result[i].keypoints && result[i].annotations) { + for (const part of Object.values(result[i].annotations)) { + for (const connected4 of part) + curves(ctx, connected4, localOptions); + } } } } @@ -71107,13 +123820,13 @@ async function person(inCanvas2, result, drawOptions) { } } } -async function canvas2(input2, output) { - if (!input2 || !output) +async function canvas2(input3, output) { + if (!input3 || !output) return; const ctx = getCanvasContext(output); - ctx.drawImage(input2, 0, 0); + ctx.drawImage(input3, 0, 0); } -async function all5(inCanvas2, result, drawOptions) { +async function all8(inCanvas2, result, drawOptions) { if (!result || !result.performance || !result || !inCanvas2) return null; const timestamp = now(); @@ -71198,7 +123911,7 @@ var calculateFaceAngle = (face5, imageSize) => { return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ }; }; const meshToEulerAngle = (mesh2) => { - const radians = (a12, a22, b1, b2) => Math.atan2(b2 - a22, b1 - a12); + const radians = (a13, a23, b1, b2) => Math.atan2(b2 - a23, b1 - a13); const angle2 = { pitch: radians(mesh2[10][1], mesh2[10][2], mesh2[152][1], mesh2[152][2]), yaw: radians(mesh2[33][0], mesh2[33][2], mesh2[263][0], mesh2[263][2]), @@ -71236,7 +123949,7 @@ var calculateFaceAngle = (face5, imageSize) => { }; // src/face/face.ts -var detectFace = async (parent, input2) => { +var detectFace = async (parent, input3) => { var _a, _b, _c, _d; let timeStamp; let ageRes; @@ -71248,9 +123961,9 @@ var detectFace = async (parent, input2) => { const faceRes = []; parent.state = "run:face"; timeStamp = now(); - const faces = await predict(input2, parent.config); + const faces = await predict(input3, parent.config); parent.performance.face = Math.trunc(now() - timeStamp); - if (!input2.shape || input2.shape.length !== 4) + if (!input3.shape || input3.shape.length !== 4) return []; if (!faces) return []; @@ -71260,7 +123973,7 @@ var detectFace = async (parent, input2) => { log("Face object is disposed:", faces[i].tensor); continue; } - const rotation = calculateFaceAngle(faces[i], [input2.shape[2], input2.shape[1]]); + const rotation = calculateFaceAngle(faces[i], [input3.shape[2], input3.shape[1]]); parent.analyze("Start Emotion:"); if (parent.config.async) { emotionRes = parent.config.face.emotion.enabled ? predict3(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {}; @@ -71289,8 +124002,8 @@ var detectFace = async (parent, input2) => { delete faces[i].annotations.leftEyeIris; delete faces[i].annotations.rightEyeIris; } - const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input2.shape[2] : 0; - const tensor2 = parent.config.face.detector.return ? squeeze(faces[i].tensor) : null; + const irisSize = faces[i].annotations && faces[i].annotations.leftEyeIris && faces[i].annotations.leftEyeIris[0] && faces[i].annotations.rightEyeIris && faces[i].annotations.rightEyeIris[0] && faces[i].annotations.leftEyeIris.length > 0 && faces[i].annotations.rightEyeIris.length > 0 && faces[i].annotations.leftEyeIris[0] !== null && faces[i].annotations.rightEyeIris[0] !== null ? Math.max(Math.abs(faces[i].annotations.leftEyeIris[3][0] - faces[i].annotations.leftEyeIris[1][0]), Math.abs(faces[i].annotations.rightEyeIris[4][1] - faces[i].annotations.rightEyeIris[2][1])) / input3.shape[2] : 0; + const tensor3 = parent.config.face.detector.return ? squeeze(faces[i].tensor) : null; dispose(faces[i].tensor); if (faces[i].tensor) delete faces[i].tensor; @@ -71304,7 +124017,7 @@ var detectFace = async (parent, input2) => { emotion: emotionRes, iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0, rotation, - tensor: tensor2 + tensor: tensor3 }); parent.analyze("End Face"); } @@ -71477,15 +124190,15 @@ function calc(newResult) { if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; const keypoints3 = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints.map((landmark, j) => landmark.map((coord, k) => ((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) : []; - const annotations3 = {}; + const annotations2 = {}; if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) bufferedResult.hand[i].annotations = newResult.hand[i].annotations; if (newResult.hand[i].annotations) { for (const key of Object.keys(newResult.hand[i].annotations)) { - annotations3[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0] ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor)) : null; + annotations2[key] = newResult.hand[i].annotations[key] && newResult.hand[i].annotations[key][0] ? newResult.hand[i].annotations[key].map((val, j) => val.map((coord, k) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor)) : null; } } - bufferedResult.hand[i] = { ...newResult.hand[i], box: box4, boxRaw: boxRaw2, keypoints: keypoints3, annotations: annotations3 }; + bufferedResult.hand[i] = { ...newResult.hand[i], box: box4, boxRaw: boxRaw2, keypoints: keypoints3, annotations: annotations2 }; } } if (!bufferedResult.face || newResult.face.length !== bufferedResult.face.length) { @@ -71536,12 +124249,12 @@ function calc(newResult) { // src/face/match.ts function distance(descriptor1, descriptor2, options3 = { order: 2 }) { - let sum6 = 0; + let sum10 = 0; for (let i = 0; i < descriptor1.length; i++) { const diff = options3.order === 2 ? descriptor1[i] - descriptor2[i] : Math.abs(descriptor1[i] - descriptor2[i]); - sum6 += options3.order === 2 ? diff * diff : diff ** options3.order; + sum10 += options3.order === 2 ? diff * diff : diff ** options3.order; } - return sum6; + return sum10; } function similarity(descriptor1, descriptor2, options3 = { order: 2 }) { const dist = distance(descriptor1, descriptor2, options3); @@ -72399,8 +125112,8 @@ async function warmupCanvas(instance) { const ctx = canvas3.getContext("2d"); if (ctx) ctx.drawImage(img, 0, 0); - const tensor2 = await instance.image(canvas3); - const res = await instance.detect(tensor2.tensor, instance.config); + const tensor3 = await instance.image(canvas3); + const res = await instance.detect(tensor3.tensor, instance.config); resolve(res); } }; @@ -72486,12 +125199,12 @@ var Human = class { if (leaked !== 0) log(...msg, leaked); }); - __privateAdd(this, _sanity, (input2) => { + __privateAdd(this, _sanity, (input3) => { if (!__privateGet(this, _checkSanity)) return null; - if (!input2) + if (!input3) return "input is not defined"; - if (this.env.node && !(input2 instanceof Tensor)) + if (this.env.node && !(input3 instanceof Tensor)) return "input must be a tensor"; try { this.tf.getBackend(); @@ -72529,14 +125242,14 @@ var Human = class { this.models = new Models(); this.draw = { options: options2, - canvas: (input2, output) => canvas2(input2, output), + canvas: (input3, output) => canvas2(input3, output), face: (output, result, options3) => face(output, result, options3), body: (output, result, options3) => body(output, result, options3), hand: (output, result, options3) => hand(output, result, options3), gesture: (output, result, options3) => gesture(output, result, options3), object: (output, result, options3) => object(output, result, options3), person: (output, result, options3) => person(output, result, options3), - all: (output, result, options3) => all5(output, result, options3) + all: (output, result, options3) => all8(output, result, options3) }; this.result = { face: [], body: [], hand: [], gesture: [], object: [], performance: {}, timestamp: 0, persons: [] }; this.process = { tensor: null, canvas: null }; @@ -72553,14 +125266,14 @@ var Human = class { validate(userConfig) { return validate(config, userConfig || this.config); } - image(input2) { - return process2(input2, this.config); + image(input3) { + return process2(input3, this.config); } - async segmentation(input2, background) { - return process5(input2, background, this.config); + async segmentation(input3, background) { + return process5(input3, background, this.config); } - enhance(input2) { - return enhance(input2); + enhance(input3) { + return enhance(input3); } async init() { await check(this, true); @@ -72570,7 +125283,7 @@ var Human = class { async load(userConfig) { this.state = "load"; const timeStamp = now(); - const count3 = Object.values(this.models).filter((model14) => model14).length; + const count4 = Object.values(this.models).filter((model15) => model15).length; if (userConfig) this.config = mergeDeep(this.config, userConfig); if (env2.initial) { @@ -72592,8 +125305,8 @@ var Human = class { if (env2.initial && this.config.debug) log("tf engine state:", this.tf.engine().state.numBytes, "bytes", this.tf.engine().state.numTensors, "tensors"); env2.initial = false; - const loaded = Object.values(this.models).filter((model14) => model14).length; - if (loaded !== count3) { + const loaded = Object.values(this.models).filter((model15) => model15).length; + if (loaded !== count4) { await validate2(this); this.emit("load"); } @@ -72607,7 +125320,7 @@ var Human = class { async warmup(userConfig) { return warmup(this, userConfig); } - async detect(input2, userConfig) { + async detect(input3, userConfig) { this.state = "detect"; return new Promise(async (resolve) => { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v; @@ -72616,9 +125329,9 @@ var Human = class { let elapsedTime; this.config = mergeDeep(this.config, userConfig); this.state = "check"; - const error = __privateGet(this, _sanity).call(this, input2); + const error = __privateGet(this, _sanity).call(this, input3); if (error) { - log(error, input2); + log(error, input3); resolve({ error }); } const timeStart = now(); @@ -72626,7 +125339,7 @@ var Human = class { await this.load(); timeStamp = now(); this.state = "image"; - const img = process2(input2, this.config); + const img = process2(input3, this.config); this.process = img; this.performance.image = Math.trunc(now() - timeStamp); this.analyze("Get Image:"); diff --git a/dist/human.esm.js.map b/dist/human.esm.js.map index 996fff93..59cf0a13 100644 --- a/dist/human.esm.js.map +++ b/dist/human.esm.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/util/util.ts", "../src/config.ts", "../node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js", "../node_modules/.pnpm/node-fetch@2.6.5/node_modules/node-fetch/browser.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/tychei.js", "(disabled):crypto", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/index.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/alea.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor128.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorwow.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xorshift7.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/xor4096.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/lib/tychei.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/seedrandom.js", "../node_modules/.pnpm/seedrandom@3.0.5/node_modules/seedrandom/index.js", "../node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js", "(disabled):path", "(disabled):worker_threads", "(disabled):perf_hooks", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js", "../node_modules/.pnpm/tfjs-core/src/backends/backend.ts", "../node_modules/.pnpm/tfjs-core/src/util_base.ts", "../node_modules/.pnpm/tfjs-core/src/log.ts", "../node_modules/.pnpm/tfjs-core/src/environment.ts", "../node_modules/.pnpm/tfjs-core/src/global_util.ts", "../node_modules/.pnpm/tfjs-core/src/kernel_names.ts", "../node_modules/.pnpm/tfjs-core/src/kernel_registry.ts", "../node_modules/.pnpm/tfjs-core/src/util.ts", "../node_modules/.pnpm/tfjs-core/src/hash_util.ts", "../node_modules/.pnpm/tfjs-core/src/profiler.ts", "../node_modules/.pnpm/tfjs-core/src/tape.ts", "../node_modules/.pnpm/tfjs-core/src/tensor_format.ts", "../node_modules/.pnpm/tfjs-core/src/tensor.ts", "../node_modules/.pnpm/tfjs-core/src/tensor_util.ts", "../node_modules/.pnpm/tfjs-core/src/types.ts", "../node_modules/.pnpm/tfjs-core/src/engine.ts", "../node_modules/.pnpm/tfjs-core/src/device_util.ts", "../node_modules/.pnpm/tfjs-core/src/flags.ts", "../node_modules/.pnpm/tfjs-core/src/tensor_util_env.ts", "../node_modules/.pnpm/tfjs-core/src/ops/operation.ts", "../node_modules/.pnpm/tfjs-core/src/ops/complex.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor_ops_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor.ts", "../node_modules/.pnpm/tfjs-core/src/io/types.ts", "../node_modules/.pnpm/tfjs-core/src/io/io_utils.ts", "../node_modules/.pnpm/tfjs-core/src/io/router_registry.ts", "../node_modules/.pnpm/tfjs-core/src/io/indexed_db.ts", "../node_modules/.pnpm/tfjs-core/src/io/local_storage.ts", "../node_modules/.pnpm/tfjs-core/src/io/model_management.ts", "../node_modules/.pnpm/tfjs-core/src/platforms/platform_browser.ts", "../node_modules/.pnpm/tfjs-core/src/platforms/platform_node.ts", "../node_modules/.pnpm/tfjs-core/src/ops/buffer.ts", "../node_modules/.pnpm/tfjs-core/src/ops/cast.ts", "../node_modules/.pnpm/tfjs-core/src/ops/clone.ts", "../node_modules/.pnpm/tfjs-core/src/ops/print.ts", "../node_modules/.pnpm/tfjs-core/src/base_side_effects.ts", "../node_modules/.pnpm/tfjs-core/src/io/io.ts", "../node_modules/.pnpm/tfjs-core/src/io/browser_files.ts", "../node_modules/.pnpm/tfjs-core/src/io/progress.ts", "../node_modules/.pnpm/tfjs-core/src/io/weights_loader.ts", "../node_modules/.pnpm/tfjs-core/src/io/http.ts", "../node_modules/.pnpm/tfjs-core/src/io/passthrough.ts", "../node_modules/.pnpm/tfjs-core/src/math.ts", "../node_modules/.pnpm/tfjs-core/src/ops/mat_mul.ts", "../node_modules/.pnpm/tfjs-core/src/ops/one_hot.ts", "../node_modules/.pnpm/tfjs-core/src/ops/transpose.ts", "../node_modules/.pnpm/tfjs-core/src/ops/confusion_matrix.ts", "../node_modules/.pnpm/tfjs-core/src/ops/browser.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/gather_nd_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/scatter_nd_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice_util.ts", "../node_modules/.pnpm/tfjs-core/src/serialization.ts", "../node_modules/.pnpm/tfjs-core/src/test_util.ts", "../node_modules/.pnpm/tfjs-core/src/version.ts", "../node_modules/.pnpm/tfjs-core/src/globals.ts", "../node_modules/.pnpm/tfjs-core/src/ops/add.ts", "../node_modules/.pnpm/tfjs-core/src/ops/floorDiv.ts", "../node_modules/.pnpm/tfjs-core/src/ops/div.ts", "../node_modules/.pnpm/tfjs-core/src/ops/mul.ts", "../node_modules/.pnpm/tfjs-core/src/ops/abs.ts", "../node_modules/.pnpm/tfjs-core/src/ops/acos.ts", "../node_modules/.pnpm/tfjs-core/src/ops/acosh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/add_n.ts", "../node_modules/.pnpm/tfjs-core/src/ops/all.ts", "../node_modules/.pnpm/tfjs-core/src/ops/any.ts", "../node_modules/.pnpm/tfjs-core/src/ops/arg_max.ts", "../node_modules/.pnpm/tfjs-core/src/ops/arg_min.ts", "../node_modules/.pnpm/tfjs-core/src/ops/asin.ts", "../node_modules/.pnpm/tfjs-core/src/ops/asinh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/atan.ts", "../node_modules/.pnpm/tfjs-core/src/ops/atan2.ts", "../node_modules/.pnpm/tfjs-core/src/ops/atanh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reshape.ts", "../node_modules/.pnpm/tfjs-core/src/ops/avg_pool.ts", "../node_modules/.pnpm/tfjs-core/src/ops/avg_pool_3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sigmoid.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tanh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/basic_lstm_cell.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batch_to_space_nd.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batchnorm_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batchnorm.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batchnorm2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batchnorm3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/batchnorm4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/bincount.ts", "../node_modules/.pnpm/tfjs-core/src/ops/broadcast_args.ts", "../node_modules/.pnpm/tfjs-core/src/ops/broadcast_to.ts", "../node_modules/.pnpm/tfjs-core/src/ops/ceil.ts", "../node_modules/.pnpm/tfjs-core/src/ops/clip_by_value.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat_1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat_2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat_3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat_4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv2d_backprop_input.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv2d_transpose.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv3d_backprop_input.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv3d_transpose.ts", "../node_modules/.pnpm/tfjs-core/src/ops/cos.ts", "../node_modules/.pnpm/tfjs-core/src/ops/cosh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/cumsum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/dense_bincount.ts", "../node_modules/.pnpm/tfjs-core/src/ops/depth_to_space.ts", "../node_modules/.pnpm/tfjs-core/src/ops/depthwise_conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/diag.ts", "../node_modules/.pnpm/tfjs-core/src/ops/dilation2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/broadcast_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/equal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/where.ts", "../node_modules/.pnpm/tfjs-core/src/ops/zeros_like.ts", "../node_modules/.pnpm/tfjs-core/src/ops/div_no_nan.ts", "../node_modules/.pnpm/tfjs-core/src/ops/dot.ts", "../node_modules/.pnpm/tfjs-core/src/ops/einsum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/elu.ts", "../node_modules/.pnpm/tfjs-core/src/ops/erf.ts", "../node_modules/.pnpm/tfjs-core/src/ops/exp.ts", "../node_modules/.pnpm/tfjs-core/src/ops/expand_dims.ts", "../node_modules/.pnpm/tfjs-core/src/ops/expm1.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tile.ts", "../node_modules/.pnpm/tfjs-core/src/ops/eye.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fill.ts", "../node_modules/.pnpm/tfjs-core/src/ops/floor.ts", "../node_modules/.pnpm/tfjs-core/src/ops/gather.ts", "../node_modules/.pnpm/tfjs-core/src/ops/greater.ts", "../node_modules/.pnpm/tfjs-core/src/ops/greater_equal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/imag.ts", "../node_modules/.pnpm/tfjs-core/src/ops/is_finite.ts", "../node_modules/.pnpm/tfjs-core/src/ops/is_inf.ts", "../node_modules/.pnpm/tfjs-core/src/ops/is_nan.ts", "../node_modules/.pnpm/tfjs-core/src/ops/leaky_relu.ts", "../node_modules/.pnpm/tfjs-core/src/ops/less.ts", "../node_modules/.pnpm/tfjs-core/src/ops/less_equal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/linspace.ts", "../node_modules/.pnpm/tfjs-core/src/ops/local_response_normalization.ts", "../node_modules/.pnpm/tfjs-core/src/ops/log.ts", "../node_modules/.pnpm/tfjs-core/src/ops/log1p.ts", "../node_modules/.pnpm/tfjs-core/src/gradients.ts", "../node_modules/.pnpm/tfjs-core/src/ops/neg.ts", "../node_modules/.pnpm/tfjs-core/src/ops/softplus.ts", "../node_modules/.pnpm/tfjs-core/src/ops/log_sigmoid.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sub.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/log_softmax.ts", "../node_modules/.pnpm/tfjs-core/src/ops/axis_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/log_sum_exp.ts", "../node_modules/.pnpm/tfjs-core/src/ops/logical_and.ts", "../node_modules/.pnpm/tfjs-core/src/ops/logical_not.ts", "../node_modules/.pnpm/tfjs-core/src/ops/logical_or.ts", "../node_modules/.pnpm/tfjs-core/src/ops/logical_xor.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max_pool.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max_pool_3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max_pool_with_argmax.ts", "../node_modules/.pnpm/tfjs-core/src/ops/maximum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/mean.ts", "../node_modules/.pnpm/tfjs-core/src/ops/zeros.ts", "../node_modules/.pnpm/tfjs-core/src/ops/ones.ts", "../node_modules/.pnpm/tfjs-core/src/ops/meshgrid.ts", "../node_modules/.pnpm/tfjs-core/src/ops/min.ts", "../node_modules/.pnpm/tfjs-core/src/ops/minimum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/mirror_pad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/mod.ts", "../node_modules/.pnpm/tfjs-core/src/ops/square.ts", "../node_modules/.pnpm/tfjs-core/src/ops/moments.ts", "../node_modules/.pnpm/tfjs-core/src/ops/multi_rnn_cell.ts", "../node_modules/.pnpm/tfjs-core/src/ops/multinomial.ts", "../node_modules/.pnpm/tfjs-core/src/ops/not_equal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/ones_like.ts", "../node_modules/.pnpm/tfjs-core/src/ops/outer_product.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pad1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pad2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pad3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pad4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/space_to_batch_nd.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pool.ts", "../node_modules/.pnpm/tfjs-core/src/ops/pow.ts", "../node_modules/.pnpm/tfjs-core/src/ops/prelu.ts", "../node_modules/.pnpm/tfjs-core/src/ops/prod.ts", "../node_modules/.pnpm/tfjs-core/src/ops/rand.ts", "../node_modules/.pnpm/tfjs-core/src/ops/rand_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/random_gamma.ts", "../node_modules/.pnpm/tfjs-core/src/ops/random_normal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/random_uniform.ts", "../node_modules/.pnpm/tfjs-core/src/ops/range.ts", "../node_modules/.pnpm/tfjs-core/src/ops/real.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reciprocal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/relu.ts", "../node_modules/.pnpm/tfjs-core/src/ops/relu6.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reverse.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reverse_1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reverse_2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reverse_3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reverse_4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/round.ts", "../node_modules/.pnpm/tfjs-core/src/ops/rsqrt.ts", "../node_modules/.pnpm/tfjs-core/src/ops/scalar.ts", "../node_modules/.pnpm/tfjs-core/src/ops/selu.ts", "../node_modules/.pnpm/tfjs-core/src/ops/separable_conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/setdiff1d_async.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sign.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sin.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sinh.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice3d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/slice4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/softmax.ts", "../node_modules/.pnpm/tfjs-core/src/ops/spectral/fft.ts", "../node_modules/.pnpm/tfjs-core/src/ops/spectral/ifft.ts", "../node_modules/.pnpm/tfjs-core/src/ops/spectral/irfft.ts", "../node_modules/.pnpm/tfjs-core/src/ops/split.ts", "../node_modules/.pnpm/tfjs-core/src/ops/spectral/rfft.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sqrt.ts", "../node_modules/.pnpm/tfjs-core/src/ops/squared_difference.ts", "../node_modules/.pnpm/tfjs-core/src/ops/squeeze.ts", "../node_modules/.pnpm/tfjs-core/src/ops/stack.ts", "../node_modules/.pnpm/tfjs-core/src/ops/step.ts", "../node_modules/.pnpm/tfjs-core/src/ops/strided_slice.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tan.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor1d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor4d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor5d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/tensor6d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/topk.ts", "../node_modules/.pnpm/tfjs-core/src/ops/truncated_normal.ts", "../node_modules/.pnpm/tfjs-core/src/ops/unique.ts", "../node_modules/.pnpm/tfjs-core/src/ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/unstack.ts", "../node_modules/.pnpm/tfjs-core/src/ops/variable.ts", "../node_modules/.pnpm/tfjs-core/src/backends/where_impl.ts", "../node_modules/.pnpm/tfjs-core/src/ops/where_async.ts", "../node_modules/.pnpm/tfjs-core/src/ops/boolean_mask.ts", "../node_modules/.pnpm/tfjs-core/src/ops/norm.ts", "../node_modules/.pnpm/tfjs-core/src/ops/moving_average.ts", "../node_modules/.pnpm/tfjs-core/src/ops/scatter_nd.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse_to_dense_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse_to_dense.ts", "../node_modules/.pnpm/tfjs-core/src/ops/gather_nd.ts", "../node_modules/.pnpm/tfjs-core/src/ops/dropout_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/dropout.ts", "../node_modules/.pnpm/tfjs-core/src/ops/signal_ops_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/in_top_k.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fused_ops.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv2d_backprop_filter.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fused_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fused/conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts", "../node_modules/.pnpm/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fused/depthwise_conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/ops/fused/mat_mul.ts", "../node_modules/.pnpm/tfjs-core/src/ops/signal/hamming_window.ts", "../node_modules/.pnpm/tfjs-core/src/ops/signal/hann_window.ts", "../node_modules/.pnpm/tfjs-core/src/ops/signal/frame.ts", "../node_modules/.pnpm/tfjs-core/src/ops/signal/stft.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/crop_and_resize.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/flip_left_right.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/grayscale_to_rgb.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/rotate_with_offset.ts", "../node_modules/.pnpm/tfjs-core/src/ops/nonmax_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression.ts", "../node_modules/.pnpm/tfjs-core/src/backends/non_max_suppression_util.ts", "../node_modules/.pnpm/tfjs-core/src/backends/non_max_suppression_impl.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression_async.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression_with_score.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression_with_score_async.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression_padded.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/non_max_suppression_padded_async.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/resize_bilinear.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/resize_nearest_neighbor.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/threshold.ts", "../node_modules/.pnpm/tfjs-core/src/ops/image/transform.ts", "../node_modules/.pnpm/tfjs-core/src/ops/linalg/band_part.ts", "../node_modules/.pnpm/tfjs-core/src/ops/linalg/gram_schmidt.ts", "../node_modules/.pnpm/tfjs-core/src/ops/linalg/qr.ts", "../node_modules/.pnpm/tfjs-core/src/ops/loss_ops_utils.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/compute_weighted_loss.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/absolute_difference.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/cosine_distance.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/hinge_loss.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/huber_loss.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/log_loss.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/mean_squared_error.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/sigmoid_cross_entropy.ts", "../node_modules/.pnpm/tfjs-core/src/ops/losses/softmax_cross_entropy.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse/sparse_reshape.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse/sparse_segment_mean.ts", "../node_modules/.pnpm/tfjs-core/src/ops/sparse/sparse_segment_sum.ts", "../node_modules/.pnpm/tfjs-core/src/ops/string/string_n_grams.ts", "../node_modules/.pnpm/tfjs-core/src/ops/string/string_split.ts", "../node_modules/.pnpm/tfjs-core/src/ops/string/string_to_hash_bucket_fast.ts", "../node_modules/.pnpm/tfjs-core/src/ops/ops.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/adadelta_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/adagrad_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/adam_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/adamax_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/sgd_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/momentum_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/rmsprop_optimizer.ts", "../node_modules/.pnpm/tfjs-core/src/optimizers/optimizer_constructors.ts", "../node_modules/.pnpm/tfjs-core/src/train.ts", "../node_modules/.pnpm/tfjs-core/src/browser_util.ts", "../node_modules/.pnpm/tfjs-core/src/backends/backend_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/concat_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/reduce_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/rotate_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/array_ops_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/selu_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/erf_util.ts", "../node_modules/.pnpm/tfjs-core/src/backends/complex_util.ts", "../node_modules/.pnpm/tfjs-core/src/backends/einsum_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/split_util.ts", "../node_modules/.pnpm/tfjs-core/src/ops/segment_util.ts", "../node_modules/.pnpm/tfjs-core/src/backends/kernel_impls.ts", "../node_modules/.pnpm/tfjs-core/src/base.ts", "../node_modules/.pnpm/tfjs-core/src/index.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Abs_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Acos_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Acosh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Add_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/AddN_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ArgMax_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ArgMin_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Asin_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Asinh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Atan2_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Atan_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Atanh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/avg_pool_3d_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/AvgPool3D_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/avg_pool_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/AvgPool_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/BatchMatMul_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/BatchToSpaceND_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/BroadcastTo_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Cast_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Ceil_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ClipByValue_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ComplexAbs_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Concat_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Conv2D_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Conv2DBackpropInput_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/conv3d_backprop_filter.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Conv3D_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Cos_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Cosh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Cumsum_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/DepthwiseConv2dNative_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Dilation2D_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Elu_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Erf_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Exp_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ExpandDims_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Expm1_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Floor_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/FloorDiv_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/FusedBatchNorm_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/GatherV2_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/GreaterEqual_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Identity_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/IsFinite_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/IsInf_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/IsNan_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/LeakyRelu_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Log1p_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Log_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/LogSoftmax_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/local_response_normalization_backprop.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/LRN_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/min_max_grad_util.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Max_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Maximum_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max_pool_3d_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/MaxPool3D_grad.ts", "../node_modules/.pnpm/tfjs-core/src/ops/max_pool_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/MaxPool_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Mean_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Min_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Minimum_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/MirrorPad_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Mod_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Multiply_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Neg_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/OneHot_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/OnesLike_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Pack_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/PadV2_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Pow_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Prelu_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/RealDiv_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Reciprocal_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Relu6_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Relu_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Reshape_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ResizeBilinear_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ResizeNearestNeighbor_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Reverse_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Round_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Rsqrt_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Select_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Selu_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sigmoid_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sign_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sin_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sinh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Slice_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Softmax_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Softplus_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/SpaceToBatchND_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/SplitV_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sqrt_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Square_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/SquaredDifference_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Step_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sub_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Sum_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Tan_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Tanh_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Tile_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Transpose_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/Unpack_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/UnsortedSegmentSum_grad.ts", "../node_modules/.pnpm/tfjs-core/src/gradients/ZerosLike_grad.ts", "../node_modules/.pnpm/tfjs-core/src/register_all_gradients.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/abs.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/acos.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/acosh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/add.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/all.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/any.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/arg_max.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/arg_min.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as_scalar.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as_type.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as1d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as2d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as3d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as4d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/as5d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/asin.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/asinh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/atan.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/atan2.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/atanh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/avg_pool.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/batchnorm.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/broadcast_to.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/cast.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/ceil.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/clip_by_value.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/concat.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/conv1d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/conv2d_transpose.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/cos.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/cosh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/cumsum.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/depth_to_space.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/dilation2d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/div_no_nan.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/div.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/dot.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/elu.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/equal.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/erf.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/exp.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/expand_dims.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/expm1.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/fft.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/flatten.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/floor.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/floorDiv.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/gather.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/greater_equal.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/greater.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/ifft.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/irfft.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/is_finite.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/is_inf.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/is_nan.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/leaky_relu.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/less_equal.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/less.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/local_response_normalization.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/log_sigmoid.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/log_softmax.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/log_sum_exp.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/log.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/log1p.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/logical_and.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/logical_not.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/logical_or.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/logical_xor.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/mat_mul.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/max_pool.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/max.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/maximum.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/mean.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/min.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/minimum.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/mirror_pad.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/mod.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/mul.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/neg.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/norm.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/not_equal.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/one_hot.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/ones_like.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/pad.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/pool.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/pow.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/prelu.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/prod.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/reciprocal.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/relu.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/relu6.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/reshape_as.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/reshape.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/resize_bilinear.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/reverse.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/rfft.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/round.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/rsqrt.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/selu.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/separable_conv2d.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sigmoid.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sign.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sin.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sinh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/slice.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/softmax.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/softplus.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/split.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sqrt.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/square.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/squared_difference.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/squeeze.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/stack.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/step.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/strided_slice.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sub.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/sum.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/tan.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/tanh.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/tile.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/to_bool.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/to_float.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/to_int.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/topk.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/transpose.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/unique.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/unstack.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/where.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/zeros_like.ts", "../node_modules/.pnpm/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/backend/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/errors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/generic_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/constraints.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/common.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/math_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/backend/tfjs_backend.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/keras_format/initializer_config.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/initializers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_layers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/backend/state.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/types_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/variable_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/variables.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/topology.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/input_layer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/logs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/base_callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/serialization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/losses.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/optimizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/user_defined_metadata.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/layer_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/serialization_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/container.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/training_tensors.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/engine/training.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/advanced_activations.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/utils/conv_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/convolutional_recurrent.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/core.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/embeddings.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/merge.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/noise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/padding.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/pooling.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/layers/wrappers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_metrics.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_models.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/exports_regularizers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/callbacks.ts", "../node_modules/.pnpm/@tensorflow+tfjs-layers@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-layers/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/data/compiled_api.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/register.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/arithmetic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/basic_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/control.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/convolution.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/creation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/dynamic.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/evaluation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/graph.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/image.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/logical.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/matrices.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/normalization.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/reduction.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/slice_join.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/sparse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/spectral.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/string.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/op_list/transformation.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_mapper.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/custom_op/node_value_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/arithmetic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/basic_math_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_array.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/tensor_list.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/control_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/convolution_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/creation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/dynamic_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/evaluation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/hash_table.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/hash_table_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/image_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/logical_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/matrices_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/normalization_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/reduction_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/slice_join_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/sparse_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/spectral_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/string_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/executors/transformation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/operations/operation_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/execution_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/model_analysis.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_executor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/resource_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/executor/graph_model.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-converter@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-converter/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/lazy_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/util/deep_map.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/util/deep_clone.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/util/ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/util/growing_ring_buffer.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/datasets/text_line_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/datasets/csv_dataset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/microphone_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/datasource.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/string_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/byte_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/file_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/iterators/url_chunk_iterator.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/util/source_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/sources/file_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/sources/url_data_source.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/readers.ts", "../node_modules/.pnpm/@tensorflow+tfjs-data@3.9.0_470c05e138890ee649df8440b2dfddf4/node_modules/@tensorflow/tfjs-data/src/version.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/cpu_util.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/backend_cpu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/shared.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Abs.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/binary_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Complex.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/zeros_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Identity.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Real.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Cast.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/binary_utils.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Add.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Bincount_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/unary_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/unary_utils.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Ceil.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Equal.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Exp.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Expm1.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Floor.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/GatherNd_Impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/GatherV2_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Greater.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Less.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LessEqual.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LinSpace_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Log.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Max_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Maximum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Minimum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Multiply.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Neg.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/NotEqual.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Transpose.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Prod.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Range_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Slice.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseFillEmptyRows_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseReshape_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseSegmentReduction_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sqrt.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StridedSlice_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringNGrams_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringSplit_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringToHashBucketFast_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sub.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Tile_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/TopK_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Unique_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/base.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Elu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Prelu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Relu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Relu6.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/fused_utils.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Reshape.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Acos.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Acosh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/AddN.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/All.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Any.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ArgMax.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ArgMin.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Asin.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Asinh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Atan.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Atan2.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Atanh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/pool_utils.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/AvgPool.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Bincount.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/BroadcastArgs.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Clip.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Imag.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Concat.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv2D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv3D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Cos.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Cosh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Cumsum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Diag.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Dilation2DBackpropFilter.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Dilation2DBackpropInput.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Einsum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/EluGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Erf.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/RealDiv.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/utils/fft_utils.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/FFT.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Fill.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/GatherNd.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/GatherV2.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/IFFT.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/IsFinite.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/IsInf.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/IsNaN.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LinSpace.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Log1p.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LRN.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Max.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPool.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Mean.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Min.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Mod.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Multinomial.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Softmax.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/OneHot.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/OnesLike.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Pack.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/PadV2.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Pow.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Range.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Reverse.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Round.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Scatter_impl.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Select.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Selu.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sign.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sin.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Sinh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Softplus.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseFillEmptyRows.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseSegmentMean.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseSegmentSum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/SplitV.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Square.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Step.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringNGrams.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringSplit.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/StringToHashBucketFast.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Tan.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Tanh.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Tile.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/TopK.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Transform.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Unique.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/Unpack.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/register_all_kernels.ts", "../node_modules/.pnpm/tfjs-backend-cpu/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/canvas_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tex_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flags_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/glsl_version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/shader_compiler.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_math.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/decode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_float_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/encode_matrix_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gpgpu_context.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/packing_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reshape_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/texture_manager.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/unpack_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/backend_webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/webgl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Complex.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/kernel_funcs_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mulmat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/binaryop_complex_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mean_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reduce_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/reduce.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transpose_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Acosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/addn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/argminmax_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/arg_min_max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ArgMin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Asinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atan2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Atanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pool_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/avg_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/AvgPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/batchnorm_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/slice_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Bincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Real.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernel_utils/int.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/clip_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/complex_abs_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ComplexAbs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/concat_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Imag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/im2col_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropFilterV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Conv3DBackpropInputV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/crop_and_resize_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/cumsum_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DenseBincount.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/depth_to_space_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_packed_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/conv_backprop_gpu_depthwise.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/DepthwiseConv2dNativeBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/diag_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Diag.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/dilation_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Dilation2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Einsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/EluGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Erf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Expm1.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fft_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/fill_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/flip_left_right_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels_utils/from_pixels_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FromPixels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_nd_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/gather_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IFFT.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsFinite.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsInf.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/IsNaN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LinSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Log1p.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalNot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LogicalOr.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/lrn_grad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/LRNGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/max_pool_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPool3DGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MaxPoolWithArgmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean_impl.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/mirror_pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Mod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/multinomial_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Multinomial.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/onehot_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/pad_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reciprocal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_bilinear_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeBilinearGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighbor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/resize_nearest_neighbor_backprop_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ResizeNearestNeighborGrad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/reverse_packed_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/rotate_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/scatter_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/select_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Selu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sign.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sinh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Softplus.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseFillEmptyRows.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseReshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseSegmentMean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SparseToDense.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/strided_slice_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringNGrams.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringSplit.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/StringToHashBucketFast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/tile_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/top_k_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/transform_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unique.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/segment_gpu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/kernels/UnsortedSegmentSum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-webgl@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-webgl/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs@3.9.0_seedrandom@3.0.5/node_modules/@tensorflow/tfjs/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs@3.9.0_seedrandom@3.0.5/node_modules/@tensorflow/tfjs/src/index.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/types.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/_FusedMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/unary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Abs.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/binary_kernel.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Add.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AddN.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Identity.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transpose.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/kernel_utils.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/All.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Any.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ArgMax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/AvgPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reshape.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/BatchMatMul.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernel_utils/shared.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Slice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/BatchToSpaceND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cast.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Ceil.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ClipByValue.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Concat.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Conv2DBackpropInput.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cos.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cosh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/CropAndResize.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Cumsum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthToSpace.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Elu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Equal.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Exp.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ExpandDims.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Fill.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FlipLeftRight.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Floor.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FloorDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedBatchNorm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/FusedDepthwiseConv2D.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GatherV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Greater.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/GreaterEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LeakyRelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Less.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LessEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Log.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/LogicalAnd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Max.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Maximum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MaxPool.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Mean.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Min.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Minimum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/MirrorPad.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Multiply.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Neg.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppression_util.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV3.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV4.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NonMaxSuppressionV5.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/NotEqual.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OneHot.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/OnesLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/PadV2.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Pow.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prelu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Prod.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Range.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RealDiv.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Relu6.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ResizeBilinear.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Reverse.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/RotateWithOffset.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Round.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Rsqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ScatterNd.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Select.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sigmoid.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sin.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Softmax.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SpaceToBatchND.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SplitV.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sqrt.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Square.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/SquaredDifference.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Step.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/StridedSlice.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sub.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Sum.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tan.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tanh.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Tile.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/TopK.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Transform.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/Unpack.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/kernels/ZerosLike.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/register_all_kernels.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/flags_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/backend_wasm.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.worker.js", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/version.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/base.ts", "../node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@3.9.0_@tensorflow+tfjs-core@3.9.0/node_modules/@tensorflow/tfjs-backend-wasm/src/index.ts", "tfjs.version.js", "../src/image/imagefx.ts", "../src/util/env.ts", "../src/image/image.ts", "../src/face/facemeshcoords.ts", "../src/face/facemeshutil.ts", "../src/face/blazeface.ts", "../src/face/iris.ts", "../src/face/facemesh.ts", "../src/face/faceres.ts", "../src/gear/emotion.ts", "../src/body/posenetutils.ts", "../src/body/posenet.ts", "../src/handpose/box.ts", "../src/handpose/anchors.ts", "../src/handpose/handdetector.ts", "../src/handpose/util.ts", "../src/handpose/handpipeline.ts", "../src/hand/fingerdef.ts", "../src/hand/fingergesture.ts", "../src/hand/fingerpose.ts", "../src/handpose/handpose.ts", "../src/util/box.ts", "../src/hand/handtrack.ts", "../src/body/annotations.ts", "../src/body/blazepose.ts", "../src/body/efficientpose.ts", "../src/body/movenet.ts", "../src/object/labels.ts", "../src/object/nanodet.ts", "../src/object/centernet.ts", "../src/segmentation/segmentation.ts", "../src/gear/gear-agegenderrace.ts", "../src/models.ts", "../src/tfjs/humangl.ts", "../src/tfjs/backend.ts", "../src/util/draw.ts", "../src/face/angles.ts", "../src/face/face.ts", "../src/gesture/gesture.ts", "../src/util/interpolate.ts", "../src/face/match.ts", "../src/util/persons.ts", "../src/sample.ts", "../src/warmup.ts", "../src/human.ts"], - "sourcesContent": ["/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: join two paths\nexport function join(folder: string, file: string): string {\n const separator = folder.endsWith('/') ? '' : '/';\n const skipJoin = file.startsWith('.') || file.startsWith('/') || file.startsWith('http:') || file.startsWith('https:') || file.startsWith('file:');\n const path = skipJoin ? `${file}` : `${folder}${separator}${file}`;\n if (!path.toLocaleLowerCase().includes('.json')) throw new Error(`modelpath error: ${path} expecting json file`);\n return path;\n}\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\n const dt = new Date();\n const ts = `${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:${dt.getSeconds().toString().padStart(2, '0')}.${dt.getMilliseconds().toString().padStart(3, '0')}`;\n // eslint-disable-next-line no-console\n if (msg) console.log(ts, 'Human:', ...msg);\n}\n\n// helper function: gets elapsed time on both browser and nodejs\nexport const now = () => {\n if (typeof performance !== 'undefined') return performance.now();\n return parseInt((Number(process.hrtime.bigint()) / 1000 / 1000).toString());\n};\n\n// helper function: checks current config validity\nexport function validate(defaults, config, parent = 'config', msgs: Array<{ reason: string, where: string, expected?: string }> = []) {\n for (const key of Object.keys(config)) {\n if (typeof config[key] === 'object') {\n validate(defaults[key], config[key], key, msgs);\n } else {\n const defined = defaults && (typeof defaults[key] !== 'undefined');\n if (!defined) msgs.push({ reason: 'unknown property', where: `${parent}.${key} = ${config[key]}` });\n const same = defaults && typeof defaults[key] === typeof config[key];\n if (defined && !same) msgs.push({ reason: 'property type mismatch', where: `${parent}.${key} = ${config[key]}`, expected: typeof defaults[key] });\n }\n // ok = ok && defined && same;\n }\n if (config.debug && parent === 'config' && msgs.length > 0) log('invalid configuration', msgs);\n return msgs;\n}\n\n// helper function: perform deep merge of multiple objects so it allows full inheriance with overrides\nexport function mergeDeep(...objects) {\n const isObject = (obj) => obj && typeof obj === 'object';\n return objects.reduce((prev, obj) => {\n Object.keys(obj || {}).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal);\n else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal);\n else prev[key] = oVal;\n });\n return prev;\n }, {});\n}\n\n// helper function: return min and max from input array\nexport const minmax = (data: Array) => data.reduce((acc: Array, val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n\n// helper function: async wait\nexport async function wait(time) {\n const waiting = new Promise((resolve) => setTimeout(() => resolve(true), time));\n await waiting;\n}\n", "/* eslint-disable indent */\n/* eslint-disable no-multi-spaces */\n\n/** Dectector part of face configuration */\nexport interface FaceDetectorConfig {\n modelPath: string,\n rotation: boolean,\n maxDetected: number,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n return: boolean,\n}\n\n/** Mesh part of face configuration */\nexport interface FaceMeshConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Iris part of face configuration */\nexport interface FaceIrisConfig {\n enabled: boolean,\n modelPath: string,\n}\n\n/** Description or face embedding part of face configuration\n * - also used by age and gender detection\n */\nexport interface FaceDescriptionConfig {\n enabled: boolean,\n modelPath: string,\n skipFrames: number,\n minConfidence: number,\n}\n\n/** Emotion part of face configuration */\nexport interface FaceEmotionConfig {\n enabled: boolean,\n minConfidence: number,\n skipFrames: number,\n modelPath: string,\n}\n\n/** Controlls and configures all face-specific options:\n * - face detection, face mesh detection, age, gender, emotion detection and face description\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: path for each of face models\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance\n * - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles\n * - return: return extracted face as tensor for futher user processing, in which case user is reponsible for manually disposing the tensor\n*/\nexport interface FaceConfig {\n enabled: boolean,\n detector: Partial,\n mesh: Partial,\n iris: Partial,\n description: Partial,\n emotion: Partial,\n}\n\n/** Controlls and configures all body detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - modelPath: body pose model, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - maxDetected: maximum number of people detected in the input, should be set to the minimum number for performance\n * - detector: optional body detector\n *\n * `maxDetected` is valid for `posenet` and `movenet-multipose` as other models are single-pose only\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `posenet.json`, `blazepose.json`, `efficientpose.json`, `movenet-lightning.json`, `movenet-thunder.json`, `movenet-multipose.json`\n*/\nexport interface BodyConfig {\n enabled: boolean,\n modelPath: string,\n maxDetected: number,\n minConfidence: number,\n skipFrames: number,\n detector?: {\n modelPath: string\n },\n}\n\n/** Controlls and configures all hand detection specific options\n *\n * Parameters:\n * - enabled: true/false\n * - landmarks: detect hand landmarks or just hand boundary box\n * - modelPath: paths for hand detector and hand skeleton models, can be absolute path or relative to modelBasePath\n * - minConfidence: threshold for discarding a prediction\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance\n * - rotation: use best-guess rotated hand image or just box with rotation as-is, false means higher performance, but incorrect finger mapping if hand is inverted\n *\n * `maxDetected` can be set to -1 to auto-detect based on number of detected faces\n *\n * Changing `detector.modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `handdetect.json` and `handtrack.json`\n*/\nexport interface HandConfig {\n enabled: boolean,\n rotation: boolean,\n skipFrames: number,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n landmarks: boolean,\n detector: {\n modelPath?: string,\n },\n skeleton: {\n modelPath?: string,\n },\n}\n\n/** Controlls and configures all object detection specific options\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - minConfidence: minimum score that detection must have to return as valid object\n * - iouThreshold: ammount of overlap between two detected objects before one object is removed\n * - maxDetected: maximum number of detections to return\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `mb3-centernet.json` and `nanodet.json`\n*/\nexport interface ObjectConfig {\n enabled: boolean,\n modelPath: string,\n minConfidence: number,\n iouThreshold: number,\n maxDetected: number,\n skipFrames: number,\n}\n\n/** Controlls and configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n *\n * - enabled: true/false\n * - modelPath: object detection model, can be absolute path or relative to modelBasePath\n * - blur: blur segmentation output by pixels for more realistic image\n *\n * Changing `modelPath` will change module responsible for hand detection and tracking\n * Allowed values are `selfie.json` and `meet.json`\n\n*/\nexport interface SegmentationConfig {\n enabled: boolean,\n modelPath: string,\n blur: number,\n}\n\n/** Run input through image filters before inference\n * - available only in Browser environments\n * - image filters run with near-zero latency as they are executed on the GPU using WebGL\n*/\nexport interface FilterConfig {\n enabled: boolean,\n /** Resize input width\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n width: number,\n /** Resize input height\n * - if both width and height are set to 0, there is no resizing\n * - if just one is set, second one is scaled automatically\n * - if both are set, values are used as-is\n */\n height: number,\n /** Return processed canvas imagedata in result */\n return: boolean,\n /** Flip input as mirror image */\n flip: boolean,\n /** Range: -1 (darken) to 1 (lighten) */\n brightness: number,\n /** Range: -1 (reduce contrast) to 1 (increase contrast) */\n contrast: number,\n /** Range: 0 (no sharpening) to 1 (maximum sharpening) */\n sharpness: number,\n /** Range: 0 (no blur) to N (blur radius in pixels) */\n blur: number\n /** Range: -1 (reduce saturation) to 1 (increase saturation) */\n saturation: number,\n /** Range: 0 (no change) to 360 (hue rotation in degrees) */\n hue: number,\n /** Image negative */\n negative: boolean,\n /** Image sepia colors */\n sepia: boolean,\n /** Image vintage colors */\n vintage: boolean,\n /** Image kodachrome colors */\n kodachrome: boolean,\n /** Image technicolor colors */\n technicolor: boolean,\n /** Image polaroid camera effect */\n polaroid: boolean,\n /** Range: 0 (no pixelate) to N (number of pixels to pixelate) */\n pixelate: number,\n}\n\n/** Controlls gesture detection */\nexport interface GestureConfig {\n enabled: boolean,\n}\n\n/**\n * Configuration interface definition for **Human** library\n *\n * Contains all configurable parameters\n * @typedef Config\n *\n * Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L292)\n */\nexport interface Config {\n /** Backend used for TFJS operations\n * Valid build-in backends are:\n * - Browser: `cpu`, `wasm`, `webgl`, `humangl`\n * - NodeJS: `cpu`, `wasm`, `tensorflow`\n *\n * Experimental:\n * - Browser: `webgpu` - requires custom build of `tfjs-backend-webgpu`\n *\n * Defaults: `humangl` for browser and `tensorflow` for nodejs\n */\n backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu',\n // backend: string;\n\n /** Path to *.wasm files if backend is set to `wasm`\n * - if not set, auto-detects to link to CDN `jsdelivr` when running in browser\n */\n wasmPath: string,\n\n /** Print debug statements to console */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially */\n async: boolean,\n\n /** What to use for `human.warmup()`\n * - warmup pre-initializes all models for faster inference but can take significant time on startup\n */\n warmup: 'none' | 'face' | 'full' | 'body',\n // warmup: string;\n\n /** Base model path (typically starting with file://, http:// or https://) for all models\n * - individual modelPath values are relative to this path\n */\n modelBasePath: string,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n */\n cacheSensitivity: number;\n\n /** Internal Variable */\n skipFrame: boolean;\n\n /** Run input through image filters before inference\n * - image filters run with near-zero latency as they are executed on the GPU\n *\n * {@link FilterConfig}\n */\n filter: Partial,\n\n /** {@link GestureConfig} */\n gesture: Partial;\n\n /** {@link FaceConfig} */\n face: Partial,\n\n /** {@link BodyConfig} */\n body: Partial,\n\n /** {@link HandConfig} */\n hand: Partial,\n\n /** {@link ObjectConfig} */\n object: Partial,\n\n /** {@link SegmentationConfig} */\n segmentation: Partial,\n}\n\n/**\n * [See all default Config values...](https://github.com/vladmandic/human/blob/main/src/config.ts#L244)\n *\n */\nconst config: Config = {\n backend: '', // select tfjs backend to use, leave empty to use default backend\n // for browser environments: 'webgl', 'wasm', 'cpu', or 'humangl' (which is a custom version of webgl)\n // for nodejs environments: 'tensorflow', 'wasm', 'cpu'\n // default set to `humangl` for browsers and `tensorflow` for nodejs\n modelBasePath: '', // base path for all models\n // default set to `../models/` for browsers and `file://models/` for nodejs\n wasmPath: '', // path for wasm binaries, only used for backend: wasm\n // default set to download from jsdeliv during Human class instantiation\n debug: true, // print additional status messages to console\n async: true, // execute enabled models in parallel\n warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'\n // warmup pre-initializes all models for faster inference but can take\n // significant time on startup\n // only used for `webgl` and `humangl` backends\n cacheSensitivity: 0.75, // cache sensitivity\n // values 0..1 where 0.01 means reset cache if input changed more than 1%\n // set to 0 to disable caching\n skipFrame: false, // internal & dynamic\n filter: { // run input through image filters before inference\n // image filters run with near-zero latency as they are executed on the GPU\n enabled: true, // enable image pre-processing filters\n width: 0, // resize input width\n height: 0, // resize input height\n // if both width and height are set to 0, there is no resizing\n // if just one is set, second one is scaled automatically\n // if both are set, values are used as-is\n flip: false, // flip input as mirror image\n return: true, // return processed canvas imagedata in result\n brightness: 0, // range: -1 (darken) to 1 (lighten)\n contrast: 0, // range: -1 (reduce contrast) to 1 (increase contrast)\n sharpness: 0, // range: 0 (no sharpening) to 1 (maximum sharpening)\n blur: 0, // range: 0 (no blur) to N (blur radius in pixels)\n saturation: 0, // range: -1 (reduce saturation) to 1 (increase saturation)\n hue: 0, // range: 0 (no change) to 360 (hue rotation in degrees)\n negative: false, // image negative\n sepia: false, // image sepia colors\n vintage: false, // image vintage colors\n kodachrome: false, // image kodachrome colors\n technicolor: false, // image technicolor colors\n polaroid: false, // image polaroid camera effect\n pixelate: 0, // range: 0 (no pixelate) to N (number of pixels to pixelate)\n },\n\n gesture: {\n enabled: true, // enable gesture recognition based on model results\n },\n\n face: {\n enabled: true, // controls if specified modul is enabled\n // face.enabled is required for all face models:\n // detector, mesh, iris, age, gender, emotion\n // (note: module is not loaded until it is required)\n detector: {\n modelPath: 'blazeface.json', // detector model, can be absolute path or relative to modelBasePath\n rotation: true, // use best-guess rotated face image or just box with rotation as-is\n // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees\n // this parameter is not valid in nodejs\n maxDetected: 1, // maximum number of faces detected in the input\n // should be set to the minimum number for performance\n skipFrames: 11, // how many max frames to go without re-running the face bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated face analysis as the head does not move fast\n // in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.1, // ammount of overlap between two detected objects before one object is removed\n return: false, // return extracted face as tensor\n // in which case user is reponsible for disposing the tensor\n },\n\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json', // facemesh model, can be absolute path or relative to modelBasePath\n },\n\n iris: {\n enabled: true,\n modelPath: 'iris.json', // face iris model\n // can be either absolute path or relative to modelBasePath\n },\n\n emotion: {\n enabled: true,\n minConfidence: 0.1, // threshold for discarding a prediction\n skipFrames: 12, // how max many frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n modelPath: 'emotion.json', // face emotion model, can be absolute path or relative to modelBasePath\n },\n\n description: {\n enabled: true, // to improve accuracy of face description extraction it is\n // recommended to enable detector.rotation and mesh.enabled\n modelPath: 'faceres.json', // face description model\n // can be either absolute path or relative to modelBasePath\n skipFrames: 13, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n minConfidence: 0.1, // threshold for discarding a prediction\n },\n },\n\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath\n // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'\n detector: {\n modelPath: '', // optional body detector\n },\n maxDetected: -1, // maximum number of people detected in the input\n // should be set to the minimum number for performance\n // only valid for posenet and movenet-multipose as other models detects single pose\n // set to -1 to autodetect based on number of detected faces\n minConfidence: 0.2, // threshold for discarding a prediction\n skipFrames: 1, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n},\n\n hand: {\n enabled: true,\n rotation: true, // use best-guess rotated hand image or just box with rotation as-is\n // false means higher performance, but incorrect finger mapping if hand is inverted\n // only valid for `handdetect` variation\n skipFrames: 14, // how many max frames to go without re-running the hand bounding box detector\n // only used when cacheSensitivity is not zero\n // e.g., if model is running st 25 FPS, we can re-use existing bounding\n // box for updated hand skeleton analysis as the hand\n // hasn't moved much in short time (10 * 1/25 = 0.25 sec)\n minConfidence: 0.5, // threshold for discarding a prediction\n iouThreshold: 0.2, // ammount of overlap between two detected objects before one object is removed\n maxDetected: -1, // maximum number of hands detected in the input\n // should be set to the minimum number for performance\n // set to -1 to autodetect based on number of detected faces\n landmarks: true, // detect hand landmarks or just hand boundary box\n detector: {\n modelPath: 'handtrack.json', // hand detector model, can be absolute path or relative to modelBasePath\n // can be 'handdetect' or 'handtrack'\n },\n skeleton: {\n modelPath: 'handskeleton.json', // hand skeleton model, can be absolute path or relative to modelBasePath\n },\n },\n\n object: {\n enabled: false,\n modelPath: 'mb3-centernet.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'mb3-centernet' or 'nanodet'\n minConfidence: 0.2, // threshold for discarding a prediction\n iouThreshold: 0.4, // ammount of overlap between two detected objects before one object is removed\n maxDetected: 10, // maximum number of objects detected in the input\n skipFrames: 15, // how many max frames to go without re-running the detector\n // only used when cacheSensitivity is not zero\n },\n\n segmentation: {\n enabled: false, // controlls and configures all body segmentation module\n // removes background from input containing person\n // if segmentation is enabled it will run as preprocessing task before any other model\n // alternatively leave it disabled and use it on-demand using human.segmentation method which can\n // remove background or replace it with user-provided background\n modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath\n // can be 'selfie' or 'meet'\n blur: 8, // blur segmentation output by n pixels for more realistic image\n },\n};\n\nexport { config as defaults };\n", "module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n", "", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "", "/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "", "", "", "", "\nvar WasmBackendModuleThreadedSimd = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModuleThreadedSimd) {\n WasmBackendModuleThreadedSimd = WasmBackendModuleThreadedSimd || {};\n\nfunction GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModuleThreadedSimd!==\"undefined\"?WasmBackendModuleThreadedSimd:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module[\"ENVIRONMENT_IS_PTHREAD\"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module[\"buffer\"]}var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"};var nodeWorkerThreads;try{nodeWorkerThreads=require(\"worker_threads\")}catch(e){console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(typeof _scriptDir !== \"undefined\" && _scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance===\"undefined\"){global.performance=require(\"perf_hooks\").performance}}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){GROWABLE_HEAP_I8().set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module[\"wasmMemory\"];buffer=Module[\"buffer\"]}else{if(Module[\"wasmMemory\"]){wasmMemory=Module[\"wasmMemory\"]}else{wasmMemory=new WebAssembly.Memory({\"initial\":INITIAL_MEMORY/65536,\"maximum\":2147483648/65536,\"shared\":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\");if(ENVIRONMENT_IS_NODE){console.log(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)\")}throw Error(\"bad memory\")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,\"addRunDependency cannot be used in a pthread worker\");runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error(\"Pthread aborting at \"+(new Error).stack);what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm-threaded-simd.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmTable=Module[\"asm\"][\"F\"];wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency(\"wasm-instantiate\")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency(\"wasm-instantiate\")}function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"],output[\"module\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var ASM_CONSTS={10024:function(){throw\"Canceled!\"},10042:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw\"Atomics.notify returned an unexpected value \"+ret}Module[\"_emscripten_futex_wake\"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! killThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in killThread!\";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cancelThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cancelThread!\";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({\"cmd\":\"cancel\"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! cleanupThread() can only ever be called from main application thread!\";if(!pthread_ptr)throw\"Internal Error! Null pthread_ptr in cleanupThread!\";var pthread=PThread.pthreads[pthread_ptr];if(pthread){GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],initMainThreadBlock:function(){var pthreadPoolSize=Math.min(4,Math.max(1,(navigator.hardwareConcurrency||1)/2));for(var i=0;i>2]=tb;var headPtr=tb+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),tb+100>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],setThreadStatus:function(){},runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(GROWABLE_HEAP_U32(),tb+56>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,0);PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exit\"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({\"cmd\":\"cancelDone\"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e[\"data\"];var cmd=d[\"cmd\"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d[\"targetThread\"]&&d[\"targetThread\"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d[\"transferList\"])}else{console.error('Internal error! Worker sent a message \"'+cmd+'\" to target pthread '+d[\"targetThread\"]+\", but that thread no longer exists!\")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd===\"processQueuedMainThreadWork\"){_emscripten_main_thread_process_queued_calls()}else if(cmd===\"spawnThread\"){spawnThread(e.data)}else if(cmd===\"cleanupThread\"){cleanupThread(d[\"thread\"])}else if(cmd===\"killThread\"){killThread(d[\"thread\"])}else if(cmd===\"cancelThread\"){cancelThread(d[\"thread\"])}else if(cmd===\"loaded\"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd===\"print\"){out(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"printErr\"){err(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"alert\"){alert(\"Thread \"+d[\"threadId\"]+\": \"+d[\"text\"])}else if(cmd===\"exit\"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd===\"exitProcess\"){try{exit(d[\"returnCode\"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd===\"cancelDone\"){PThread.returnWorkerToPool(worker)}else if(cmd===\"objectTransfer\"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target===\"setimmediate\"){worker.postMessage(e.data)}else{err(\"worker sent an unknown command \"+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err(\"pthread sent an error! \"+e.filename+\":\"+e.lineno+\": \"+e.message)};if(ENVIRONMENT_IS_NODE){worker.on(\"message\",function(data){worker.onmessage({data:data})});worker.on(\"error\",function(data){worker.onerror(data)});worker.on(\"exit\",function(data){})}worker.postMessage({\"cmd\":\"load\",\"urlOrBlob\":Module[\"mainScriptUrlOrBlob\"]||_scriptDir,\"wasmMemory\":wasmMemory,\"wasmModule\":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile(\"tfjs-backend-wasm-threaded-simd.worker.js\");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({\"cmd\":\"processQueuedMainThreadWork\"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({\"targetThread\":targetThreadId,\"cmd\":\"processThreadQueue\"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({\"cmd\":\"processThreadQueue\"})}return 1}function _abort(){abort()}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret===\"timed-out\")return-73;if(ret===\"not-equal\")return-6;if(ret===\"ok\")return 0;throw\"Atomics.wait returned an unexpected value \"+ret}else{if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(GROWABLE_HEAP_I32(),addr>>2)!=val){return-6}lastAddr=Atomics.exchange(GROWABLE_HEAP_I32(),__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_num_logical_cores(){if(ENVIRONMENT_IS_NODE)return require(\"os\").cpus().length;return navigator[\"hardwareConcurrency\"]}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?GROWABLE_HEAP_F64()[buf++>>1]:GROWABLE_HEAP_I32()[buf]);++buf}return readAsmConstArgsArray}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return\"\";if(target==window)return\"#window\";if(target==screen)return\"#screen\";return target&&target.nodeName?target.nodeName:\"\"},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):\"\";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!==\"undefined\"?document:0,typeof window!==\"undefined\"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!==\"undefined\"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension(\"ANGLE_instanced_arrays\");if(ext){ctx[\"vertexAttribDivisor\"]=function(index,divisor){ext[\"vertexAttribDivisorANGLE\"](index,divisor)};ctx[\"drawArraysInstanced\"]=function(mode,first,count,primcount){ext[\"drawArraysInstancedANGLE\"](mode,first,count,primcount)};ctx[\"drawElementsInstanced\"]=function(mode,count,type,indices,primcount){ext[\"drawElementsInstancedANGLE\"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension(\"OES_vertex_array_object\");if(ext){ctx[\"createVertexArray\"]=function(){return ext[\"createVertexArrayOES\"]()};ctx[\"deleteVertexArray\"]=function(vao){ext[\"deleteVertexArrayOES\"](vao)};ctx[\"bindVertexArray\"]=function(vao){ext[\"bindVertexArrayOES\"](vao)};ctx[\"isVertexArray\"]=function(vao){return ext[\"isVertexArrayOES\"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension(\"WEBGL_draw_buffers\");if(ext){ctx[\"drawBuffers\"]=function(n,bufs){ext[\"drawBuffersWEBGL\"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension(\"WEBGL_multi_draw\"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext(\"webgl\",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault===\"undefined\"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents===\"object\")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);GLctx.disjointTimerQueryExt=GLctx.getExtension(\"EXT_disjoint_timer_query\");__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(ext.indexOf(\"lose_context\")<0&&ext.indexOf(\"debug\")<0){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];var contextAttributes={\"alpha\":!!GROWABLE_HEAP_I32()[a+(0>>2)],\"depth\":!!GROWABLE_HEAP_I32()[a+(4>>2)],\"stencil\":!!GROWABLE_HEAP_I32()[a+(8>>2)],\"antialias\":!!GROWABLE_HEAP_I32()[a+(12>>2)],\"premultipliedAlpha\":!!GROWABLE_HEAP_I32()[a+(16>>2)],\"preserveDrawingBuffer\":!!GROWABLE_HEAP_I32()[a+(20>>2)],\"powerPreference\":__emscripten_webgl_power_preferences[powerPreference],\"failIfMajorPerformanceCaveat\":!!GROWABLE_HEAP_I32()[a+(28>>2)],majorVersion:GROWABLE_HEAP_I32()[a+(32>>2)],minorVersion:GROWABLE_HEAP_I32()[a+(36>>2)],enableExtensionsByDefault:GROWABLE_HEAP_I32()[a+(40>>2)],explicitSwapControl:GROWABLE_HEAP_I32()[a+(44>>2)],proxyContextToMainThread:GROWABLE_HEAP_I32()[a+(48>>2)],renderViaOffscreenBackBuffer:GROWABLE_HEAP_I32()[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset)}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.threadExitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw\"Internal Error! spawnThread() can only ever be called from main application thread!\";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw\"Internal error!\";if(!threadParams.pthread_ptr)throw\"Internal error, no pthread ptr!\";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(64>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(100>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(76>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(172>>2),global_locale);worker.pthread=pthread;var msg={\"cmd\":\"run\",\"start_routine\":threadParams.startRoutine,\"arg\":threadParams.arg,\"threadInfoStruct\":threadParams.pthread_ptr,\"stackBase\":threadParams.stackBase,\"stackSize\":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer===\"undefined\"){err(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\");return 6}if(!pthread_ptr){err(\"pthread_create called with a null thread pointer!\");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd=\"spawnThread\";postMessage(threadParams,transferList)}else{spawnThread(threadParams)}return 0}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={\"e\":___assert_fail,\"r\":___call_main,\"x\":__emscripten_notify_thread_queue,\"b\":_abort,\"y\":_emscripten_asm_const_int,\"j\":_emscripten_conditional_set_current_thread_status,\"c\":_emscripten_futex_wait,\"d\":_emscripten_futex_wake,\"f\":_emscripten_get_now,\"p\":_emscripten_memcpy_big,\"z\":_emscripten_num_logical_cores,\"u\":_emscripten_receive_on_main_thread_js,\"q\":_emscripten_resize_heap,\"v\":_emscripten_set_canvas_element_size,\"i\":_emscripten_set_current_thread_status,\"t\":_emscripten_set_thread_name,\"w\":_emscripten_webgl_create_context,\"m\":_fd_close,\"n\":_fd_seek,\"g\":_fd_write,\"o\":initPthreadsJS,\"a\":wasmMemory||Module[\"wasmMemory\"],\"k\":_pthread_cleanup_pop,\"l\":_pthread_cleanup_push,\"h\":_pthread_create,\"s\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _Cosh=Module[\"_Cosh\"]=function(){return(_Cosh=Module[\"_Cosh\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _Elu=Module[\"_Elu\"]=function(){return(_Elu=Module[\"_Elu\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Ua\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Va\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Wa\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Xa\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Ya\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Za\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"_a\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"$a\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"ab\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"bb\"]).apply(null,arguments)};var _Transform=Module[\"_Transform\"]=function(){return(_Transform=Module[\"_Transform\"]=Module[\"asm\"][\"cb\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"db\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"eb\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"fb\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"gb\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"hb\"]).apply(null,arguments)};var _emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=function(){return(_emscripten_get_global_libc=Module[\"_emscripten_get_global_libc\"]=Module[\"asm\"][\"ib\"]).apply(null,arguments)};var _pthread_self=Module[\"_pthread_self\"]=function(){return(_pthread_self=Module[\"_pthread_self\"]=Module[\"asm\"][\"jb\"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=function(){return(___pthread_tsd_run_dtors=Module[\"___pthread_tsd_run_dtors\"]=Module[\"asm\"][\"kb\"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=function(){return(_emscripten_main_thread_process_queued_calls=Module[\"_emscripten_main_thread_process_queued_calls\"]=Module[\"asm\"][\"lb\"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=function(){return(_emscripten_current_thread_process_queued_calls=Module[\"_emscripten_current_thread_process_queued_calls\"]=Module[\"asm\"][\"mb\"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=function(){return(_emscripten_register_main_browser_thread_id=Module[\"_emscripten_register_main_browser_thread_id\"]=Module[\"asm\"][\"nb\"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=function(){return(__emscripten_do_dispatch_to_thread=Module[\"__emscripten_do_dispatch_to_thread\"]=Module[\"asm\"][\"ob\"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module[\"_emscripten_sync_run_in_main_thread_4\"]=Module[\"asm\"][\"pb\"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module[\"_emscripten_run_in_main_runtime_thread_js\"]=Module[\"asm\"][\"qb\"]).apply(null,arguments)};var __emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=function(){return(__emscripten_call_on_thread=Module[\"__emscripten_call_on_thread\"]=Module[\"asm\"][\"rb\"]).apply(null,arguments)};var _emscripten_tls_init=Module[\"_emscripten_tls_init\"]=function(){return(_emscripten_tls_init=Module[\"_emscripten_tls_init\"]=Module[\"asm\"][\"sb\"]).apply(null,arguments)};var __emscripten_thread_init=Module[\"__emscripten_thread_init\"]=function(){return(__emscripten_thread_init=Module[\"__emscripten_thread_init\"]=Module[\"asm\"][\"tb\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"ub\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"vb\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"wb\"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=function(){return(_emscripten_stack_set_limits=Module[\"_emscripten_stack_set_limits\"]=Module[\"asm\"][\"xb\"]).apply(null,arguments)};var _memalign=Module[\"_memalign\"]=function(){return(_memalign=Module[\"_memalign\"]=Module[\"asm\"][\"yb\"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module[\"__emscripten_allow_main_runtime_queued_calls\"]=10016;var __emscripten_main_thread_futex=Module[\"__emscripten_main_thread_futex\"]=11652;Module[\"cwrap\"]=cwrap;Module[\"PThread\"]=PThread;Module[\"PThread\"]=PThread;Module[\"wasmMemory\"]=wasmMemory;Module[\"ExitStatus\"]=ExitStatus;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({\"cmd\":\"loaded\"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({\"cmd\":\"exitProcess\",\"returnCode\":status});throw new ExitStatus(status)}else{}}if(noExitRuntime){}else{PThread.terminateAllThreads();EXITSTATUS=status;exitRuntime();if(Module[\"onExit\"])Module[\"onExit\"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run();\n\n\n return WasmBackendModuleThreadedSimd.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModuleThreadedSimd;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModuleThreadedSimd; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModuleThreadedSimd\"] = WasmBackendModuleThreadedSimd;\n", "\nvar WasmBackendModule = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(WasmBackendModule) {\n WasmBackendModule = WasmBackendModule || {};\n\nvar Module=typeof WasmBackendModule!==\"undefined\"?WasmBackendModule:{};var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram=\"./this.program\";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window===\"object\";ENVIRONMENT_IS_WORKER=typeof importScripts===\"function\";ENVIRONMENT_IS_NODE=typeof process===\"object\"&&typeof process.versions===\"object\"&&typeof process.versions.node===\"string\";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require(\"path\").dirname(scriptDirectory)+\"/\"}else{scriptDirectory=__dirname+\"/\"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require(\"fs\");if(!nodePath)nodePath=require(\"path\");filename=nodePath[\"normalize\"](filename);return nodeFS[\"readFileSync\"](filename,binary?null:\"utf8\")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process[\"argv\"].length>1){thisProgram=process[\"argv\"][1].replace(/\\\\/g,\"/\")}arguments_=process[\"argv\"].slice(2);process[\"on\"](\"uncaughtException\",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process[\"on\"](\"unhandledRejection\",abort);quit_=function(status){process[\"exit\"](status)};Module[\"inspect\"]=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){arguments_=scriptArgs}else if(typeof arguments!=\"undefined\"){arguments_=arguments}if(typeof quit===\"function\"){quit_=function(status){quit(status)}}if(typeof print!==\"undefined\"){if(typeof console===\"undefined\")console={};console.log=print;console.warn=console.error=typeof printErr!==\"undefined\"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!==\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])quit_=Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];var noExitRuntime=Module[\"noExitRuntime\"]||true;if(typeof WebAssembly!==\"object\"){abort(\"no native wasm support detected\")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str=\"\";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module[\"HEAP8\"]=HEAP8=new Int8Array(buf);Module[\"HEAP16\"]=HEAP16=new Int16Array(buf);Module[\"HEAP32\"]=HEAP32=new Int32Array(buf);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buf);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buf);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buf);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buf);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}what+=\"\";err(what);ABORT=true;EXITSTATUS=1;what=\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix=\"file://\";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile=\"tfjs-backend-wasm.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw\"both async and sync fetching of the wasm failed\"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch===\"function\"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){if(!response[\"ok\"]){throw\"failed to load wasm binary file at '\"+wasmBinaryFile+\"'\"}return response[\"arrayBuffer\"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={\"a\":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module[\"asm\"]=exports;wasmMemory=Module[\"asm\"][\"i\"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module[\"asm\"][\"o\"];removeRunDependency(\"wasm-instantiate\")}addRunDependency(\"wasm-instantiate\");function receiveInstantiatedSource(output){receiveInstance(output[\"instance\"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err(\"failed to asynchronously prepare wasm: \"+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming===\"function\"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch===\"function\"){return fetch(wasmBinaryFile,{credentials:\"same-origin\"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err(\"wasm streaming compile failed: \"+reason);err(\"falling back to ArrayBuffer instantiation\");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module[\"instantiateWasm\"]){try{var exports=Module[\"instantiateWasm\"](info,receiveInstance);return exports}catch(e){err(\"Module.instantiateWasm callback failed with error: \"+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback(Module);continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _abort(){abort()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_create(){return 6}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _sysconf(name){switch(name){case 30:return 16384;case 85:var maxHeapSize=2147483648;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:case 80:case 81:case 79:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator===\"object\")return navigator[\"hardwareConcurrency\"]||1;return 1}}setErrNo(28);return-1}var asmLibraryArg={\"a\":_abort,\"d\":_emscripten_memcpy_big,\"e\":_emscripten_resize_heap,\"f\":_fd_close,\"c\":_fd_seek,\"b\":_fd_write,\"g\":_pthread_create,\"h\":_sysconf};var asm=createWasm();var ___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=function(){return(___wasm_call_ctors=Module[\"___wasm_call_ctors\"]=Module[\"asm\"][\"j\"]).apply(null,arguments)};var _init=Module[\"_init\"]=function(){return(_init=Module[\"_init\"]=Module[\"asm\"][\"k\"]).apply(null,arguments)};var _register_tensor=Module[\"_register_tensor\"]=function(){return(_register_tensor=Module[\"_register_tensor\"]=Module[\"asm\"][\"l\"]).apply(null,arguments)};var _dispose_data=Module[\"_dispose_data\"]=function(){return(_dispose_data=Module[\"_dispose_data\"]=Module[\"asm\"][\"m\"]).apply(null,arguments)};var _dispose=Module[\"_dispose\"]=function(){return(_dispose=Module[\"_dispose\"]=Module[\"asm\"][\"n\"]).apply(null,arguments)};var _Abs=Module[\"_Abs\"]=function(){return(_Abs=Module[\"_Abs\"]=Module[\"asm\"][\"p\"]).apply(null,arguments)};var _Add=Module[\"_Add\"]=function(){return(_Add=Module[\"_Add\"]=Module[\"asm\"][\"q\"]).apply(null,arguments)};var _AddN=Module[\"_AddN\"]=function(){return(_AddN=Module[\"_AddN\"]=Module[\"asm\"][\"r\"]).apply(null,arguments)};var _All=Module[\"_All\"]=function(){return(_All=Module[\"_All\"]=Module[\"asm\"][\"s\"]).apply(null,arguments)};var _Any=Module[\"_Any\"]=function(){return(_Any=Module[\"_Any\"]=Module[\"asm\"][\"t\"]).apply(null,arguments)};var _ArgMax=Module[\"_ArgMax\"]=function(){return(_ArgMax=Module[\"_ArgMax\"]=Module[\"asm\"][\"u\"]).apply(null,arguments)};var _AvgPool=Module[\"_AvgPool\"]=function(){return(_AvgPool=Module[\"_AvgPool\"]=Module[\"asm\"][\"v\"]).apply(null,arguments)};var _BatchMatMul=Module[\"_BatchMatMul\"]=function(){return(_BatchMatMul=Module[\"_BatchMatMul\"]=Module[\"asm\"][\"w\"]).apply(null,arguments)};var _Ceil=Module[\"_Ceil\"]=function(){return(_Ceil=Module[\"_Ceil\"]=Module[\"asm\"][\"x\"]).apply(null,arguments)};var _ClipByValue=Module[\"_ClipByValue\"]=function(){return(_ClipByValue=Module[\"_ClipByValue\"]=Module[\"asm\"][\"y\"]).apply(null,arguments)};var _Conv2D=Module[\"_Conv2D\"]=function(){return(_Conv2D=Module[\"_Conv2D\"]=Module[\"asm\"][\"z\"]).apply(null,arguments)};var _Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=function(){return(_Conv2DBackpropInput=Module[\"_Conv2DBackpropInput\"]=Module[\"asm\"][\"A\"]).apply(null,arguments)};var _Cos=Module[\"_Cos\"]=function(){return(_Cos=Module[\"_Cos\"]=Module[\"asm\"][\"B\"]).apply(null,arguments)};var _Cosh=Module[\"_Cosh\"]=function(){return(_Cosh=Module[\"_Cosh\"]=Module[\"asm\"][\"C\"]).apply(null,arguments)};var _CropAndResize=Module[\"_CropAndResize\"]=function(){return(_CropAndResize=Module[\"_CropAndResize\"]=Module[\"asm\"][\"D\"]).apply(null,arguments)};var _Cumsum=Module[\"_Cumsum\"]=function(){return(_Cumsum=Module[\"_Cumsum\"]=Module[\"asm\"][\"E\"]).apply(null,arguments)};var _DepthToSpace=Module[\"_DepthToSpace\"]=function(){return(_DepthToSpace=Module[\"_DepthToSpace\"]=Module[\"asm\"][\"F\"]).apply(null,arguments)};var _DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=function(){return(_DepthwiseConv2dNative=Module[\"_DepthwiseConv2dNative\"]=Module[\"asm\"][\"G\"]).apply(null,arguments)};var _Elu=Module[\"_Elu\"]=function(){return(_Elu=Module[\"_Elu\"]=Module[\"asm\"][\"H\"]).apply(null,arguments)};var _Equal=Module[\"_Equal\"]=function(){return(_Equal=Module[\"_Equal\"]=Module[\"asm\"][\"I\"]).apply(null,arguments)};var _Exp=Module[\"_Exp\"]=function(){return(_Exp=Module[\"_Exp\"]=Module[\"asm\"][\"J\"]).apply(null,arguments)};var _FlipLeftRight=Module[\"_FlipLeftRight\"]=function(){return(_FlipLeftRight=Module[\"_FlipLeftRight\"]=Module[\"asm\"][\"K\"]).apply(null,arguments)};var _Floor=Module[\"_Floor\"]=function(){return(_Floor=Module[\"_Floor\"]=Module[\"asm\"][\"L\"]).apply(null,arguments)};var _FloorDiv=Module[\"_FloorDiv\"]=function(){return(_FloorDiv=Module[\"_FloorDiv\"]=Module[\"asm\"][\"M\"]).apply(null,arguments)};var _FusedBatchNorm=Module[\"_FusedBatchNorm\"]=function(){return(_FusedBatchNorm=Module[\"_FusedBatchNorm\"]=Module[\"asm\"][\"N\"]).apply(null,arguments)};var _FusedConv2D=Module[\"_FusedConv2D\"]=function(){return(_FusedConv2D=Module[\"_FusedConv2D\"]=Module[\"asm\"][\"O\"]).apply(null,arguments)};var _FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=function(){return(_FusedDepthwiseConv2D=Module[\"_FusedDepthwiseConv2D\"]=Module[\"asm\"][\"P\"]).apply(null,arguments)};var _Gather=Module[\"_Gather\"]=function(){return(_Gather=Module[\"_Gather\"]=Module[\"asm\"][\"Q\"]).apply(null,arguments)};var _GatherNd=Module[\"_GatherNd\"]=function(){return(_GatherNd=Module[\"_GatherNd\"]=Module[\"asm\"][\"R\"]).apply(null,arguments)};var _Greater=Module[\"_Greater\"]=function(){return(_Greater=Module[\"_Greater\"]=Module[\"asm\"][\"S\"]).apply(null,arguments)};var _GreaterEqual=Module[\"_GreaterEqual\"]=function(){return(_GreaterEqual=Module[\"_GreaterEqual\"]=Module[\"asm\"][\"T\"]).apply(null,arguments)};var _LeakyRelu=Module[\"_LeakyRelu\"]=function(){return(_LeakyRelu=Module[\"_LeakyRelu\"]=Module[\"asm\"][\"U\"]).apply(null,arguments)};var _Less=Module[\"_Less\"]=function(){return(_Less=Module[\"_Less\"]=Module[\"asm\"][\"V\"]).apply(null,arguments)};var _LessEqual=Module[\"_LessEqual\"]=function(){return(_LessEqual=Module[\"_LessEqual\"]=Module[\"asm\"][\"W\"]).apply(null,arguments)};var _Log=Module[\"_Log\"]=function(){return(_Log=Module[\"_Log\"]=Module[\"asm\"][\"X\"]).apply(null,arguments)};var _LogicalAnd=Module[\"_LogicalAnd\"]=function(){return(_LogicalAnd=Module[\"_LogicalAnd\"]=Module[\"asm\"][\"Y\"]).apply(null,arguments)};var _Max=Module[\"_Max\"]=function(){return(_Max=Module[\"_Max\"]=Module[\"asm\"][\"Z\"]).apply(null,arguments)};var _MaxPool=Module[\"_MaxPool\"]=function(){return(_MaxPool=Module[\"_MaxPool\"]=Module[\"asm\"][\"_\"]).apply(null,arguments)};var _Maximum=Module[\"_Maximum\"]=function(){return(_Maximum=Module[\"_Maximum\"]=Module[\"asm\"][\"$\"]).apply(null,arguments)};var _Mean=Module[\"_Mean\"]=function(){return(_Mean=Module[\"_Mean\"]=Module[\"asm\"][\"aa\"]).apply(null,arguments)};var _Min=Module[\"_Min\"]=function(){return(_Min=Module[\"_Min\"]=Module[\"asm\"][\"ba\"]).apply(null,arguments)};var _Minimum=Module[\"_Minimum\"]=function(){return(_Minimum=Module[\"_Minimum\"]=Module[\"asm\"][\"ca\"]).apply(null,arguments)};var _MirrorPad=Module[\"_MirrorPad\"]=function(){return(_MirrorPad=Module[\"_MirrorPad\"]=Module[\"asm\"][\"da\"]).apply(null,arguments)};var _Multiply=Module[\"_Multiply\"]=function(){return(_Multiply=Module[\"_Multiply\"]=Module[\"asm\"][\"ea\"]).apply(null,arguments)};var _Neg=Module[\"_Neg\"]=function(){return(_Neg=Module[\"_Neg\"]=Module[\"asm\"][\"fa\"]).apply(null,arguments)};var _NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=function(){return(_NonMaxSuppressionV3=Module[\"_NonMaxSuppressionV3\"]=Module[\"asm\"][\"ga\"]).apply(null,arguments)};var _NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=function(){return(_NonMaxSuppressionV4=Module[\"_NonMaxSuppressionV4\"]=Module[\"asm\"][\"ha\"]).apply(null,arguments)};var _NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=function(){return(_NonMaxSuppressionV5=Module[\"_NonMaxSuppressionV5\"]=Module[\"asm\"][\"ia\"]).apply(null,arguments)};var _NotEqual=Module[\"_NotEqual\"]=function(){return(_NotEqual=Module[\"_NotEqual\"]=Module[\"asm\"][\"ja\"]).apply(null,arguments)};var _OneHot=Module[\"_OneHot\"]=function(){return(_OneHot=Module[\"_OneHot\"]=Module[\"asm\"][\"ka\"]).apply(null,arguments)};var _PadV2=Module[\"_PadV2\"]=function(){return(_PadV2=Module[\"_PadV2\"]=Module[\"asm\"][\"la\"]).apply(null,arguments)};var _Pow=Module[\"_Pow\"]=function(){return(_Pow=Module[\"_Pow\"]=Module[\"asm\"][\"ma\"]).apply(null,arguments)};var _Prelu=Module[\"_Prelu\"]=function(){return(_Prelu=Module[\"_Prelu\"]=Module[\"asm\"][\"na\"]).apply(null,arguments)};var _Prod=Module[\"_Prod\"]=function(){return(_Prod=Module[\"_Prod\"]=Module[\"asm\"][\"oa\"]).apply(null,arguments)};var _RealDiv=Module[\"_RealDiv\"]=function(){return(_RealDiv=Module[\"_RealDiv\"]=Module[\"asm\"][\"pa\"]).apply(null,arguments)};var _Relu=Module[\"_Relu\"]=function(){return(_Relu=Module[\"_Relu\"]=Module[\"asm\"][\"qa\"]).apply(null,arguments)};var _Relu6=Module[\"_Relu6\"]=function(){return(_Relu6=Module[\"_Relu6\"]=Module[\"asm\"][\"ra\"]).apply(null,arguments)};var _ResizeBilinear=Module[\"_ResizeBilinear\"]=function(){return(_ResizeBilinear=Module[\"_ResizeBilinear\"]=Module[\"asm\"][\"sa\"]).apply(null,arguments)};var _Reverse=Module[\"_Reverse\"]=function(){return(_Reverse=Module[\"_Reverse\"]=Module[\"asm\"][\"ta\"]).apply(null,arguments)};var _RotateWithOffset=Module[\"_RotateWithOffset\"]=function(){return(_RotateWithOffset=Module[\"_RotateWithOffset\"]=Module[\"asm\"][\"ua\"]).apply(null,arguments)};var _Round=Module[\"_Round\"]=function(){return(_Round=Module[\"_Round\"]=Module[\"asm\"][\"va\"]).apply(null,arguments)};var _Rsqrt=Module[\"_Rsqrt\"]=function(){return(_Rsqrt=Module[\"_Rsqrt\"]=Module[\"asm\"][\"wa\"]).apply(null,arguments)};var _ScatterNd=Module[\"_ScatterNd\"]=function(){return(_ScatterNd=Module[\"_ScatterNd\"]=Module[\"asm\"][\"xa\"]).apply(null,arguments)};var _SelectV2=Module[\"_SelectV2\"]=function(){return(_SelectV2=Module[\"_SelectV2\"]=Module[\"asm\"][\"ya\"]).apply(null,arguments)};var _Sigmoid=Module[\"_Sigmoid\"]=function(){return(_Sigmoid=Module[\"_Sigmoid\"]=Module[\"asm\"][\"za\"]).apply(null,arguments)};var _Sin=Module[\"_Sin\"]=function(){return(_Sin=Module[\"_Sin\"]=Module[\"asm\"][\"Aa\"]).apply(null,arguments)};var _Softmax=Module[\"_Softmax\"]=function(){return(_Softmax=Module[\"_Softmax\"]=Module[\"asm\"][\"Ba\"]).apply(null,arguments)};var _Sqrt=Module[\"_Sqrt\"]=function(){return(_Sqrt=Module[\"_Sqrt\"]=Module[\"asm\"][\"Ca\"]).apply(null,arguments)};var _Square=Module[\"_Square\"]=function(){return(_Square=Module[\"_Square\"]=Module[\"asm\"][\"Da\"]).apply(null,arguments)};var _SquaredDifference=Module[\"_SquaredDifference\"]=function(){return(_SquaredDifference=Module[\"_SquaredDifference\"]=Module[\"asm\"][\"Ea\"]).apply(null,arguments)};var _Step=Module[\"_Step\"]=function(){return(_Step=Module[\"_Step\"]=Module[\"asm\"][\"Fa\"]).apply(null,arguments)};var _StridedSlice=Module[\"_StridedSlice\"]=function(){return(_StridedSlice=Module[\"_StridedSlice\"]=Module[\"asm\"][\"Ga\"]).apply(null,arguments)};var _Sub=Module[\"_Sub\"]=function(){return(_Sub=Module[\"_Sub\"]=Module[\"asm\"][\"Ha\"]).apply(null,arguments)};var _Sum=Module[\"_Sum\"]=function(){return(_Sum=Module[\"_Sum\"]=Module[\"asm\"][\"Ia\"]).apply(null,arguments)};var _Tan=Module[\"_Tan\"]=function(){return(_Tan=Module[\"_Tan\"]=Module[\"asm\"][\"Ja\"]).apply(null,arguments)};var _Tanh=Module[\"_Tanh\"]=function(){return(_Tanh=Module[\"_Tanh\"]=Module[\"asm\"][\"Ka\"]).apply(null,arguments)};var _Tile=Module[\"_Tile\"]=function(){return(_Tile=Module[\"_Tile\"]=Module[\"asm\"][\"La\"]).apply(null,arguments)};var _TopK=Module[\"_TopK\"]=function(){return(_TopK=Module[\"_TopK\"]=Module[\"asm\"][\"Ma\"]).apply(null,arguments)};var _Transform=Module[\"_Transform\"]=function(){return(_Transform=Module[\"_Transform\"]=Module[\"asm\"][\"Na\"]).apply(null,arguments)};var _Transpose=Module[\"_Transpose\"]=function(){return(_Transpose=Module[\"_Transpose\"]=Module[\"asm\"][\"Oa\"]).apply(null,arguments)};var __FusedMatMul=Module[\"__FusedMatMul\"]=function(){return(__FusedMatMul=Module[\"__FusedMatMul\"]=Module[\"asm\"][\"Pa\"]).apply(null,arguments)};var _malloc=Module[\"_malloc\"]=function(){return(_malloc=Module[\"_malloc\"]=Module[\"asm\"][\"Qa\"]).apply(null,arguments)};var _free=Module[\"_free\"]=function(){return(_free=Module[\"_free\"]=Module[\"asm\"][\"Ra\"]).apply(null,arguments)};var ___errno_location=Module[\"___errno_location\"]=function(){return(___errno_location=Module[\"___errno_location\"]=Module[\"asm\"][\"Sa\"]).apply(null,arguments)};var stackSave=Module[\"stackSave\"]=function(){return(stackSave=Module[\"stackSave\"]=Module[\"asm\"][\"Ta\"]).apply(null,arguments)};var stackRestore=Module[\"stackRestore\"]=function(){return(stackRestore=Module[\"stackRestore\"]=Module[\"asm\"][\"Ua\"]).apply(null,arguments)};var stackAlloc=Module[\"stackAlloc\"]=function(){return(stackAlloc=Module[\"stackAlloc\"]=Module[\"asm\"][\"Va\"]).apply(null,arguments)};Module[\"cwrap\"]=cwrap;var calledRun;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}run();\n\n\n return WasmBackendModule.ready\n}\n);\n})();\nif (typeof exports === 'object' && typeof module === 'object')\n module.exports = WasmBackendModule;\nelse if (typeof define === 'function' && define['amd'])\n define([], function() { return WasmBackendModule; });\nelse if (typeof exports === 'object')\n exports[\"WasmBackendModule\"] = WasmBackendModule;\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Backend, DataId} from '../tensor';\nimport {BackendValues, DataType} from '../types';\n\nexport const EPSILON_FLOAT32 = 1e-7;\nexport const EPSILON_FLOAT16 = 1e-4;\n\n// Required information for all backends.\nexport interface BackendTimingInfo {\n kernelMs: number|{error: string};\n getExtraProfileInfo?(): string; // a field for additional timing information\n // e.g. packing / unpacking for WebGL backend\n}\n\nexport interface TensorStorage {\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n disposeData(dataId: DataId, force?: boolean): boolean;\n write(values: BackendValues, shape: number[], dtype: DataType): DataId;\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void;\n memory(): {unreliable: boolean;}; // Backend-specific information.\n /** Returns number of data ids currently in the storage. */\n numDataIds(): number;\n refCount(dataId: DataId): number;\n}\n\n/** Convenient class for storing tensor-related data. */\nexport class DataStorage {\n private data = new WeakMap();\n private dataIdsCount = 0;\n\n constructor(private backend: KernelBackend, private dataMover: DataMover) {}\n\n get(dataId: DataId) {\n if (!this.data.has(dataId)) {\n this.dataMover.moveData(this.backend, dataId);\n }\n return this.data.get(dataId);\n }\n\n set(dataId: DataId, value: T): void {\n this.dataIdsCount++;\n this.data.set(dataId, value);\n }\n\n has(dataId: DataId): boolean {\n return this.data.has(dataId);\n }\n\n delete(dataId: DataId): boolean {\n this.dataIdsCount--;\n return this.data.delete(dataId);\n }\n\n numDataIds(): number {\n return this.dataIdsCount;\n }\n}\n\nexport interface DataMover {\n /**\n * To be called by backends whenever they see a dataId that they don't own.\n * Upon calling this method, the mover will fetch the tensor from another\n * backend and register it with the current active backend.\n */\n moveData(backend: KernelBackend, dataId: DataId): void;\n}\n\nexport interface BackendTimer {\n // check if backend timer is available\n timerAvailable(): boolean;\n time(f: () => void): Promise;\n}\n\n/**\n * The interface that defines the kernels that should be implemented when\n * adding a new backend. New backends don't need to implement every one of the\n * methods, this can be done gradually (throw an error for unimplemented\n * methods).\n */\nexport class KernelBackend implements TensorStorage, Backend, BackendTimer {\n refCount(dataId: DataId): number {\n return notYetImplemented('refCount');\n }\n incRef(dataId: DataId): void {\n return notYetImplemented('incRef');\n }\n timerAvailable(): boolean {\n return true;\n }\n time(f: () => void): Promise {\n return notYetImplemented('time');\n }\n read(dataId: object): Promise {\n return notYetImplemented('read');\n }\n readSync(dataId: object): BackendValues {\n return notYetImplemented('readSync');\n }\n numDataIds(): number {\n return notYetImplemented('numDataIds');\n }\n disposeData(dataId: object, force?: boolean): boolean {\n return notYetImplemented('disposeData');\n }\n write(values: BackendValues, shape: number[], dtype: DataType): DataId {\n return notYetImplemented('write');\n }\n move(\n dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,\n refCount: number): void {\n return notYetImplemented('move');\n }\n memory(): {unreliable: boolean; reasons?: string[]} {\n return notYetImplemented('memory');\n }\n /** Returns the highest precision for floats in bits (e.g. 16 or 32) */\n floatPrecision(): 16|32 {\n return notYetImplemented('floatPrecision');\n }\n /** Returns the smallest representable number. */\n epsilon(): number {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }\n dispose(): void {\n return notYetImplemented('dispose');\n }\n}\n\nfunction notYetImplemented(kernelName: string): never {\n throw new Error(\n `'${kernelName}' not yet implemented or not found in the registry. ` +\n `This kernel may not be supported by the tfjs backend you have chosen`);\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap, FlatVector, NumericDataType, RecursiveArray, TensorLike, TypedArray} from './types';\n\n/**\n * Shuffles the array in-place using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1, 2, 3, 4, 5];\n * tf.util.shuffle(a);\n * console.log(a);\n * ```\n *\n * @param array The array to shuffle in-place.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n swap(array, counter, index);\n }\n}\n\n/**\n * Shuffles two arrays in-place the same way using Fisher-Yates algorithm.\n *\n * ```js\n * const a = [1,2,3,4,5];\n * const b = [11,22,33,44,55];\n * tf.util.shuffleCombo(a, b);\n * console.log(a, b);\n * ```\n *\n * @param array The first array to shuffle in-place.\n * @param array2 The second array to shuffle in-place with the same permutation\n * as the first array.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function shuffleCombo(\n // tslint:disable-next-line:no-any\n array: any[]|Uint32Array|Int32Array|Float32Array,\n // tslint:disable-next-line:no-any\n array2: any[]|Uint32Array|Int32Array|Float32Array): void {\n if (array.length !== array2.length) {\n throw new Error(\n `Array sizes must match to be shuffled together ` +\n `First array length was ${array.length}` +\n `Second array length was ${array2.length}`);\n }\n let counter = array.length;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element of each array with it\n swap(array, counter, index);\n swap(array2, counter, index);\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\nexport function nearestLargerEven(val: number): number {\n return val % 2 === 0 ? val : val + 1;\n}\n\nexport function swap(\n object: {[index: number]: T}, left: number, right: number) {\n const temp = object[left];\n object[left] = object[right];\n object[right] = temp;\n}\n\nexport function sum(arr: number[]): number {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}\n\n/**\n * Returns a sample from a uniform [a, b) distribution.\n *\n * @param a The minimum support (inclusive).\n * @param b The maximum support (exclusive).\n * @return A pseudorandom number on the half-open interval [a,b).\n */\nexport function randUniform(a: number, b: number) {\n const r = Math.random();\n return (b * r) + (1 - r) * a;\n}\n\n/** Returns the squared Euclidean distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\n/**\n * Asserts that the expression is true. Otherwise throws an error with the\n * provided message.\n *\n * ```js\n * const x = 2;\n * tf.util.assert(x === 2, 'x is not 2');\n * ```\n *\n * @param expr The expression to assert (as a boolean).\n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance reasons.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n () => `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\n/**\n * Flattens an arbitrarily nested array.\n *\n * ```js\n * const a = [[1, 2], [3, 4], [5, [6, [7]]]];\n * const flat = tf.util.flatten(a);\n * console.log(flat);\n * ```\n *\n * @param arr The nested array to flatten.\n * @param result The destination array which holds the elements.\n * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults\n * to false.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function\nflatten|TypedArray>(\n arr: T|RecursiveArray, result: T[] = [], skipTypedArray = false): T[] {\n if (result == null) {\n result = [];\n }\n if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], result, skipTypedArray);\n }\n } else {\n result.push(arr as T);\n }\n return result;\n}\n\n/**\n * Returns the size (number of elements) of the tensor given its shape.\n *\n * ```js\n * const shape = [3, 4, 2];\n * const size = tf.util.sizeFromShape(shape);\n * console.log(size);\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1 === n2) {\n return true;\n }\n if (n1 == null || n2 == null) {\n return false;\n }\n\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\n\n/**\n * Creates a new array with randomized indicies to a given quantity.\n *\n * ```js\n * const randomTen = tf.util.createShuffledIndices(10);\n * console.log(randomTen);\n * ```\n *\n * @param number Quantity of how many shuffled indicies to create.\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] >= 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found -1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] < 0) {\n throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (shapeProd === 0) {\n throw Error(\n `Cannot infer the missing size in [${shape}] when ` +\n `there are 0 elements`);\n }\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () =>\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(ax => isInt(ax)),\n () => `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ?\n null :\n parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function getArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else if (dtype === 'string') {\n values = new Array<'string'>(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values as DataTypeMap[D];\n}\n\nexport function checkConversionForErrors(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`);\n }\n }\n}\n\n/** Returns true if the dtype is valid. */\nexport function isValidDtype(dtype: DataType): boolean {\n return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' ||\n dtype === 'int32' || dtype === 'string';\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'complex64') {\n return false;\n }\n if (newType === 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nexport function isTypedArray(a: {}): a is Float32Array|Int32Array|Uint8Array {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'complex64') {\n return 8;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\n/**\n * Returns the approximate number of bytes allocated in the string array - 2\n * bytes per character. Computing the exact bytes for a native string in JS is\n * not possible since it depends on the encoding of the html page that serves\n * the website.\n */\nexport function bytesFromStringArray(arr: Uint8Array[]): number {\n if (arr == null) {\n return 0;\n }\n let bytes = 0;\n arr.forEach(x => bytes += x.length);\n return bytes;\n}\n\n/** Returns true if the value is a string. */\nexport function isString(value: {}): value is string {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport function isBoolean(value: {}): boolean {\n return typeof value === 'boolean';\n}\n\nexport function isNumber(value: {}): boolean {\n return typeof value === 'number';\n}\n\nexport function inferDtype(values: TensorLike): DataType {\n if (Array.isArray(values)) {\n return inferDtype(values[0]);\n }\n if (values instanceof Float32Array) {\n return 'float32';\n } else if (values instanceof Int32Array || values instanceof Uint8Array) {\n return 'int32';\n } else if (isNumber(values)) {\n return 'float32';\n } else if (isString(values)) {\n return 'string';\n } else if (isBoolean(values)) {\n return 'bool';\n }\n return 'float32';\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nfunction createNestedArray(\n offset: number, shape: number[], a: TypedArray, isComplex = false) {\n const ret = new Array();\n if (shape.length === 1) {\n const d = shape[0] * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = a[offset + i];\n }\n } else {\n const d = shape[0];\n const rest = shape.slice(1);\n const len = rest.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n for (let i = 0; i < d; i++) {\n ret[i] = createNestedArray(offset + i * len, rest, a, isComplex);\n }\n }\n return ret;\n}\n\n// Provide a nested array of TypedArray in given shape.\nexport function toNestedArray(\n shape: number[], a: TypedArray, isComplex = false) {\n if (shape.length === 0) {\n // Scalar type should return a single number.\n return a[0];\n }\n const size = shape.reduce((acc, c) => acc * c) * (isComplex ? 2 : 1);\n if (size === 0) {\n // A tensor with shape zero should be turned into empty list.\n return [];\n }\n if (size !== a.length) {\n throw new Error(`[${shape}] does not match the input size ${a.length}${\n isComplex ? ' for a complex tensor' : ''}.`);\n }\n\n return createNestedArray(0, shape, a, isComplex);\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(size) as DataTypeMap[D];\n } else if (dtype === 'int32') {\n return new Int32Array(size) as DataTypeMap[D];\n } else if (dtype === 'bool') {\n return new Uint8Array(size) as DataTypeMap[D];\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Make nested `TypedArray` filled with zeros.\n * @param shape The shape information for the nested array.\n * @param dtype dtype of the array element.\n */\nexport function makeZerosNestedTypedArray(\n shape: number[], dtype: D) {\n const size = shape.reduce((prev, curr) => prev * curr, 1);\n if (dtype == null || dtype === 'float32') {\n return toNestedArray(shape, new Float32Array(size));\n } else if (dtype === 'int32') {\n return toNestedArray(shape, new Int32Array(size));\n } else if (dtype === 'bool') {\n return toNestedArray(shape, new Uint8Array(size));\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function assertNonNegativeIntegerDimensions(shape: number[]) {\n shape.forEach(dimSize => {\n assert(\n Number.isInteger(dimSize) && dimSize >= 0,\n () =>\n `Tensor must have a shape comprised of positive integers but got ` +\n `shape [${shape}].`);\n });\n}\n\n/**\n * Computes flat index for a given location (multidimentionsal index) in a\n * Tensor/multidimensional array.\n *\n * @param locs Location in the tensor.\n * @param rank Rank of the tensor.\n * @param strides Tensor strides.\n */\nexport function locToIndex(\n locs: number[], rank: number, strides: number[]): number {\n if (rank === 0) {\n return 0;\n } else if (rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += strides[i] * locs[i];\n }\n return index;\n}\n\n/**\n * Computes the location (multidimensional index) in a tensor/multidimentional\n * array for a given flat index.\n *\n * @param index Index in flat array.\n * @param rank Rank of tensor.\n * @param strides Strides of tensor.\n */\nexport function indexToLoc(\n index: number, rank: number, strides: number[]): number[] {\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(rank);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / strides[i]);\n index -= locs[i] * strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n}\n\n/**\n * This method asserts whether an object is a Promise instance.\n * @param object\n */\n// tslint:disable-next-line: no-any\nexport function isPromise(object: any) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\n\nexport function warn(...msg: Array<{}>): void {\n if (!(env().getBool('IS_TEST') || env().getBool('PROD'))) {\n console.warn(...msg);\n }\n}\n\nexport function log(...msg: Array<{}>): void {\n if (!(env().getBool('IS_TEST') || env().getBool('PROD'))) {\n console.log(...msg);\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Platform} from './platforms/platform';\nimport {isPromise} from './util_base';\nimport * as log from './log';\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\n\ntype FlagValue = number|boolean;\ntype FlagEvaluationFn = (() => FlagValue)|(() => Promise);\nexport type Flags = {\n [featureName: string]: FlagValue\n};\nexport type FlagRegistryEntry = {\n evaluationFn: FlagEvaluationFn;\n setHook?: (value: FlagValue) => void;\n};\n\n/**\n * The environment contains evaluated flags as well as the registered platform.\n * This is always used as a global singleton and can be retrieved with\n * `tf.env()`.\n *\n * @doc {heading: 'Environment'}\n */\nexport class Environment {\n private flags: Flags = {};\n private flagRegistry: {[flagName: string]: FlagRegistryEntry} = {};\n\n private urlFlags: Flags = {};\n\n platformName: string;\n platform: Platform;\n\n // Jasmine spies on this in 'environment_test.ts'\n getQueryParams = getQueryParams;\n\n // tslint:disable-next-line: no-any\n constructor(public global: any) {\n this.populateURLFlags();\n }\n\n setPlatform(platformName: string, platform: Platform) {\n if (this.platform != null) {\n log.warn(\n `Platform ${this.platformName} has already been set. ` +\n `Overwriting the platform with ${platform}.`);\n }\n this.platformName = platformName;\n this.platform = platform;\n }\n\n registerFlag(\n flagName: string, evaluationFn: FlagEvaluationFn,\n setHook?: (value: FlagValue) => void) {\n this.flagRegistry[flagName] = {evaluationFn, setHook};\n\n // Override the flag value from the URL. This has to happen here because the\n // environment is initialized before flags get registered.\n if (this.urlFlags[flagName] != null) {\n const flagValue = this.urlFlags[flagName];\n log.warn(\n `Setting feature override from URL ${flagName}: ${flagValue}.`);\n this.set(flagName, flagValue);\n }\n }\n\n async getAsync(flagName: string): Promise {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n this.flags[flagName] = await this.evaluateFlag(flagName);\n return this.flags[flagName];\n }\n\n get(flagName: string): FlagValue {\n if (flagName in this.flags) {\n return this.flags[flagName];\n }\n\n const flagValue = this.evaluateFlag(flagName);\n if (isPromise(flagValue)) {\n throw new Error(\n `Flag ${flagName} cannot be synchronously evaluated. ` +\n `Please use getAsync() instead.`);\n }\n\n this.flags[flagName] = flagValue as number | boolean;\n\n return this.flags[flagName];\n }\n\n getNumber(flagName: string): number {\n return this.get(flagName) as number;\n }\n\n getBool(flagName: string): boolean {\n return this.get(flagName) as boolean;\n }\n\n getFlags(): Flags {\n return this.flags;\n }\n // For backwards compatibility.\n get features(): Flags {\n return this.flags;\n }\n\n set(flagName: string, value: FlagValue): void {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot set flag ${flagName} as it has not been registered.`);\n }\n this.flags[flagName] = value;\n if (this.flagRegistry[flagName].setHook != null) {\n this.flagRegistry[flagName].setHook(value);\n }\n }\n\n private evaluateFlag(flagName: string): FlagValue|Promise {\n if (this.flagRegistry[flagName] == null) {\n throw new Error(\n `Cannot evaluate flag '${flagName}': no evaluation function found.`);\n }\n return this.flagRegistry[flagName].evaluationFn();\n }\n\n setFlags(flags: Flags) {\n this.flags = Object.assign({}, flags);\n }\n\n reset() {\n this.flags = {};\n this.urlFlags = {};\n this.populateURLFlags();\n }\n\n private populateURLFlags(): void {\n if (typeof this.global === 'undefined' ||\n typeof this.global.location === 'undefined' ||\n typeof this.global.location.search === 'undefined') {\n return;\n }\n\n const urlParams = this.getQueryParams(this.global.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n this.urlFlags[key] = parseValue(key, value);\n });\n }\n }\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n\nfunction parseValue(flagName: string, value: string): FlagValue {\n value = value.toLowerCase();\n if (value === 'true' || value === 'false') {\n return value === 'true';\n } else if (`${+ value}` === value) {\n return +value;\n }\n throw new Error(\n `Could not parse value flag value ${value} for flag ${flagName}.`);\n}\n\n/**\n * Returns the current environment (a global singleton).\n *\n * The environment object contains the evaluated feature values as well as the\n * active platform.\n *\n * @doc {heading: 'Environment'}\n */\nexport function env() {\n return ENV;\n}\n\nexport let ENV: Environment = null;\nexport function setEnvironmentGlobal(environment: Environment) {\n ENV = environment;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Note that the identifier globalNameSpace is scoped to this module, but will\n// always resolve to the same global object regardless of how the module is\n// resolved.\n// tslint:disable-next-line:no-any\nlet globalNameSpace: {_tfGlobals: Map};\n// tslint:disable-next-line:no-any\nexport function getGlobalNamespace(): {_tfGlobals: Map} {\n if (globalNameSpace == null) {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (global) !== 'undefined') {\n ns = global;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else if (typeof (self) !== 'undefined') {\n ns = self;\n } else {\n throw new Error('Could not find a global object');\n }\n globalNameSpace = ns;\n }\n return globalNameSpace;\n}\n\n// tslint:disable-next-line:no-any\nfunction getGlobalMap(): Map {\n const ns = getGlobalNamespace();\n if (ns._tfGlobals == null) {\n ns._tfGlobals = new Map();\n }\n return ns._tfGlobals;\n}\n\n/**\n * Returns a globally accessible 'singleton' object.\n *\n * @param key the name of the object\n * @param init a function to initialize to initialize this object\n * the first time it is fetched.\n */\nexport function getGlobal(key: string, init: () => T): T {\n const globalMap = getGlobalMap();\n if (globalMap.has(key)) {\n return globalMap.get(key);\n } else {\n const singleton = init();\n globalMap.set(key, singleton);\n return globalMap.get(key);\n }\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Allow UpperCamelCase variable names\n// tslint:disable: variable-name\n// Unfortunately just enabling PascalCase per file (tslint:enable:\n// allow-pascal-case) doesn't work.\nimport {NamedTensorInfoMap, TensorInfo} from './kernel_registry';\nimport {ExplicitPadding} from './ops/conv_util';\nimport {Activation} from './ops/fused_types';\nimport {DataType, PixelData} from './types';\n\nexport const Abs = 'Abs';\nexport type AbsInputs = UnaryInputs;\n\nexport const Acos = 'Acos';\nexport type AcosInputs = UnaryInputs;\n\nexport const Acosh = 'Acosh';\nexport type AcoshInputs = UnaryInputs;\n\nexport const Add = 'Add';\nexport type AddInputs = BinaryInputs;\n\nexport const AddN = 'AddN';\nexport type AddNInputs = TensorInfo[];\n\nexport const All = 'All';\nexport type AllInputs = Pick;\nexport interface AllAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Any = 'Any';\nexport type AnyInputs = Pick;\nexport interface AnyAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const ArgMax = 'ArgMax';\nexport type ArgMaxInputs = Pick;\nexport interface ArgMaxAttrs {\n axis: number;\n}\n\nexport const ArgMin = 'ArgMin';\nexport type ArgMinInputs = Pick;\nexport interface ArgMinAttrs {\n axis: number;\n}\n\nexport const Asin = 'Asin';\nexport type AsinInputs = UnaryInputs;\n\nexport const Asinh = 'Asinh';\nexport type AsinhInputs = UnaryInputs;\n\nexport const Atan = 'Atan';\nexport type AtanInputs = UnaryInputs;\n\nexport const Atanh = 'Atanh';\nexport type AtanhInputs = UnaryInputs;\n\nexport const Atan2 = 'Atan2';\nexport type Atan2Inputs = BinaryInputs;\n\nexport const AvgPool = 'AvgPool';\nexport type AvgPoolInputs = Pick;\nexport interface AvgPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const AvgPoolGrad = 'AvgPoolGrad';\nexport type AvgPoolGradInputs = Pick;\nexport interface AvgPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n}\n\nexport const AvgPool3D = 'AvgPool3D';\nexport type AvgPool3DInputs = Pick;\nexport interface AvgPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n dataFormat: 'NDHWC'|'NCDHW';\n}\n\nexport const AvgPool3DGrad = 'AvgPool3DGrad';\nexport type AvgPool3DGradInputs = Pick;\nexport interface AvgPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const BatchMatMul = 'BatchMatMul';\nexport type BatchMatMulInputs = Pick;\nexport interface BatchMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n}\n\nexport const BatchToSpaceND = 'BatchToSpaceND';\nexport type BatchToSpaceNDInputs = Pick;\nexport interface BatchToSpaceNDAttrs {\n blockShape: number[];\n crops: number[][];\n}\n\nexport type BinaryInputs = Pick;\n\nexport const Bincount = 'Bincount';\nexport type BincountInputs = Pick;\nexport interface BincountAttrs {\n size: number;\n}\n\nexport const BroadcastTo = 'BroadcastTo';\nexport type BroadcastToInputs = Pick;\nexport interface BroadCastToAttrs {\n shape: number[];\n inputShape: number[]; // for gradient\n}\n\nexport const BroadcastArgs = 'BroadcastArgs';\nexport type BroadcastArgsInputs = Pick;\n\nexport const Cast = 'Cast';\nexport type CastInputs = UnaryInputs;\nexport interface CastAttrs {\n dtype: DataType;\n}\n\nexport const Ceil = 'Ceil';\nexport type CeilInputs = UnaryInputs;\n\nexport const ClipByValue = 'ClipByValue';\nexport type ClipByValueInputs = UnaryInputs;\nexport interface ClipByValueAttrs {\n clipValueMin: number;\n clipValueMax: number;\n}\n\nexport const Complex = 'Complex';\nexport type ComplexInputs = Pick;\n\nexport const ComplexAbs = 'ComplexAbs';\nexport type ComplexAbsInputs = UnaryInputs;\n\nexport const Concat = 'Concat';\nexport type ConcatInputs = TensorInfo[];\nexport interface ConcatAttrs {\n axis: number;\n}\n\nexport const Conv2D = 'Conv2D';\nexport type Conv2DInputs = Pick;\nexport interface Conv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const Conv2DBackpropFilter = 'Conv2DBackpropFilter';\nexport type Conv2DBackpropFilterInputs = Pick;\nexport interface Conv2DBackpropFilterAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const Conv2DBackpropInput = 'Conv2DBackpropInput';\nexport type Conv2DBackpropInputInputs = Pick;\nexport interface Conv2DBackpropInputAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Conv3D = 'Conv3D';\nexport type Conv3DInputs = Pick;\nexport interface Conv3DAttrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n dataFormat: 'NDHWC'|'NCDHW';\n dilations: [number, number, number]|number;\n}\n\nexport const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2';\nexport type Conv3DBackpropFilterV2Inputs = Pick;\n\nexport interface Conv3DBackpropFilterV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n filterShape: [number, number, number, number, number];\n}\n\nexport const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2';\nexport type Conv3DBackpropInputV2Inputs =\n Pick;\nexport interface Conv3DBackpropInputV2Attrs {\n strides: [number, number, number]|number;\n pad: 'valid'|'same';\n inputShape: [number, number, number, number, number];\n}\n\nexport const Cos = 'Cos';\nexport type CosInputs = UnaryInputs;\n\nexport const Cosh = 'Cosh';\nexport type CoshInputs = UnaryInputs;\n\nexport const Cumsum = 'Cumsum';\nexport type CumsumInputs = Pick;\nexport interface CumsumAttrs {\n axis: number;\n exclusive: boolean;\n reverse: boolean;\n}\n\nexport const CropAndResize = 'CropAndResize';\nexport type CropAndResizeInputs =\n Pick;\nexport interface CropAndResizeAttrs {\n cropSize: [number, number];\n method: 'bilinear'|'nearest';\n extrapolationValue: number;\n}\n\nexport const DenseBincount = 'DenseBincount';\nexport type DenseBincountInputs = Pick;\nexport interface DenseBincountAttrs {\n size: number;\n binaryOutput?: boolean;\n}\n\nexport const DepthToSpace = 'DepthToSpace';\nexport type DepthToSpaceInputs = Pick;\nexport interface DepthToSpaceAttrs {\n blockSize: number;\n dataFormat: 'NHWC'|'NCHW';\n}\n\nexport const DepthwiseConv2dNative = 'DepthwiseConv2dNative';\nexport type DepthwiseConv2dNativeInputs =\n Pick;\nexport interface DepthwiseConv2dNativeAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const DepthwiseConv2dNativeBackpropFilter =\n 'DepthwiseConv2dNativeBackpropFilter';\nexport type DepthwiseConv2dNativeBackpropFilterInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropFilterAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n filterShape: [number, number, number, number];\n}\n\nexport const DepthwiseConv2dNativeBackpropInput =\n 'DepthwiseConv2dNativeBackpropInput';\nexport type DepthwiseConv2dNativeBackpropInputInputs =\n Pick;\nexport interface DepthwiseConv2dNativeBackpropInputAttrs {\n strides: [number, number]|number;\n dilations: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n inputShape: [number, number, number, number];\n}\n\nexport const Diag = 'Diag';\nexport type DiagInputs = Pick;\n\nexport const Dilation2D = 'Dilation2D';\nexport type Dilation2DInputs = Pick;\nexport interface Dilation2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n dilations: [number, number]|number;\n}\n\nexport const Dilation2DBackpropInput = 'Dilation2DBackpropInput';\nexport type Dilation2DBackpropInputInputs =\n Pick;\n\nexport const Dilation2DBackpropFilter = 'Dilation2DBackpropFilter';\nexport type Dilation2DBackpropFilterInputs =\n Pick;\n\nexport const RealDiv = 'RealDiv';\nexport type RealDivInputs = BinaryInputs;\n\nexport const Einsum = 'Einsum';\nexport type EinsumInputs = TensorInfo[];\nexport interface EinsumAttrs {\n equation: string;\n}\n\nexport const Elu = 'Elu';\nexport type EluInputs = Pick;\n\nexport const EluGrad = 'EluGrad';\nexport type EluGradInputs = Pick;\n\nexport const Erf = 'Erf';\nexport type ErfInputs = UnaryInputs;\n\nexport const Equal = 'Equal';\nexport type EqualInputs = BinaryInputs;\n\nexport const Exp = 'Exp';\nexport type ExpInputs = UnaryInputs;\n\nexport const ExpandDims = 'ExpandDims';\nexport type ExpandDimsInputs = Pick;\nexport interface ExpandDimsAttrs {\n dim: number;\n}\n\nexport const Expm1 = 'Expm1';\nexport type Expm1Inputs = UnaryInputs;\n\nexport const FFT = 'FFT';\nexport type FFTInputs = Pick;\n\nexport const Fill = 'Fill';\nexport interface FillAttrs {\n shape: number[];\n value: number|string;\n dtype: DataType;\n}\n\nexport const FlipLeftRight = 'FlipLeftRight';\nexport type FlipLeftRightInputs = Pick;\n\nexport const Floor = 'Floor';\nexport type FloorInputs = UnaryInputs;\n\nexport const FloorDiv = 'FloorDiv';\nexport type FloorDivInputs = BinaryInputs;\n\nexport const FusedBatchNorm = 'FusedBatchNorm';\nexport type FusedBatchNormInputs =\n Pick;\nexport interface FusedBatchNormAttrs {\n varianceEpsilon: number;\n}\n\nexport const GatherV2 = 'GatherV2';\nexport type GatherV2Inputs = Pick;\nexport interface GatherV2Attrs {\n axis: number;\n batchDims: number;\n}\n\nexport const GatherNd = 'GatherNd';\nexport type GatherNdInputs = Pick;\n\nexport const Greater = 'Greater';\nexport type GreaterInputs = BinaryInputs;\n\nexport const GreaterEqual = 'GreaterEqual';\nexport type GreaterEqualInputs = BinaryInputs;\n\nexport const Identity = 'Identity';\nexport type IdentityInputs = Pick;\n\nexport const IFFT = 'IFFT';\nexport type IFFTInputs = Pick;\n\nexport const Imag = 'Imag';\nexport type ImagInputs = Pick;\n\nexport const IsFinite = 'IsFinite';\nexport type IsFiniteInputs = UnaryInputs;\n\nexport const IsInf = 'IsInf';\nexport type IsInfInputs = UnaryInputs;\n\nexport const IsNan = 'IsNan';\nexport type IsNanInputs = UnaryInputs;\n\nexport const LeakyRelu = 'LeakyRelu';\nexport type LeakyReluInputs = Pick;\nexport interface LeakyReluAttrs {\n alpha: number;\n}\n\nexport const Less = 'Less';\nexport type LessInputs = BinaryInputs;\n\nexport const LessEqual = 'LessEqual';\nexport type LessEqualInputs = BinaryInputs;\n\nexport const LinSpace = 'LinSpace';\nexport interface LinSpaceAttrs {\n start: number;\n stop: number;\n num: number;\n}\nexport const Log = 'Log';\nexport type LogInputs = UnaryInputs;\n\nexport const Log1p = 'Log1p';\nexport type Log1pInputs = UnaryInputs;\n\nexport const LogicalAnd = 'LogicalAnd';\nexport type LogicalAndInputs = BinaryInputs;\n\nexport const LogicalNot = 'LogicalNot';\nexport type LogicalNotInputs = Pick;\n\nexport const LogicalOr = 'LogicalOr';\nexport type LogicalOrInputs = BinaryInputs;\n\nexport const LogSoftmax = 'LogSoftmax';\nexport type LogSoftmaxInputs = Pick;\nexport interface LogSoftmaxAttrs {\n axis: number;\n}\n\nexport const LRN = 'LRN';\nexport type LRNInputs = Pick;\nexport interface LRNAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const LRNGrad = 'LRNGrad';\nexport type LRNGradInputs = Pick;\nexport interface LRNGradAttrs {\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n}\n\nexport const Max = 'Max';\nexport type MaxInputs = Pick;\nexport interface MaxAttrs {\n reductionIndices: number|number[];\n keepDims: boolean;\n}\n\nexport const Maximum = 'Maximum';\nexport type MaximumInputs = BinaryInputs;\n\nexport const MaxPool = 'MaxPool';\nexport type MaxPoolInputs = Pick;\nexport interface MaxPoolAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolGrad = 'MaxPoolGrad';\nexport type MaxPoolGradInputs = Pick;\nexport interface MaxPoolGradAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3D = 'MaxPool3D';\nexport type MaxPool3DInputs = Pick;\nexport interface MaxPool3DAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dataFormat: 'NDHWC'|'NCDHW';\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPool3DGrad = 'MaxPool3DGrad';\nexport type MaxPool3DGradInputs =\n Pick;\nexport interface MaxPool3DGradAttrs {\n filterSize: [number, number, number]|number;\n strides: [number, number, number]|number;\n pad: 'valid'|'same'|number;\n dimRoundingMode?: 'floor'|'round'|'ceil';\n}\n\nexport const MaxPoolWithArgmax = 'MaxPoolWithArgmax';\nexport type MaxPoolWithArgmaxInputs = Pick;\nexport interface MaxPoolWithArgmaxAttrs {\n filterSize: [number, number]|number;\n strides: [number, number]|number;\n pad: 'valid'|'same'|number;\n includeBatchInIndex: boolean;\n}\n\nexport const Mean = 'Mean';\nexport type MeanInputs = Pick;\nexport interface MeanAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Min = 'Min';\nexport type MinInputs = Pick;\nexport interface MinAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Minimum = 'Minimum';\nexport type MinimumInputs = BinaryInputs;\n\nexport const MirrorPad = 'MirrorPad';\nexport type MirrorPadInputs = Pick;\nexport interface MirrorPadAttrs {\n paddings: Array<[number, number]>;\n mode: 'reflect'|'symmetric';\n}\n\nexport const Mod = 'Mod';\nexport type ModInputs = BinaryInputs;\n\nexport const Multinomial = 'Multinomial';\nexport type MultinomialInputs = Pick;\nexport interface MultinomialAttrs {\n numSamples: number;\n seed: number;\n normalized: boolean;\n}\n\nexport const Multiply = 'Multiply';\nexport type MultiplyInputs = BinaryInputs;\n\nexport const Neg = 'Neg';\nexport type NegInputs = UnaryInputs;\n\nexport const NotEqual = 'NotEqual';\nexport type NotEqualInputs = BinaryInputs;\n\nexport const NonMaxSuppressionV3 = 'NonMaxSuppressionV3';\nexport type NonMaxSuppressionV3Inputs =\n Pick;\nexport interface NonMaxSuppressionV3Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n}\n\nexport const NonMaxSuppressionV4 = 'NonMaxSuppressionV4';\nexport type NonMaxSuppressionV4Inputs =\n Pick;\nexport interface NonMaxSuppressionV4Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n padToMaxOutputSize: boolean;\n}\n\nexport const NonMaxSuppressionV5 = 'NonMaxSuppressionV5';\nexport type NonMaxSuppressionV5Inputs =\n Pick;\nexport interface NonMaxSuppressionV5Attrs {\n maxOutputSize: number;\n iouThreshold: number;\n scoreThreshold: number;\n softNmsSigma: number;\n}\n\nexport const OnesLike = 'OnesLike';\nexport type OnesLikeInputs = UnaryInputs;\n\nexport const OneHot = 'OneHot';\nexport type OneHotInputs = Pick;\nexport interface OneHotAttrs {\n depth: number;\n onValue: number;\n offValue: number;\n}\n\nexport const Pack = 'Pack';\nexport type PackInputs = TensorInfo[];\nexport interface PackAttrs {\n axis: number;\n}\n\nexport const PadV2 = 'PadV2';\nexport type PadV2Inputs = Pick;\nexport interface PadV2Attrs {\n paddings: Array<[number, number]>;\n constantValue: number;\n}\n\nexport const Pool = 'Pool';\nexport type PoolInputs = Pick;\n\nexport const Pow = 'Pow';\nexport type PowInputs = BinaryInputs;\n\nexport const Prelu = 'Prelu';\nexport type PreluInputs = Pick;\n\nexport const Prod = 'Prod';\nexport type ProdInputs = Pick;\nexport interface ProdAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const Range = 'Range';\nexport interface RangeAttrs {\n start: number;\n stop: number;\n step: number;\n dtype: 'float32'|'int32';\n}\n\nexport const Real = 'Real';\nexport type RealInputs = Pick;\n\nexport const Reciprocal = 'Reciprocal';\nexport type ReciprocalInputs = UnaryInputs;\n\nexport const Relu = 'Relu';\nexport type ReluInputs = Pick;\n\nexport const Reshape = 'Reshape';\nexport type ReshapeInputs = Pick;\nexport interface ReshapeAttrs {\n shape: number[];\n}\n\nexport const ResizeNearestNeighbor = 'ResizeNearestNeighbor';\nexport type ResizeNearestNeighborInputs = Pick;\nexport interface ResizeNearestNeighborAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeNearestNeighborGrad = 'ResizeNearestNeighborGrad';\nexport type ResizeNearestNeighborGradInputs =\n Pick;\nexport type ResizeNearestNeighborGradAttrs = ResizeNearestNeighborAttrs;\n\nexport const ResizeBilinear = 'ResizeBilinear';\nexport type ResizeBilinearInputs = Pick;\nexport interface ResizeBilinearAttrs {\n alignCorners: boolean;\n halfPixelCenters: boolean;\n size: [number, number];\n}\n\nexport const ResizeBilinearGrad = 'ResizeBilinearGrad';\nexport type ResizeBilinearGradInputs = Pick;\nexport type ResizeBilinearGradAttrs = ResizeBilinearAttrs;\n\nexport const Relu6 = 'Relu6';\nexport type Relu6Inputs = Pick;\n\nexport const Reverse = 'Reverse';\nexport type ReverseInputs = Pick;\nexport interface ReverseAttrs {\n dims: number|number[];\n}\n\nexport const Round = 'Round';\nexport type RoundInputs = UnaryInputs;\n\nexport const Rsqrt = 'Rsqrt';\nexport type RsqrtInputs = UnaryInputs;\n\nexport const ScatterNd = 'ScatterNd';\nexport type ScatterNdInputs = Pick;\nexport interface ScatterNdAttrs {\n shape: number[];\n}\n\nexport const Select = 'Select';\nexport type SelectInputs = Pick;\n\nexport const Selu = 'Selu';\nexport type SeluInputs = Pick;\n\nexport const Slice = 'Slice';\nexport type SliceInputs = Pick;\nexport interface SliceAttrs {\n begin: number|number[];\n size: number|number[];\n}\nexport const Sin = 'Sin';\nexport type SinInputs = UnaryInputs;\n\nexport const Sinh = 'Sinh';\nexport type SinhInputs = UnaryInputs;\n\nexport const Sign = 'Sign';\nexport type SignInputs = UnaryInputs;\n\nexport const Sigmoid = 'Sigmoid';\nexport type SigmoidInputs = UnaryInputs;\n\nexport const Softplus = 'Softplus';\nexport type SoftplusInputs = UnaryInputs;\n\nexport const Sqrt = 'Sqrt';\nexport type SqrtInputs = UnaryInputs;\n\nexport const Sum = 'Sum';\nexport type SumInputs = Pick;\nexport interface SumAttrs {\n axis: number|number[];\n keepDims: boolean;\n}\n\nexport const SpaceToBatchND = 'SpaceToBatchND';\nexport type SpaceToBatchNDInputs = Pick;\nexport interface SpaceToBatchNDAttrs {\n blockShape: number[];\n paddings: number[][];\n}\n\nexport const SplitV = 'SplitV';\nexport type SplitVInputs = Pick;\nexport interface SplitVAttrs {\n numOrSizeSplits: number[]|number;\n axis: number;\n}\n\nexport const Softmax = 'Softmax';\nexport type SoftmaxInputs = Pick;\nexport interface SoftmaxAttrs {\n dim: number;\n}\n\nexport const SparseFillEmptyRows = 'SparseFillEmptyRows';\nexport type SparseFillEmptyRowsInputs =\n Pick;\n\nexport const SparseReshape = 'SparseReshape';\nexport type SparseReshapeInputs =\n Pick;\n\nexport const SparseSegmentMean = 'SparseSegmentMean';\nexport type SparseSegmentMeanInputs =\n Pick;\n\nexport const SparseSegmentSum = 'SparseSegmentSum';\nexport type SparseSegmentSumInputs =\n Pick;\n\nexport const SparseToDense = 'SparseToDense';\nexport type SparseToDenseInputs =\n Pick;\nexport interface SparseToDenseAttrs {\n outputShape: number[];\n}\n\nexport const SquaredDifference = 'SquaredDifference';\nexport type SquaredDifferenceInputs = BinaryInputs;\n\nexport const Square = 'Square';\nexport type SquareInputs = Pick;\n\nexport const StridedSlice = 'StridedSlice';\nexport type StridedSliceInputs = Pick;\nexport interface StridedSliceAttrs {\n begin: number[];\n end: number[];\n strides: number[];\n beginMask: number;\n endMask: number;\n ellipsisMask: number;\n newAxisMask: number;\n shrinkAxisMask: number;\n}\n\nexport const StringNGrams = 'StringNGrams';\nexport type StringNGramsInputs = Pick;\nexport interface StringNGramsAttrs {\n separator: string;\n nGramWidths: number[];\n leftPad: string;\n rightPad: string;\n padWidth: number;\n preserveShortSequences: boolean;\n}\n\nexport const StringSplit = 'StringSplit';\nexport type StringSplitInputs = Pick;\nexport interface StringSplitAttrs {\n skipEmpty: boolean;\n}\n\nexport const StringToHashBucketFast = 'StringToHashBucketFast';\nexport type StringToHashBucketFastInputs = Pick;\nexport interface StringToHashBucketFastAttrs {\n numBuckets: number;\n}\n\nexport const Sub = 'Sub';\nexport type SubInputs = BinaryInputs;\n\nexport const Tan = 'Tan';\nexport type TanInputs = UnaryInputs;\n\nexport const Tanh = 'Tanh';\nexport type TanhInputs = UnaryInputs;\n\nexport const Tile = 'Tile';\nexport type TileInputs = Pick;\nexport interface TileAttrs {\n reps: number[];\n}\n\nexport const TopK = 'TopK';\nexport type TopKInputs = Pick;\nexport interface TopKAttrs {\n k: number;\n sorted: boolean;\n}\n\nexport const Transform = 'Transform';\nexport type TransformInputs = Pick;\nexport interface TransformAttrs {\n interpolation: 'nearest'|'bilinear';\n fillMode: 'constant'|'reflect'|'wrap'|'nearest';\n fillValue: number;\n outputShape?: [number, number];\n}\n\nexport const Transpose = 'Transpose';\nexport type TransposeInputs = Pick;\nexport interface TransposeAttrs {\n perm: number[];\n}\n\nexport const Unique = 'Unique';\nexport type UniqueInputs = Pick;\nexport interface UniqueAttrs {\n axis: number;\n}\n\nexport type UnaryInputs = Pick;\n\nexport const Unpack = 'Unpack';\nexport type UnpackInputs = Pick;\nexport interface UnpackAttrs {\n axis: number;\n}\n\nexport const UnsortedSegmentSum = 'UnsortedSegmentSum';\nexport type UnsortedSegmentSumInputs =\n Pick;\nexport interface UnsortedSegmentSumAttrs {\n numSegments: number;\n}\n\nexport const ZerosLike = 'ZerosLike';\nexport type ZerosLikeInputs = UnaryInputs;\n\n/**\n * TensorFlow.js-only kernels\n */\nexport const Step = 'Step';\nexport type StepInputs = UnaryInputs;\nexport interface StepAttrs {\n alpha: number;\n}\n\nexport const FromPixels = 'FromPixels';\nexport interface FromPixelsInputs {\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap;\n}\nexport interface FromPixelsAttrs {\n numChannels: number;\n}\n\nexport const RotateWithOffset = 'RotateWithOffset';\nexport type RotateWithOffsetInputs = Pick;\nexport interface RotateWithOffsetAttrs {\n radians: number;\n fillValue: number|[number, number, number];\n center: number|[number, number];\n}\n\nexport const _FusedMatMul = '_FusedMatMul';\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulInputs extends NamedTensorInfoMap {\n a: TensorInfo;\n b: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\n// tslint:disable-next-line: class-name\nexport interface _FusedMatMulAttrs {\n transposeA: boolean;\n transposeB: boolean;\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedConv2D = 'FusedConv2D';\nexport interface FusedConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n\nexport const FusedDepthwiseConv2D = 'FusedDepthwiseConv2D';\nexport interface FusedDepthwiseConv2DInputs extends NamedTensorInfoMap {\n x: TensorInfo;\n filter: TensorInfo;\n bias?: TensorInfo;\n preluActivationWeights?: TensorInfo;\n}\nexport interface FusedDepthwiseConv2DAttrs {\n strides: [number, number]|number;\n pad: 'valid'|'same'|number|ExplicitPadding;\n dataFormat: 'NHWC'|'NCHW';\n dilations: [number, number]|number;\n dimRoundingMode: 'floor'|'round'|'ceil';\n activation: Activation;\n leakyreluAlpha?: number;\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from './environment';\nimport {getGlobal} from './global_util';\nimport * as log from './log';\nimport {NamedGradientMap} from './tape';\nimport {Tensor} from './tensor';\nimport {DataType, RecursiveArray} from './types';\n\nconst kernelRegistry =\n getGlobal('kernelRegistry', () => new Map());\nconst gradRegistry =\n getGlobal('gradRegistry', () => new Map());\n\nexport type DataId = object;\n\ntype AttributeValue =\n number|number[]|boolean|boolean[]|string|string[]|NamedAttrMap;\n\n/** These are extra non-tensor/primitive params passed to kernel functions. */\nexport type Attribute = AttributeValue|RecursiveArray;\n\n/** Specifies the code to run when executing a kernel. */\nexport type KernelFunc = (params: {\n inputs: NamedTensorInfoMap,\n backend: {},\n attrs?: NamedAttrMap,\n}) => TensorInfo|TensorInfo[];\n\n/** The function to run when computing a gradient during backprop. */\nexport type GradFunc =\n (dy: Tensor|Tensor[], saved: Tensor[], attrs: NamedAttrMap) =>\n NamedGradientMap;\n\n/** Function that gets called after the backend initializes. */\nexport type KernelSetupFunc = (backend: {}) => void;\n/** Function that gets called right before the backend is disposed. */\nexport type KernelDisposeFunc = KernelSetupFunc;\n\n/** Config object for registering a kernel in the global registry. */\nexport interface KernelConfig {\n kernelName: string;\n backendName: string;\n kernelFunc: KernelFunc;\n setupFunc?: KernelSetupFunc;\n disposeFunc?: KernelDisposeFunc;\n}\n\n/** Config object for registering a gradient in the global registry. */\nexport interface GradConfig {\n kernelName: string;\n inputsToSave?: string[];\n // When saveAllInputs is true, all inputs will be saved. Only use this flag\n // if inputs is an array of Tensors.\n saveAllInputs?: boolean;\n outputsToSave?: boolean[];\n gradFunc: GradFunc;\n}\n\n/** Holds metadata for a given tensor. */\nexport interface TensorInfo {\n dataId: DataId;\n shape: number[];\n dtype: DataType;\n}\n\nexport interface NamedTensorInfoMap {\n [name: string]: TensorInfo|undefined;\n}\n\nexport interface NamedAttrMap {\n [name: string]: Attribute;\n}\n\n/**\n * Returns the kernel function (code) associated with the provided names.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n */\nexport function getKernel(\n kernelName: string, backendName: string): KernelConfig {\n const key = makeKey(kernelName, backendName);\n return kernelRegistry.get(key);\n}\n\n/**\n * Returns the registered gradient info associated with the provided kernel.\n * @param kernelName The official TF kernel name.\n */\nexport function getGradient(kernelName: string): GradConfig {\n return gradRegistry.get(kernelName);\n}\n\nexport function getKernelsForBackend(backendName: string): KernelConfig[] {\n const it = kernelRegistry.entries();\n const result: KernelConfig[] = [];\n\n while (true) {\n const {done, value} = it.next();\n if (done) {\n break;\n }\n const [key, config] = value;\n const [backend, ] = key.split('_');\n if (backend === backendName) {\n result.push(config);\n }\n }\n return result;\n}\n\n/**\n * Registers the function (forward pass) for the kernel in a global registry.\n *\n * @param config A config object with the following properties:\n * - `kernelName` The official name of the kernel.\n * - `backendName` The official name of the backend.\n * - `kernelFunc` The function to run during the forward pass of the kernel.\n * - `setupFunc` Optional. Gets called once, after the backend initializes.\n * - `disposeFunc` Optional. Gets called once, right before the backend is\n * disposed.\n */\nexport function registerKernel(config: KernelConfig) {\n const {kernelName, backendName} = config;\n const key = makeKey(kernelName, backendName);\n if (kernelRegistry.has(key)) {\n log.warn(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is already registered`);\n }\n kernelRegistry.set(key, config);\n}\n\n/**\n * Registers a gradient function for a given kernel in the global registry,\n * to be used during the back-propagation of that kernel.\n *\n * @param config An object with the following properties:\n * - `kernelName` The name of the kernel that the gradient function is for.\n * - `gradFunc` The function to run during back-propagation.\n */\nexport function registerGradient(config: GradConfig) {\n const {kernelName} = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n log.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}\n\n/**\n * Removes the kernel function from the registry.\n *\n * @param kernelName The official name of the kernel.\n * @param backendName The official name of the backend.\n *\n */\nexport function unregisterKernel(\n kernelName: string, backendName: string): void {\n const key = makeKey(kernelName, backendName);\n if (!kernelRegistry.has(key)) {\n throw new Error(\n `The kernel '${kernelName}' for backend ` +\n `'${backendName}' is not registered`);\n }\n kernelRegistry.delete(key);\n}\n\n/** Removes the registered gradient from the global registry. */\nexport function unregisterGradient(kernelName: string): void {\n if (!gradRegistry.has(kernelName)) {\n throw new Error(\n `The gradient '${kernelName}' for backend is not registered`);\n }\n gradRegistry.delete(kernelName);\n}\n\n/**\n * Finds kernels that have already been registered to a backend and re-registers\n * them for a new backend. Useful for registering custom backends.\n * @param registeredBackendName Already registered backend.\n * @param newBackendName New backend.\n */\nexport function copyRegisteredKernels(\n registeredBackendName: string, newBackendName: string): void {\n const kernels = getKernelsForBackend(registeredBackendName);\n kernels.forEach(kernelConfig => {\n const newKernelConfig =\n Object.assign({}, kernelConfig, {backendName: newBackendName});\n registerKernel(newKernelConfig);\n });\n}\n\nfunction makeKey(kernelName: string, backendName: string) {\n return `${backendName}_${kernelName}`;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from './environment';\nimport {BackendValues, DataType, TensorLike, TypedArray} from './types';\nimport * as base from './util_base';\nexport * from './util_base';\nexport * from './hash_util';\n\n/**\n * Create typed array for scalar value. Used for storing in `DataStorage`.\n */\nexport function createScalarValue(\n value: DataType, dtype: DataType): BackendValues {\n if (dtype === 'string') {\n return encodeString(value);\n }\n\n return toTypedArray([value], dtype);\n}\n\nfunction noConversionNeeded(a: TensorLike, dtype: DataType): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function toTypedArray(a: TensorLike, dtype: DataType): TypedArray {\n if (dtype === 'string') {\n throw new Error('Cannot convert a string[] to a TypedArray');\n }\n if (Array.isArray(a)) {\n a = base.flatten(a);\n }\n\n if (env().getBool('DEBUG')) {\n base.checkConversionForErrors(a as number[], dtype);\n }\n if (noConversionNeeded(a, dtype)) {\n return a as TypedArray;\n }\n if (dtype == null || dtype === 'float32' || dtype === 'complex64') {\n return new Float32Array(a as number[]);\n } else if (dtype === 'int32') {\n return new Int32Array(a as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array((a as number[]).length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round((a as number[])[i]) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution time in milliseconds relative to an\n * arbitrary time in the past. It works across different platforms (node.js,\n * browsers).\n *\n * ```js\n * console.log(tf.util.now());\n * ```\n *\n * @doc {heading: 'Util', namespace: 'util'}\n */\nexport function now(): number {\n return env().platform.now();\n}\n\n/**\n * Returns a platform-specific implementation of\n * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n *\n * If `fetch` is defined on the global object (`window`, `process`, etc.),\n * `tf.util.fetch` returns that function.\n *\n * If not, `tf.util.fetch` returns a platform-specific solution.\n *\n * ```js\n * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs');\n * // handle response\n * ```\n *\n * @doc {heading: 'Util'}\n */\nexport function fetch(\n path: string, requestInits?: RequestInit): Promise {\n return env().platform.fetch(path, requestInits);\n}\n\n/**\n * Encodes the provided string into bytes using the provided encoding scheme.\n *\n * @param s The string to encode.\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function encodeString(s: string, encoding = 'utf-8'): Uint8Array {\n encoding = encoding || 'utf-8';\n return env().platform.encode(s, encoding);\n}\n\n/**\n * Decodes the provided bytes into a string using the provided encoding scheme.\n * @param bytes The bytes to decode.\n *\n * @param encoding The encoding scheme. Defaults to utf-8.\n *\n * @doc {heading: 'Util'}\n */\nexport function decodeString(bytes: Uint8Array, encoding = 'utf-8'): string {\n encoding = encoding || 'utf-8';\n return env().platform.decode(bytes, encoding);\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n// Workaround for allowing cjs module to be included in bundle created by\n// rollup.\nimport * as LongExports from 'long';\n// tslint:disable-next-line\nconst Long: LongExports.LongConstructor =\n // tslint:disable-next-line\n (LongExports as any).default || LongExports;\n\nexport function hexToLong(hex: string): Long {\n return Long.fromString(hex, true, 16);\n}\n\n// Some primes between 2^63 and 2^64 for various uses.\n// Hex 0xc3a5c85c97cb3127\nconst k0: Long = hexToLong('c3a5c85c97cb3127');\n// Hex 0xb492b66fbe98f273\nconst k1: Long = hexToLong('b492b66fbe98f273');\n// Hex 0x9ae16a3b2f90404f\nconst k2: Long = hexToLong('9ae16a3b2f90404f');\n\nfunction shiftMix(val: Long): Long {\n return val.xor(val.shru(47));\n}\n\nfunction fetch(s: Uint8Array, offset: number, numBytes: number): Long {\n const bytes = s.slice(offset, offset + numBytes);\n return Long.fromBytes(Array.from(bytes), true, true);\n}\n\nfunction fetch64(s: Uint8Array, offset: number): Long {\n return fetch(s, offset, 8);\n}\n\nfunction fetch32(s: Uint8Array, offset: number): Long {\n return fetch(s, offset, 4);\n}\n\nfunction rotate64(val: Long, shift: number): Long {\n // Avoid shifting by 64: doing so yields an undefined result.\n return shift === 0 ? val : val.shru(shift).or(val.shl(64 - shift));\n}\n\nfunction hashLen16(u: Long, v: Long, mul = hexToLong('9ddfea08eb382d69')) {\n // Murmur-inspired hashing.\n let a = u.xor(v).mul(mul);\n a = a.xor(a.shru(47));\n let b = v.xor(a).mul(mul);\n b = b.xor(b.shru(47));\n b = b.mul(mul);\n return b;\n}\n\n// Return a 16-byte hash for 48 bytes. Quick and dirty.\n// Callers do best to use \"random-looking\" values for a and b.\nfunction weakHashLen32WithSeeds(\n w: Long, x: Long, y: Long, z: Long, a: Long, b: Long) {\n a = a.add(w);\n b = rotate64(b.add(a).add(z), 21);\n const c = a;\n a = a.add(x);\n a = a.add(y);\n b = b.add(rotate64(a, 44));\n return [a.add(z), b.add(c)];\n}\n\nfunction weakHashLen32WithSeedsStr(\n s: Uint8Array, offset: number, a: Long, b: Long) {\n return weakHashLen32WithSeeds(\n fetch64(s, offset), fetch64(s, offset + 8), fetch64(s, offset + 16),\n fetch64(s, offset + 24), a, b);\n}\n\nfunction hashLen0to16(s: Uint8Array, len = s.length): Long {\n if (len >= 8) {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).add(k2);\n const b = fetch64(s, len - 8);\n const c = rotate64(b, 37).mul(mul).add(a);\n const d = rotate64(a, 25).add(b).mul(mul);\n return hashLen16(c, d, mul);\n }\n if (len >= 4) {\n const mul = k2.add(len * 2);\n const a = fetch32(s, 0);\n return hashLen16(a.shl(3).add(len), fetch32(s, len - 4), mul);\n }\n if (len > 0) {\n const a = s[0];\n const b = s[len >> 1];\n const c = s[len - 1];\n const y = a + (b << 8);\n const z = len + (c << 2);\n return shiftMix(k2.mul(y).xor(k0.mul(z))).mul(k2);\n }\n return k2;\n}\n\nfunction hashLen17to32(s: Uint8Array, len = s.length): Long {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).mul(k1);\n const b = fetch64(s, 8);\n const c = fetch64(s, len - 8).mul(mul);\n const d = fetch64(s, len - 16).mul(k2);\n return hashLen16(\n rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d),\n a.add(rotate64(b.add(k2), 18)).add(c), mul);\n}\n\nfunction hashLen33to64(s: Uint8Array, len = s.length): Long {\n const mul = k2.add(len * 2);\n const a = fetch64(s, 0).mul(k2);\n const b = fetch64(s, 8);\n const c = fetch64(s, len - 8).mul(mul);\n const d = fetch64(s, len - 16).mul(k2);\n const y = rotate64(a.add(b), 43).add(rotate64(c, 30)).add(d);\n const z = hashLen16(y, a.add(rotate64(b.add(k2), 18)).add(c), mul);\n const e = fetch64(s, 16).mul(mul);\n const f = fetch64(s, 24);\n const g = y.add(fetch64(s, len - 32)).mul(mul);\n const h = z.add(fetch64(s, len - 24)).mul(mul);\n return hashLen16(\n rotate64(e.add(f), 43).add(rotate64(g, 30)).add(h),\n e.add(rotate64(f.add(a), 18)).add(g), mul);\n}\n\nexport function fingerPrint64(s: Uint8Array, len = s.length): Long {\n const seed: Long = Long.fromNumber(81, true);\n if (len <= 32) {\n if (len <= 16) {\n return hashLen0to16(s, len);\n } else {\n return hashLen17to32(s, len);\n }\n } else if (len <= 64) {\n return hashLen33to64(s, len);\n }\n\n // For strings over 64 bytes we loop. Internal state consists of\n // 56 bytes: v, w, x, y, and z.\n let x = seed;\n let y = seed.mul(k1).add(113);\n\n let z = shiftMix(y.mul(k2).add(113)).mul(k2);\n let v = [Long.UZERO, Long.UZERO];\n let w = [Long.UZERO, Long.UZERO];\n x = x.mul(k2).add(fetch64(s, 0));\n\n let offset = 0;\n // Set end so that after the loop we have 1 to 64 bytes left to process.\n const end = ((len - 1) >> 6) * 64;\n const last64 = end + ((len - 1) & 63) - 63;\n\n do {\n x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(k1);\n y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(k1);\n x = x.xor(w[1]);\n y = y.add(v[0]).add(fetch64(s, offset + 40));\n z = rotate64(z.add(w[0]), 33).mul(k1);\n v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(k1), x.add(w[0]));\n w = weakHashLen32WithSeedsStr(\n s, offset + 32, z.add(w[1]), y.add(fetch64(s, offset + 16)));\n\n [z, x] = [x, z];\n offset += 64;\n } while (offset !== end);\n const mul = k1.add(z.and(0xff).shl(1));\n // Point to the last 64 bytes of input.\n offset = last64;\n\n w[0] = w[0].add((len - 1) & 63);\n v[0] = v[0].add(w[0]);\n w[0] = w[0].add(v[0]);\n\n x = rotate64(x.add(y).add(v[0]).add(fetch64(s, offset + 8)), 37).mul(mul);\n y = rotate64(y.add(v[1]).add(fetch64(s, offset + 48)), 42).mul(mul);\n x = x.xor(w[1].mul(9));\n y = y.add(v[0].mul(9).add(fetch64(s, offset + 40)));\n z = rotate64(z.add(w[0]), 33).mul(mul);\n v = weakHashLen32WithSeedsStr(s, offset, v[1].mul(mul), x.add(w[0]));\n w = weakHashLen32WithSeedsStr(\n s, offset + 32, z.add(w[1]), y.add(fetch64(s, offset + 16)));\n\n [z, x] = [x, z];\n\n return hashLen16(\n hashLen16(v[0], w[0], mul).add(shiftMix(y).mul(k0)).add(z),\n hashLen16(v[1], w[1], mul).add(x), mul);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer, BackendTimingInfo} from './backends/backend';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport {DataType, DataTypeMap, TypedArray} from './types';\nimport * as util from './util';\n\nexport type KernelProfile = {\n kernelName: string,\n outputs: Tensor[],\n inputs: NamedTensorMap,\n timeMs: Promise,\n extraInfo: Promise\n};\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(kernelName: string, inputs: NamedTensorMap, f: () => Tensor[]):\n KernelProfile {\n let outputs: Tensor[];\n const holdResultWrapperFn = () => {\n outputs = f();\n };\n let timer: Promise;\n const start = util.now();\n if (this.backendTimer.timerAvailable()) {\n timer = this.backendTimer.time(holdResultWrapperFn);\n } else {\n holdResultWrapperFn();\n for (const output of outputs) {\n output.dataSync();\n }\n timer = Promise.resolve({kernelMs: util.now() - start});\n }\n if (env().getBool('CHECK_COMPUTATION_FOR_ERRORS')) {\n for (let i = 0; i < outputs.length; i++) {\n const output = outputs[i];\n // Dangling promise here because we don't want to propagate up\n // asynchronicity.\n output.data().then(tensorVals => {\n checkComputationForErrors(tensorVals, output.dtype, kernelName);\n });\n }\n }\n\n const kernelProfile = {\n kernelName,\n outputs,\n inputs,\n timeMs: timer.then(timing => timing.kernelMs),\n extraInfo: timer.then(\n timing => timing.getExtraProfileInfo != null ?\n timing.getExtraProfileInfo() :\n '')\n };\n return kernelProfile;\n }\n\n logKernelProfile(kernelProfile: KernelProfile): void {\n const {kernelName, outputs, timeMs, inputs, extraInfo} = kernelProfile;\n\n outputs.forEach(result => {\n Promise.all([result.data(), timeMs, extraInfo]).then(valueContainer => {\n this.logger.logKernelProfile(\n kernelName, result, valueContainer[0], valueContainer[1], inputs,\n valueContainer[2]);\n });\n });\n }\n}\n\nexport function checkComputationForErrors(\n vals: DataTypeMap[D], dtype: D, kernelName: string): boolean {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return false;\n }\n for (let i = 0; i < vals.length; i++) {\n const num = vals[i] as number;\n if (isNaN(num) || !isFinite(num)) {\n // Throwing custom exception so behavior is testable.\n console.warn(`Found ${num} in the result of '${kernelName}'`);\n return true;\n }\n }\n return false;\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray,\n timeMs: number|{error: string}, inputs: NamedTensorMap,\n extraInfo?: string) {\n const time = typeof timeMs === 'number' ? util.rightPad(`${timeMs}ms`, 9) :\n timeMs['error'];\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n let inputShapesDescription = '';\n\n for (const name in inputs) {\n const input = inputs[name];\n if (input != null) {\n // The input might be a non-tensor (e.g HTMLImageElement), in which case\n // we claim the output shape as input shape.\n const inputShape = input.shape || result.shape;\n const inputRank = inputShape.length;\n inputShapesDescription +=\n `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `;\n }\n }\n\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}\\t%c${\n inputShapesDescription}\\t%c${extraInfo}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange',\n 'color: green', 'color: steelblue');\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n kernelName: string;\n outputs: Tensor[];\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dys: Tensor[]) => NamedGradientMap;\n saved?: Tensor[];\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n *\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n node.outputs.forEach(output => tensorsFromX[output.id] = true);\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backward pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < node.outputs.length; j++) {\n if (tensorsLeadToY[node.outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node);\n prunedNode.inputs = prunedInputs;\n prunedNode.outputs = node.outputs;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n *\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[], tidy: (f: Function) => Tensor,\n add: (a: Tensor, b: Tensor) => Tensor) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dys: Tensor[] = [];\n node.outputs.forEach(o => {\n const gradTensor = tensorAccumulatedGradientMap[o.id];\n if (gradTensor != null) {\n dys.push(gradTensor);\n } else {\n // This particular output is not in the back-propagation subgraph, so it\n // does not affect the final output, thus we put null for its dy.\n dys.push(null);\n }\n });\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.kernelName}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dys);\n\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = tidy(() => inputGradients[inputName]());\n if (dx.dtype !== 'float32') {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`);\n }\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${\n node.kernelName}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = add(curGradient, dx);\n curGradient.dispose();\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, isString, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n const valuesOrTuples =\n dtype === 'complex64' ? createComplexTuples(vals) : vals;\n\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] = Math.max(\n padPerCol[j],\n valToString(valuesOrTuples[offset + j], 0, dtype).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(\n val: number|string|[number, number], pad: number, dtype: DataType) {\n let valStr: string;\n if (Array.isArray(val)) {\n valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` +\n `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`;\n } else if (isString(val)) {\n valStr = `'${val}'`;\n } else if (dtype === 'bool') {\n valStr = boolNumToString(val);\n } else {\n valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString();\n }\n\n return rightPad(valStr, pad);\n}\n\nfunction boolNumToString(v: number): string {\n return v === 0 ? 'false' : 'true';\n}\n\nfunction subTensorToString(\n vals: TypedArray|string[], shape: number[], dtype: DataType,\n strides: number[], padPerCol: number[], isLast = true): string[] {\n const storagePerElement = dtype === 'complex64' ? 2 : 1;\n\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n if (dtype === 'complex64') {\n const complexTuple = createComplexTuples(vals);\n return [valToString(complexTuple[0], 0, dtype)];\n }\n if (dtype === 'bool') {\n return [boolNumToString(vals[0] as number)];\n }\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement;\n\n let firstVals = Array.from(\n vals.slice(0, firstValsSize));\n let lastVals = Array.from(vals.slice(\n (size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement,\n size * storagePerElement));\n if (dtype === 'complex64') {\n firstVals = createComplexTuples(firstVals);\n lastVals = createComplexTuples(lastVals);\n }\n return [\n '[' +\n firstVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype))\n .join(', ') +\n ']'\n ];\n }\n const displayVals: Array =\n dtype === 'complex64' ? createComplexTuples(vals) :\n Array.from(vals);\n\n return [\n '[' +\n displayVals.map((x, i) => valToString(x, padPerCol[i], dtype))\n .join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0] * storagePerElement;\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.slice(start, end), subshape, dtype, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n\nfunction createComplexTuples(vals: Array<{}>|\n TypedArray): Array<[number, number]> {\n const complexTuples: Array<[number, number]> = [];\n for (let i = 0; i < vals.length; i += 2) {\n complexTuples.push([vals[i], vals[i + 1]] as [number, number]);\n }\n return complexTuples;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {getGlobal} from './global_util';\nimport {tensorToString} from './tensor_format';\nimport {ArrayMap, BackendValues, DataType, DataTypeMap, DataValues, NumericDataType, Rank, ShapeMap, SingleValueMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides, toNestedArray} from './util';\n\nexport interface TensorData {\n dataId?: DataId;\n values?: DataTypeMap[D];\n}\n\n// This interface mimics KernelBackend (in backend.ts), which would create a\n// circular dependency if imported.\nexport interface Backend {}\n\n/**\n * A mutable object, similar to `tf.Tensor`, that allows users to set values\n * at locations before converting to an immutable `tf.Tensor`.\n *\n * See `tf.buffer` for creating a tensor buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: DataTypeMap[D];\n\n constructor(shape: ShapeMap[R], public dtype: D, values?: DataTypeMap[D]) {\n this.shape = shape.slice() as ShapeMap[R];\n this.size = util.sizeFromShape(shape);\n\n if (values != null) {\n const n = values.length;\n util.assert(\n n === this.size,\n () => `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${this.size}'.`);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `complex64 dtype TensorBuffers are not supported. Please create ` +\n `a TensorBuffer for the real and imaginary parts separately and ` +\n `call tf.complex(real, imag).`);\n }\n this.values = values || util.getArrayFromDType(dtype, this.size);\n this.strides = computeStrides(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n set(value: SingleValueMap[D], ...locs: number[]): void {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n () => `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n\n const index = this.locToIndex(locs);\n this.values[index] = value as number;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n get(...locs: number[]): SingleValueMap[D] {\n if (locs.length === 0) {\n locs = [0];\n }\n let i = 0;\n for (const loc of locs) {\n if (loc < 0 || loc >= this.shape[i]) {\n const msg = `Requested out of range element at ${locs}. ` +\n ` Buffer shape=${this.shape}`;\n throw new Error(msg);\n }\n i++;\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index] as SingleValueMap[D];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `tf.Tensor` object from the buffer.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\n toTensor(): Tensor {\n return trackerFn().makeTensor(this.values, this.shape, this.dtype) as\n Tensor;\n }\n}\n\nexport interface TensorTracker {\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: Backend): Tensor;\n makeVariable(\n initialValue: Tensor, trainable?: boolean, name?: string,\n dtype?: DataType): Variable;\n incRef(a: Tensor, backend: Backend): void;\n disposeTensor(t: Tensor): void;\n disposeVariable(v: Variable): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): BackendValues;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: D,\n values?: DataTypeMap[D]): TensorBuffer;\n print(x: T, verbose: boolean): void;\n clone(x: T): T;\n // TODO(yassogba) bring reshape back?\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n// Used to warn about deprecated methods.\nlet deprecationWarningFn: (msg: string) => void = null;\n// This here so that we can use this method on dev branches and keep the\n// functionality at master.\n// tslint:disable-next-line:no-unused-expression\n[deprecationWarningFn];\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op\n * handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * Sets the deprecation warning function to be used by this file. This way the\n * Tensor class can be a leaf but still use the environment.\n */\nexport function setDeprecationWarningFn(fn: (msg: string) => void) {\n deprecationWarningFn = fn;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n// Declare this namespace to make Tensor class augmentation work in google3.\nexport declare namespace Tensor {}\n/**\n * A `tf.Tensor` object represents an immutable, multidimensional array of\n * numbers that has a shape and a data type.\n *\n * For performance reasons, functions that create tensors do not necessarily\n * perform a copy of the data passed to them (e.g. if the data is passed as a\n * `Float32Array`), and changes to the data will change the tensor. This is not\n * a feature and is not supported. To avoid this behavior, use the tensor before\n * changing the input data or create a copy with `copy = tf.add(yourTensor, 0)`.\n *\n * See `tf.tensor` for details on how to create a `tf.Tensor`.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Tensor {\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /** Whether this tensor has been globally kept. */\n kept = false;\n /** The id of the scope this tensor is being tracked in. */\n scopeId: number;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {\n this.shape = shape.slice() as ShapeMap[R];\n this.dtype = dtype || 'float32';\n this.size = util.sizeFromShape(shape);\n this.strides = computeStrides(shape);\n this.dataId = dataId;\n this.id = id;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns a promise of `tf.TensorBuffer` that holds the underlying data.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async buffer(): Promise> {\n const vals = await this.data();\n return opHandler.buffer(this.shape, this.dtype as D, vals);\n }\n\n /**\n * Returns a `tf.TensorBuffer` that holds the underlying data.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n bufferSync(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype as D, this.dataSync());\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * asynchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async array(): Promise {\n const vals = await this.data();\n return toNestedArray(this.shape, vals, this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Returns the tensor data as a nested array. The transfer of data is done\n * synchronously.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n arraySync(): ArrayMap[R] {\n return toNestedArray(\n this.shape, this.dataSync(), this.dtype === 'complex64') as\n ArrayMap[R];\n }\n\n /**\n * Asynchronously downloads the values from the `tf.Tensor`. Returns a\n * promise of `TypedArray` that resolves when the computation has finished.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n async data(): Promise {\n this.throwIfDisposed();\n const data = trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n const bytes = await data as Uint8Array[];\n try {\n return bytes.map(b => util.decodeString(b)) as DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as Promise;\n }\n\n /**\n * Synchronously downloads the values from the `tf.Tensor`. This blocks the\n * UI thread until the values are ready, which can cause performance issues.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dataSync(): DataTypeMap[D] {\n this.throwIfDisposed();\n const data = trackerFn().readSync(this.dataId);\n if (this.dtype === 'string') {\n try {\n return (data as Uint8Array[]).map(b => util.decodeString(b)) as\n DataTypeMap[D];\n } catch {\n throw new Error(\n 'Failed to decode the string bytes into utf-8. ' +\n 'To get the original bytes, call tensor.bytes().');\n }\n }\n return data as DataTypeMap[D];\n }\n\n /** Returns the underlying bytes of the tensor's data. */\n async bytes(): Promise {\n this.throwIfDisposed();\n const data = await trackerFn().read(this.dataId);\n if (this.dtype === 'string') {\n return data as Uint8Array[];\n } else {\n return new Uint8Array((data as TypedArray).buffer);\n }\n }\n\n /**\n * Disposes `tf.Tensor` from memory.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n protected isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /**\n * Prints the `tf.Tensor`. See `tf.print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Returns a copy of the tensor. See `tf.clone` for details.\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /**\n * Returns a human-readable description of the tensor. Useful for logging.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype);\n }\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return trackerFn().makeVariable(this, trainable, name, dtype) as\n Variable;\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n // Implementation note: we should use properties of the object that will be\n // defined before the constructor body has finished executing (methods).\n // This is because when this code is transpiled by babel, babel will call\n // classCallCheck before the constructor body is run.\n // See https://github.com/tensorflow/tfjs/issues/3384 for backstory.\n return !!instance && instance.data != null && instance.dataSync != null &&\n instance.throwIfDisposed != null;\n }\n});\n\nexport function getGlobalTensorClass() {\n // Use getGlobal so that we can augment the Tensor class across package\n // boundaries becase the node resolution alg may result in different modules\n // being returned for this file depending on the path they are loaded from.\n return getGlobal('Tensor', () => {\n return Tensor;\n });\n}\n\n// Global side effect. Cache global reference to Tensor class\ngetGlobalTensorClass();\n\nexport interface NumericTensor extends Tensor {\n dtype: NumericDataType;\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\nexport interface StringTensor extends Tensor {\n dtype: 'string';\n dataSync(): DataTypeMap[D];\n data(): Promise;\n}\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `tf.Tensor`, useful for persisting state, e.g. for training.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\nexport class Variable extends Tensor {\n name: string;\n\n constructor(\n initialValue: Tensor, public trainable: boolean, name: string,\n tensorId: number) {\n super(\n initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId);\n this.name = name;\n }\n\n /**\n * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have\n * the same shape and dtype as the old `tf.Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n *\n * @doc {heading: 'Tensors', subheading: 'Classes'}\n */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().incRef(this, null /* backend */);\n }\n\n dispose(): void {\n trackerFn().disposeVariable(this);\n this.isDisposedInternal = true;\n }\n}\n\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {TensorContainer, TensorContainerArray} from './tensor_types';\nimport {upcastType} from './types';\nimport {assert} from './util';\n\nexport function makeTypesMatch(a: T, b: T): [T, T] {\n if (a.dtype === b.dtype) {\n return [a, b];\n }\n const dtype = upcastType(a.dtype, b.dtype);\n return [a.cast(dtype), b.cast(dtype)];\n}\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n () => `The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n return tensorList.some(x => x.id === tensor.id);\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @docalias number[] */\nexport interface ArrayMap {\n R0: number;\n R1: number[];\n R2: number[][];\n R3: number[][][];\n R4: number[][][][];\n R5: number[][][][][];\n R6: number[][][][][][];\n}\n\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n complex64: Float32Array;\n string: string[];\n}\n\nexport interface SingleValueMap {\n bool: boolean;\n int32: number;\n float32: number;\n complex64: number;\n string: string;\n}\n\n/** @docalias 'float32'|'int32'|'bool'|'complex64'|'string' */\nexport type DataType = keyof DataTypeMap;\nexport type NumericDataType = 'float32'|'int32'|'bool'|'complex64';\nexport type TypedArray = Float32Array|Int32Array|Uint8Array;\n/** Tensor data used in tensor creation and user-facing API. */\nexport type DataValues = DataTypeMap[DataType];\n/** The underlying tensor data that gets stored in a backend. */\nexport type BackendValues = Float32Array|Int32Array|Uint8Array|Uint8Array[];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\n// Looks for upcasting types. Used, for example, in operations with mixed dtype\n// inputs.\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool',\n 'complex64' = 'complex64'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32',\n 'complex64' = 'complex64'\n}\n\nenum UpcastComplex64AndMap {\n 'float32' = 'complex64',\n 'int32' = 'complex64',\n 'bool' = 'complex64',\n 'complex64' = 'complex64'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap,\n 'complex64': UpcastComplex64AndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n if (typeA === 'string' || typeB === 'string') {\n if (typeA === 'string' && typeB === 'string') {\n return 'string';\n }\n throw new Error(`Can not upcast ${typeA} with ${typeB}`);\n }\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType): DataType {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|string|RecursiveArray|\n RecursiveArray|RecursiveArray|Uint8Array[];\nexport type ScalarLike = number|boolean|string|Uint8Array;\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[]|string[]|Uint8Array[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][]|\n string[]|string[][]|Uint8Array[]|Uint8Array[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D = TypedArray|number[]|number[][][]|boolean[]|\n boolean[][][]|string[]|string[][][]|Uint8Array[]|Uint8Array[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D = TypedArray|number[]|number[][][][]|boolean[]|\n boolean[][][][]|string[]|string[][][][]|Uint8Array[]|Uint8Array[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][]|string[]|\n string[][][][][]|Uint8Array[]|Uint8Array[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][]|\n string[]|string[][][][][][]|Uint8Array[]|Uint8Array[][][][][];\n\n/** Type for representing image data in Uint8Array type. */\nexport interface PixelData {\n width: number;\n height: number;\n data: Uint8Array;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, DataMover, KernelBackend} from './backends/backend';\nimport {Environment, setEnvironmentGlobal} from './environment';\nimport {getGlobalNamespace} from './global_util';\nimport {Add, Cast, Identity} from './kernel_names';\nimport {getGradient, getKernel, getKernelsForBackend, GradFunc, NamedAttrMap, TensorInfo} from './kernel_registry';\nimport {KernelProfile, Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, TapeNode} from './tape';\nimport {DataId, setTensorTracker, Tensor, TensorTracker, Variable} from './tensor';\nimport {GradSaveFunc, NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\nimport {BackendValues, DataType, DataValues} from './types';\nimport * as util from './util';\nimport {bytesFromStringArray, makeOnesTypedArray, now, sizeFromShape} from './util';\nimport * as log from './log';\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backward pass.\n */\nexport type ForwardFunc = (backend: KernelBackend, save?: GradSaveFunc) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,..., save?: Function) => {\n * value: Tensor,\n * gradFunc: (dy: Tensor, saved?: NamedTensorMap) => Tensor | Tensor[]\n * }\n */\nexport type CustomGradientFunc =\n (...inputs: Array) => {\n value: T;\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[];\n };\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean; reasons: string[];\n};\n\ntype KernelInfo = {\n name: string; bytesAdded: number; totalBytesSnapshot: number;\n tensorsAdded: number;\n totalTensorsSnapshot: number;\n inputShapes: number[][];\n outputShapes: number[][];\n kernelTimeMs: number | {error: string} | Promise;\n extraInfo: string | Promise;\n};\n\nexport type ProfileInfo = {\n newBytes: number; newTensors: number; peakBytes: number;\n kernels: KernelInfo[];\n result: TensorContainer;\n kernelNames: string[];\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n id: number;\n}\n\ninterface RegisteredKernelInvocation {\n kernelName: string;\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\ninterface CustomGradKernelInvocation {\n forwardFunc: ForwardFunc;\n backwardsFunc: (dy: T, saved: Tensor[]) => {\n [P in keyof I]: () => I[P]\n };\n inputs: I;\n attrs?: NamedAttrMap;\n}\n\nfunction isRegisteredKernelInvocation(\n kernelInvocation: RegisteredKernelInvocation|\n CustomGradKernelInvocation):\n kernelInvocation is RegisteredKernelInvocation {\n return (kernelInvocation as RegisteredKernelInvocation).kernelName != null;\n}\n\nclass EngineState {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n nextTapeNodeId = 0;\n numBytes = 0;\n numTensors = 0;\n numStringTensors = 0;\n numDataBuffers = 0;\n\n activeTape: TapeNode[];\n // Number of nested tf.grad() statements when computing higher-order\n // gradients. E.g. `1` for first-order gradients and `2` for second-order\n // gradients. Used to track if the tape should be removed after a backprop.\n gradientDepth = 0;\n // Number of nested kernel calls. When kernel depth is greater than 1, we turn\n // off the tape.\n kernelDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n activeScope: ScopeState;\n scopeStack: ScopeState[] = [];\n /**\n * Keeps track of the number of data moves during a kernel execution. We\n * maintain a stack since kernels can call other kernels, recursively.\n */\n numDataMovesStack: number[] = [];\n nextScopeId = 0;\n\n tensorInfo = new WeakMap();\n\n profiling = false;\n activeProfile: ProfileInfo = {\n newBytes: 0,\n newTensors: 0,\n peakBytes: 0,\n kernels: [],\n result: null,\n get kernelNames():\n string[] {\n return Array.from(new Set(this.kernels.map(k => k.name)));\n }\n };\n\n dispose() {\n for (const variableName in this.registeredVariables) {\n this.registeredVariables[variableName].dispose();\n }\n }\n}\n\nexport class Engine implements TensorTracker, DataMover {\n state: EngineState;\n backendName: string;\n registry: {[id: string]: KernelBackend} = {};\n registryFactory: {\n [id: string]: {\n factory: () => KernelBackend | Promise,\n priority: number\n }\n } = {};\n\n private profiler: Profiler;\n private backendInstance: KernelBackend;\n private pendingBackendInit: Promise;\n private pendingBackendInitId = 0;\n\n constructor(public ENV: Environment) {\n this.state = new EngineState();\n }\n\n async ready(): Promise {\n if (this.pendingBackendInit != null) {\n return this.pendingBackendInit.then(() => {});\n }\n if (this.backendInstance != null) {\n return;\n }\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const success = await this.initializeBackend(backendName).success;\n if (success) {\n await this.setBackend(backendName);\n return;\n }\n }\n\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n get backend(): KernelBackend {\n if (this.pendingBackendInit != null) {\n throw new Error(\n `Backend '${this.backendName}' has not yet been initialized. Make ` +\n `sure to await tf.ready() or await tf.setBackend() before calling ` +\n `other methods`);\n }\n if (this.backendInstance == null) {\n const {name, asyncInit} = this.initializeBackendsAndReturnBest();\n if (asyncInit) {\n throw new Error(\n `The highest priority backend '${name}' has not yet been ` +\n `initialized. Make sure to await tf.ready() or ` +\n `await tf.setBackend() before calling other methods`);\n }\n this.setBackend(name);\n }\n return this.backendInstance;\n }\n\n backendNames(): string[] {\n return Object.keys(this.registryFactory);\n }\n\n findBackend(backendName: string): KernelBackend {\n if (!(backendName in this.registry)) {\n // If the backend hasn't been initialized but we have a registry entry for\n // it, initialize it and return it.\n if (backendName in this.registryFactory) {\n const {asyncInit} = this.initializeBackend(backendName);\n if (asyncInit) {\n // Backend is not ready yet.\n return null;\n }\n } else {\n return null;\n }\n }\n return this.registry[backendName];\n }\n\n findBackendFactory(backendName: string):\n () => KernelBackend | Promise {\n if (!(backendName in this.registryFactory)) {\n return null;\n }\n return this.registryFactory[backendName].factory;\n }\n\n registerBackend(\n backendName: string,\n factory: () => KernelBackend | Promise,\n priority = 1): boolean {\n if (backendName in this.registryFactory) {\n log.warn(\n `${backendName} backend was already registered. ` +\n `Reusing existing backend factory.`);\n return false;\n }\n this.registryFactory[backendName] = {factory, priority};\n return true;\n }\n\n async setBackend(backendName: string): Promise {\n if (this.registryFactory[backendName] == null) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n this.backendName = backendName;\n if (this.registry[backendName] == null) {\n this.backendInstance = null;\n const {success, asyncInit} = this.initializeBackend(backendName);\n const result = asyncInit ? await success : success;\n if (!result) {\n return false;\n }\n }\n this.backendInstance = this.registry[backendName];\n this.setupRegisteredKernels();\n // Reset the profiler.\n this.profiler = new Profiler(this.backendInstance);\n\n return true;\n }\n\n private setupRegisteredKernels(): void {\n const kernels = getKernelsForBackend(this.backendName);\n kernels.forEach(kernel => {\n if (kernel.setupFunc != null) {\n kernel.setupFunc(this.backendInstance);\n }\n });\n }\n\n private disposeRegisteredKernels(backendName: string): void {\n const kernels = getKernelsForBackend(backendName);\n kernels.forEach(kernel => {\n if (kernel.disposeFunc != null) {\n kernel.disposeFunc(this.registry[backendName]);\n }\n });\n }\n\n /**\n * Initializes a backend by looking up the backend name in the factory\n * registry and calling the factory method. Returns a boolean representing\n * whether the initialization of the backend suceeded. Throws an error if\n * there is no backend in the factory registry.\n */\n private initializeBackend(backendName: string):\n {success: boolean|Promise, asyncInit: boolean} {\n const registryFactoryEntry = this.registryFactory[backendName];\n if (registryFactoryEntry == null) {\n throw new Error(\n `Cannot initialize backend ${backendName}, no registration found.`);\n }\n\n try {\n const backend = registryFactoryEntry.factory();\n /* Test if the factory returns a promise.\n Done in a more liberal way than\n previous 'Promise.resolve(backend)===backend'\n as we needed to account for custom Promise\n implementations (e.g. Angular) */\n if (backend && !(backend instanceof KernelBackend) &&\n typeof backend.then === 'function') {\n const promiseId = ++this.pendingBackendInitId;\n const success =\n backend\n .then(backendInstance => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.registry[backendName] = backendInstance;\n this.pendingBackendInit = null;\n return true;\n })\n .catch(err => {\n // Outdated promise. Another backend was set in the meantime.\n if (promiseId < this.pendingBackendInitId) {\n return false;\n }\n this.pendingBackendInit = null;\n log.warn(\n `Initialization of backend ${backendName} failed`);\n log.warn(err.stack || err.message);\n return false;\n });\n this.pendingBackendInit = success;\n return {success, asyncInit: true};\n } else {\n this.registry[backendName] = backend as KernelBackend;\n return {success: true, asyncInit: false};\n }\n } catch (err) {\n log.warn(`Initialization of backend ${backendName} failed`);\n log.warn(err.stack || err.message);\n return {success: false, asyncInit: false};\n }\n }\n\n removeBackend(backendName: string): void {\n if (!(backendName in this.registryFactory)) {\n throw new Error(`${backendName} backend not found in registry`);\n }\n if (this.backendName === backendName && this.pendingBackendInit != null) {\n // There is a pending promise of the backend we want to remove. Make it\n // obsolete.\n this.pendingBackendInitId++;\n }\n\n if (backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n\n delete this.registryFactory[backendName];\n\n // Unset the backend if it is active.\n if (this.backendName === backendName) {\n this.pendingBackendInit = null;\n this.backendName = null;\n this.backendInstance = null;\n }\n }\n\n private getSortedBackends(): string[] {\n if (Object.keys(this.registryFactory).length === 0) {\n throw new Error('No backend found in registry.');\n }\n return Object.keys(this.registryFactory).sort((a: string, b: string) => {\n // Highest priority comes first.\n return this.registryFactory[b].priority -\n this.registryFactory[a].priority;\n });\n }\n\n private initializeBackendsAndReturnBest():\n {name: string, asyncInit: boolean} {\n const sortedBackends = this.getSortedBackends();\n\n for (let i = 0; i < sortedBackends.length; i++) {\n const backendName = sortedBackends[i];\n const {success, asyncInit} = this.initializeBackend(backendName);\n if (asyncInit || success) {\n return {name: backendName, asyncInit};\n }\n }\n throw new Error(\n `Could not initialize any backends, all backend initializations ` +\n `failed.`);\n }\n\n moveData(backend: KernelBackend, dataId: DataId) {\n const info = this.state.tensorInfo.get(dataId);\n const srcBackend = info.backend;\n const values = this.readSync(dataId);\n const refCount = srcBackend.refCount(dataId);\n // Delete the tensor from the old backend and move it to the new\n // backend.\n srcBackend.disposeData(dataId, true);\n info.backend = backend;\n backend.move(dataId, values, info.shape, info.dtype, refCount);\n if (this.shouldCheckForMemLeaks()) {\n // Track the number of moves during a kernel execution to correctly\n // detect memory leaks.\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++;\n }\n }\n\n tidy(nameOrFn: string|ScopeFn, fn?: ScopeFn):\n T {\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name), () => this.endScope(result), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n private static nextTensorId = 0;\n private nextTensorId(): number {\n return Engine.nextTensorId++;\n }\n\n private static nextVariableId = 0;\n private nextVariableId(): number {\n return Engine.nextVariableId++;\n }\n\n /**\n * This method is called instead of the public-facing tensor.clone() when\n * saving a tensor for backwards pass. It makes sure to add the clone\n * operation to the tape regardless of being called inside a kernel\n * execution.\n */\n private clone(x: Tensor): Tensor {\n const y: Tensor = ENGINE.runKernel(Identity, {x} as {} as NamedTensorMap);\n const inputs = {x};\n const grad = (dy: Tensor) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {x: dy};\n const attrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, gradInputs as {} as NamedTensorMap,\n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs as {} as NamedAttrMap) as Tensor;\n }\n });\n const saved: Tensor[] = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }\n\n /**\n * Execute a kernel with the given name and return the output tensor.\n *\n * @param kernelName The name of the kernel to execute.\n * @param inputs A map of input names to tensors.\n * @param attrs A map of attribute names to their values. An attribute is a\n * primitive (non-tensor) input to the kernel.\n * @param inputsToSave A list of tensors, inputs to save for the backprop\n * computation.\n * @param outputsToSave A list of booleans, specifying which output to save\n * for the backprop computation. These are booleans since the output\n * tensors are not visible to the user.\n */\n runKernel(\n kernelName: string, inputs: NamedTensorMap, attrs?: NamedAttrMap): T {\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const hasKernel = getKernel(kernelName, this.backendName) != null;\n if (!hasKernel) {\n throw new Error(`Kernel '${kernelName}' not registered for backend '${\n this.backendName}'`);\n }\n return this.runKernelFunc({kernelName, inputs, attrs});\n }\n\n private shouldCheckForMemLeaks(): boolean {\n return this.ENV.getBool('IS_TEST');\n }\n\n private checkKernelForMemLeak(\n kernelName: string, numDataIdsBefore: number,\n outInfos: TensorInfo[]): void {\n const numDataIdsAfter = this.backend.numDataIds();\n\n // Count the number of data ids associated with the result of the kernel.\n let numOutputDataIds = 0;\n outInfos.forEach(info => {\n // Complex numbers allocate 3 data ids, one for 'real', one for\n // 'imaginary', and one for the container that holds the former two.\n numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1);\n });\n\n // Account for the number of moves during kernel execution. A \"data move\"\n // can happen in the middle of a kernel execution, placing a new (key,value)\n // pair in the data storage. Since data moves have net zero effect (we\n // always remove the data from the old backend), we have to cancel them out\n // when detecting memory leaks.\n const numMoves =\n this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1];\n const dataIdsLeaked =\n numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves;\n if (dataIdsLeaked > 0) {\n throw new Error(\n `Backend '${this.backendName}' has an internal memory leak ` +\n `(${dataIdsLeaked} data ids) after running '${kernelName}'`);\n }\n }\n\n /**\n * Internal helper method to execute a kernel Func\n *\n * Use `runKernel` to execute kernels from outside of engine.\n */\n private runKernelFunc(\n kernelParams: RegisteredKernelInvocation|\n CustomGradKernelInvocation): T {\n let outputs: Tensor[];\n let saved: Tensor[] = [];\n const isTapeOn = this.isTapeOn();\n\n const startingBytecount = this.state.numBytes;\n const startingNumTensors = this.state.numTensors;\n\n if (this.shouldCheckForMemLeaks()) {\n this.state.numDataMovesStack.push(0);\n }\n\n let kernelFunc: () => Tensor[];\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n\n let out: TensorInfo|TensorInfo[];\n\n const kernelOrScopeName = isRegisteredKernelInvocation(kernelParams) ?\n kernelParams.kernelName :\n this.state.activeScope != null ? this.state.activeScope.name : '';\n\n // Create the kernelFunc from either a registered kernel OR passed in\n // forward/backward functions (used by custom grad). In this context a\n // kernelFunc wraps a kernel implementation with some bookkeeping.\n\n if (isRegisteredKernelInvocation(kernelParams)) {\n const {kernelName, inputs, attrs} = kernelParams;\n if (this.backendName == null) {\n // backend has not been initialized yet (backend initialization is lazy\n // can be deferred until an op/ kernel is run).\n // The below getter has side effects that will try to initialize the\n // backend and set properties like this.backendName\n // tslint:disable-next-line: no-unused-expression\n this.backend;\n }\n const kernel = getKernel(kernelName, this.backendName);\n util.assert(\n kernel != null,\n () => `Cannot find registered kernel '${kernelName}' for backend '${\n this.backendName}'`);\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = kernel.kernelFunc({inputs, attrs, backend: this.backend});\n const outInfos = Array.isArray(out) ? out : [out];\n if (this.shouldCheckForMemLeaks()) {\n this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos);\n }\n\n const outTensors = outInfos.map((outInfo: TensorInfo|Tensor) => {\n // todo (yassogba) remove this option (Tensor) when node backend\n // methods have been modularized and they all return tensorInfo.\n // TensorInfos do not have a rank attribute.\n if ((outInfo as Tensor).rank != null) {\n return outInfo as Tensor;\n }\n const {dataId, shape, dtype} = outInfo as TensorInfo;\n return this.makeTensorFromDataId(dataId, shape, dtype);\n });\n\n // Save any required inputs and outputs.\n\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since there would be no backprop for these tensors\n // (which would otherwise dispose them).\n if (isTapeOn) {\n const tensorsToSave =\n this.getTensorsForGradient(kernelName, inputs, outTensors);\n saved = this.saveTensorsForBackwardMode(tensorsToSave);\n }\n return outTensors;\n };\n } else {\n const {forwardFunc} = kernelParams;\n // Running a customGrad op.\n const saveFunc: GradSaveFunc = (tensors) => {\n // Do not save unless we are recording to the tape. Otherwise it would\n // cause a mem leak since we would never run backprop, which disposes\n // the kept tensors.\n if (!isTapeOn) {\n return;\n }\n saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n };\n\n kernelFunc = () => {\n const numDataIdsBefore = this.backend.numDataIds();\n out = this.tidy(() => forwardFunc(this.backend, saveFunc));\n const outs = (Array.isArray(out) ? out : [out]) as Tensor[];\n if (this.shouldCheckForMemLeaks()) {\n // Scope name is used to print a more helpful error message if needed.\n this.checkKernelForMemLeak(kernelOrScopeName, numDataIdsBefore, outs);\n }\n return outs;\n };\n }\n\n //\n // Run the kernelFunc. Optionally profiling it.\n //\n const {inputs, attrs} = kernelParams;\n const backwardsFunc = isRegisteredKernelInvocation(kernelParams) ?\n null :\n kernelParams.backwardsFunc;\n\n let kernelProfile: KernelProfile;\n this.scopedRun(\n // Stop recording to a tape when running a kernel.\n () => this.state.kernelDepth++, () => this.state.kernelDepth--, () => {\n if (!this.ENV.getBool('DEBUG') && !this.state.profiling) {\n outputs = kernelFunc();\n } else {\n kernelProfile = this.profiler.profileKernel(\n kernelOrScopeName, inputs, () => kernelFunc());\n if (this.ENV.getBool('DEBUG')) {\n this.profiler.logKernelProfile(kernelProfile);\n }\n outputs = kernelProfile.outputs;\n }\n });\n\n if (isTapeOn) {\n this.addTapeNode(\n kernelOrScopeName, inputs, outputs, backwardsFunc, saved, attrs);\n }\n\n if (this.state.profiling) {\n this.state.activeProfile.kernels.push({\n name: kernelOrScopeName,\n bytesAdded: this.state.numBytes - startingBytecount,\n totalBytesSnapshot: this.state.numBytes,\n tensorsAdded: this.state.numTensors - startingNumTensors,\n totalTensorsSnapshot: this.state.numTensors,\n inputShapes: Object.keys(inputs).map(\n key => inputs[key] != null ? inputs[key].shape : null),\n outputShapes: outputs.map(item => item.shape),\n kernelTimeMs: kernelProfile.timeMs,\n extraInfo: kernelProfile.extraInfo\n });\n }\n return (Array.isArray(out) ? outputs : outputs[0]) as T;\n }\n\n /**\n * Saves tensors used in forward mode for use in backward mode.\n *\n * @param tensors the list of tensors to save.\n */\n private saveTensorsForBackwardMode(tensors: Tensor[]): Tensor[] {\n const saved = tensors.map(tensor => this.keep(this.clone(tensor)));\n return saved;\n }\n\n /**\n * Returns a list of tensors to save for a given gradient calculation.\n *\n * @param kernelName name of kernel to look up gradient for.\n * @param inputs a map of input tensors.\n * @param outputs an array of output tensors from forward mode of kernel.\n */\n private getTensorsForGradient(\n kernelName: string, inputs: NamedTensorMap,\n outputs: Tensor[]): Tensor[]|null {\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n const inputsToSave: string[] = gradConfig.inputsToSave || [];\n const outputsToSave: boolean[] = gradConfig.outputsToSave || [];\n\n // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs\n // specified in inputsToSave will be saved.\n let inputTensorsToSave: Tensor[];\n if (gradConfig.saveAllInputs) {\n util.assert(\n Array.isArray(inputs),\n () => 'saveAllInputs is true, expected inputs to be an array.');\n\n inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]);\n } else {\n inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]);\n }\n\n const outputTensorsToSave: Tensor[] =\n outputs.filter((_, i) => outputsToSave[i]);\n\n return inputTensorsToSave.concat(outputTensorsToSave);\n }\n // We return an empty list rather than throw an error because the kernel we\n // are looking up may not actually be relevant to backproping through the\n // overall function\n //\n // See 'does not error if irrelevant (pruned) ops are missing grads' test\n // in gradients_test.ts for an example.\n return [];\n }\n\n /**\n * Internal method used by public APIs for tensor creation. Makes a new\n * tensor with the provided shape, dtype and values. It always\n * creates a new data id and writes the values to the underlying backend.\n */\n makeTensor(\n values: DataValues, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n if (values == null) {\n throw new Error('Values passed to engine.makeTensor() are null');\n }\n dtype = dtype || 'float32';\n backend = backend || this.backend;\n let backendVals = values as BackendValues;\n if (dtype === 'string' && util.isString(values[0])) {\n backendVals = (values as string[]).map(d => util.encodeString(d));\n }\n const dataId = backend.write(backendVals, shape, dtype);\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n\n // Count bytes for string tensors.\n if (dtype === 'string') {\n const info = this.state.tensorInfo.get(dataId);\n const newBytes = bytesFromStringArray(backendVals as Uint8Array[]);\n this.state.numBytes += newBytes - info.bytes;\n info.bytes = newBytes;\n }\n return t;\n }\n\n /**\n * Internal method used by backends. Makes a new tensor\n * that is a wrapper around an existing data id. It doesn't create\n * a new data id, only increments the ref count used in memory tracking.\n */\n makeTensorFromDataId(\n dataId: DataId, shape: number[], dtype: DataType,\n backend?: KernelBackend): Tensor {\n dtype = dtype || 'float32';\n const t = new Tensor(shape, dtype, dataId, this.nextTensorId());\n this.trackTensor(t, backend);\n return t;\n }\n\n makeVariable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n name = name || this.nextVariableId().toString();\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.cast(dtype);\n }\n const v = new Variable(initialValue, trainable, name, this.nextTensorId());\n if (this.state.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.state.registeredVariables[v.name] = v;\n this.incRef(v, this.backend);\n return v;\n }\n\n trackTensor(a: Tensor, backend: KernelBackend): void {\n this.state.numTensors++;\n if (a.dtype === 'string') {\n this.state.numStringTensors++;\n }\n // Bytes for complex numbers are counted by their components. Bytes for\n // string tensors are counted when writing values.\n let bytes = 0;\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n bytes = a.size * util.bytesPerElement(a.dtype);\n }\n this.state.numBytes += bytes;\n\n if (!this.state.tensorInfo.has(a.dataId)) {\n this.state.numDataBuffers++;\n this.state.tensorInfo.set(a.dataId, {\n backend: backend || this.backend,\n dtype: a.dtype,\n shape: a.shape,\n bytes\n });\n }\n\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n // Track the tensor by dataId and increase the refCount for the dataId in the\n // backend.\n // TODO(pyu10055): This is currently used by makeVariable method, to increase\n // refCount on the backend for the dataId. It can potentially be replaced with\n // Identity op indead of calling backend directly.\n incRef(a: Tensor, backend: KernelBackend): void {\n this.trackTensor(a, backend);\n this.backend.incRef(a.dataId);\n }\n\n removeDataId(dataId: DataId, backend: KernelBackend) {\n if (this.state.tensorInfo.has(dataId) &&\n this.state.tensorInfo.get(dataId).backend === backend) {\n this.state.tensorInfo.delete(dataId);\n this.state.numDataBuffers--;\n }\n }\n disposeTensor(a: Tensor): void {\n if (!this.state.tensorInfo.has(a.dataId)) {\n return;\n }\n const info = this.state.tensorInfo.get(a.dataId);\n\n this.state.numTensors--;\n if (a.dtype === 'string') {\n this.state.numStringTensors--;\n this.state.numBytes -= info.bytes;\n }\n // Don't count bytes for complex numbers as they are counted by their\n // components.\n if (a.dtype !== 'complex64' && a.dtype !== 'string') {\n const bytes = a.size * util.bytesPerElement(a.dtype);\n this.state.numBytes -= bytes;\n }\n\n // Remove the reference to dataId if backend dispose the data successfully\n if (info.backend.disposeData(a.dataId)) {\n this.removeDataId(a.dataId, info.backend);\n }\n\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.state.registeredVariables) {\n const v = this.state.registeredVariables[varName];\n this.disposeVariable(v);\n }\n }\n\n disposeVariable(v: Variable): void {\n this.disposeTensor(v);\n if (this.state.registeredVariables[v.name] != null) {\n delete this.state.registeredVariables[v.name];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.state.numTensors;\n info.numDataBuffers = this.state.numDataBuffers;\n info.numBytes = this.state.numBytes;\n if (this.state.numStringTensors > 0) {\n info.unreliable = true;\n if (info.reasons == null) {\n info.reasons = [];\n }\n info.reasons.push(\n 'Memory usage by string tensors is approximate ' +\n '(2 bytes per character)');\n }\n return info;\n }\n\n async profile(query: () => (TensorContainer | Promise)):\n Promise {\n this.state.profiling = true;\n\n const startBytes = this.state.numBytes;\n const startNumTensors = this.state.numTensors;\n\n this.state.activeProfile.kernels = [];\n this.state.activeProfile.result = await query();\n\n this.state.profiling = false;\n\n this.state.activeProfile.peakBytes = Math.max(\n ...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot));\n this.state.activeProfile.newBytes = this.state.numBytes - startBytes;\n this.state.activeProfile.newTensors =\n this.state.numTensors - startNumTensors;\n for (const kernel of this.state.activeProfile.kernels) {\n kernel.kernelTimeMs = await kernel.kernelTimeMs;\n kernel.extraInfo = await kernel.extraInfo;\n }\n return this.state.activeProfile;\n }\n\n isTapeOn(): boolean {\n return this.state.gradientDepth > 0 && this.state.kernelDepth === 0;\n }\n\n private addTapeNode(\n kernelName: string, inputs: NamedTensorMap, outputs: Tensor[],\n gradientsFunc: GradFunc, saved: Tensor[], attrs: NamedAttrMap): void {\n const tapeNode: TapeNode =\n {id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved};\n\n const gradConfig = getGradient(kernelName);\n if (gradConfig != null) {\n gradientsFunc = gradConfig.gradFunc;\n }\n if (gradientsFunc != null) {\n tapeNode.gradient = (dys: Tensor[]) => {\n // TODO(smilkov): To optimize back-prop, pass dys that are not used in\n // the backprop graph to the user as null instead of zeros\n dys = dys.map((dy, i) => {\n if (dy == null) {\n const output = outputs[i];\n const vals = util.makeZerosTypedArray(output.size, output.dtype);\n return this.makeTensor(vals, output.shape, output.dtype);\n }\n return dy;\n });\n // Grad functions of ops with single outputs expect a dy, while ops\n // with multiple outputs expect dys (array of dy).\n return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs);\n };\n }\n this.state.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n result.kept = true;\n return result;\n }\n\n private startTape() {\n if (this.state.gradientDepth === 0) {\n this.state.activeTape = [];\n }\n this.state.gradientDepth++;\n }\n\n private endTape() {\n this.state.gradientDepth--;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string) {\n const scopeInfo: ScopeState = {\n track: [],\n name: 'unnamed scope',\n id: this.state.nextScopeId++\n };\n if (name) {\n scopeInfo.name = name;\n }\n this.state.scopeStack.push(scopeInfo);\n this.state.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer) {\n const tensorsToTrackInParent = getTensorsInContainer(result);\n const tensorsToTrackInParentSet =\n new Set(tensorsToTrackInParent.map(t => t.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.state.activeScope.track.length; i++) {\n const tensor = this.state.activeScope.track[i];\n if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) {\n tensor.dispose();\n }\n }\n\n const oldScope = this.state.scopeStack.pop();\n this.state.activeScope = this.state.scopeStack.length === 0 ?\n null :\n this.state.scopeStack[this.state.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!tensor.kept && tensor.scopeId === oldScope.id) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f`\n * was not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(\n xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(\n () => this.startTape(), () => this.endTape(),\n () => this.tidy('forward', f));\n\n util.assert(\n y instanceof Tensor,\n () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(\n accumulatedGradientMap, filteredTape,\n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f as ScopeFn),\n // Pass an add function to avoide a circular dep with `tape.ts`.\n add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return {value: y, grads};\n });\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Array) => T {\n util.assert(\n util.isFunction(f),\n () => 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' +\n 'tensors');\n\n let res: {\n value: T,\n gradFunc: (dy: T, saved: Tensor[]) => Tensor | Tensor[],\n };\n const inputMap: NamedTensorMap = {};\n inputs.forEach((input, i) => {\n inputMap[i] = input;\n });\n\n const forwardFunc: ForwardFunc = (_, save) => {\n res = f(...[...inputs, save]);\n util.assert(\n res.value instanceof Tensor,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(res.gradFunc),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n return res.value;\n };\n\n const backwardsFunc = (dy: T, saved: Tensor[]) => {\n const gradRes = res.gradFunc(dy, saved);\n const grads: Tensor[] = Array.isArray(gradRes) ? gradRes : [gradRes];\n util.assert(\n grads.length === inputs.length,\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'the same number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n () => 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function that returns ' +\n 'a list of only tensors.');\n const gradMap: {[key: string]: () => Tensor} = {};\n grads.forEach((grad, i) => {\n gradMap[i] = () => grad;\n });\n return gradMap;\n };\n\n return this.runKernelFunc({\n forwardFunc,\n backwardsFunc,\n inputs: inputMap,\n });\n };\n }\n\n readSync(dataId: DataId): BackendValues {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n // Route the read to the correct backend.\n const info = this.state.tensorInfo.get(dataId);\n return info.backend.read(dataId);\n }\n\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.state.activeScope != null) {\n result.scopeId = this.state.activeScope.id;\n this.state.activeScope.track.push(result);\n }\n\n return result;\n }\n\n get registeredVariables(): NamedVariableMap {\n return this.state.registeredVariables;\n }\n\n /**\n * Resets the engine state. Removes all backends but does not remove\n * registered backend factories.\n */\n reset(): void {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return ENGINE.makeTensor(values, shape, 'float32');\n}\n\nexport function getOrMakeEngine(): Engine {\n const ns = getGlobalNamespace() as {} as {_tfengine: Engine};\n if (ns._tfengine == null) {\n const environment = new Environment(ns);\n ns._tfengine = new Engine(environment);\n }\n setEnvironmentGlobal(ns._tfengine.ENV);\n\n // Tell the current tensor interface that the global engine is responsible\n // for tracking.\n setTensorTracker(() => ns._tfengine);\n return ns._tfengine;\n}\n\nexport const ENGINE = getOrMakeEngine();\n\n/**\n * A implementation of the add op for use within engine and tape.\n *\n * This allows us to avoid a circular dependency between add.ts and engine.\n * It is exported to be available in tape tests.\n */\nexport function add(a: Tensor, b: Tensor): Tensor {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = {a, b};\n return ENGINE.runKernel(Add, inputs as {} as NamedTensorMap);\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// tslint:disable-next-line:no-any\nfunction _isNavigatorDefined(): boolean {\n return typeof navigator !== 'undefined' && navigator != null;\n}\n\nexport function isMobile(nav?: Navigator): boolean {\n if (nav || _isNavigatorDefined()) {\n if (!nav) {\n nav = navigator;\n }\n if (nav.product === 'ReactNative') {\n return true;\n }\n\n // tslint:disable-next-line:no-any\n const a = nav.userAgent || nav.vendor ||\n (typeof window !== 'undefined' ? (window as any).opera : '');\n // Use `navigator.userAgentData.mobile` as fallback.\n if (!a) {\n // tslint:disable-next-line:no-any\n const navAny = nav as any;\n return navAny.userAgentData && navAny.userAgentData.mobile;\n }\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n }\n return false;\n}\n\nexport function isBrowser(): boolean {\n return (typeof window !== 'undefined' && window.document != null) ||\n //@ts-ignore\n (typeof WorkerGlobalScope !== 'undefined');\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport './engine';\n\nimport * as device_util from './device_util';\nimport {env} from './environment';\n\nconst ENV = env();\n\n/**\n * This file contains environment-related flag registrations.\n */\n\n/** Whether to enable debug mode. */\nENV.registerFlag('DEBUG', () => false, debugValue => {\n if (debugValue) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n});\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag('IS_BROWSER', () => device_util.isBrowser());\n\n/** Whether we are in a browser (as versus, say, node.js) environment. */\nENV.registerFlag(\n 'IS_NODE',\n () => (typeof process !== 'undefined') &&\n (typeof process.versions !== 'undefined') &&\n (typeof process.versions.node !== 'undefined'));\n\n/** Whether this browser is Chrome. */\nENV.registerFlag(\n 'IS_CHROME',\n () => typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor));\n\n/**\n * True when the environment is \"production\" where we disable safety checks\n * to gain performance.\n */\nENV.registerFlag('PROD', () => false);\n\n/**\n * Whether to do sanity checks when inferring a shape from user-provided\n * values, used when creating a new tensor.\n */\nENV.registerFlag(\n 'TENSORLIKE_CHECK_SHAPE_CONSISTENCY', () => ENV.getBool('DEBUG'));\n\n/** Whether deprecation warnings are enabled. */\nENV.registerFlag('DEPRECATION_WARNINGS_ENABLED', () => true);\n\n/** True if running unit tests. */\nENV.registerFlag('IS_TEST', () => false);\n\n/** Whether to check computation result for errors. */\nENV.registerFlag('CHECK_COMPUTATION_FOR_ERRORS', () => true);\n\n/** Whether the backend needs to wrap input to imageBitmap. */\nENV.registerFlag('WRAP_TO_IMAGEBITMAP', () => false);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from './engine';\nimport {env} from './environment';\nimport {Tensor} from './tensor';\nimport {DataType, TensorLike} from './types';\nimport {assert, flatten, inferDtype, isTypedArray, toTypedArray} from './util';\n\nexport function inferShape(val: TensorLike, dtype?: DataType): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return dtype === 'string' ? [] : [val.length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (Array.isArray(firstElem) ||\n isTypedArray(firstElem) && dtype !== 'string') {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (Array.isArray(val) &&\n env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) {\n deepAssertShapeConsistency(val, shape, []);\n }\n\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: TensorLike, shape: number[], indices: number[]) {\n indices = indices || [];\n if (!(Array.isArray(val)) && !isTypedArray(val)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array/TypedArray of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nfunction assertDtype(\n expectedDtype: DataType|'numeric'|'string_or_numeric',\n actualDType: DataType, argName: string, functionName: string) {\n if (expectedDtype === 'string_or_numeric') {\n return;\n }\n if (expectedDtype == null) {\n throw new Error(`Expected dtype cannot be null.`);\n }\n if (expectedDtype !== 'numeric' && expectedDtype !== actualDType ||\n expectedDtype === 'numeric' && actualDType === 'string') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must ` +\n `be ${expectedDtype} tensor, but got ${actualDType} tensor`);\n }\n}\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T {\n if (x instanceof Tensor) {\n assertDtype(parseAsDtype, x.dtype, argName, functionName);\n return x;\n }\n let inferredDtype = inferDtype(x);\n // If the user expects a bool/int/float, use that info to update the\n // inferredDtype when it is not a string.\n if (inferredDtype !== 'string' &&\n ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) {\n inferredDtype = parseAsDtype as DataType;\n }\n assertDtype(parseAsDtype, inferredDtype, argName, functionName);\n\n if ((x == null) ||\n (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean' && typeof x !== 'string')) {\n const type = x == null ? 'null' : (x as {}).constructor.name;\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got '${type}'`);\n }\n const inferredShape = inferShape(x, inferredDtype);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n const skipTypedArray = true;\n const values = inferredDtype !== 'string' ?\n toTypedArray(x, inferredDtype as DataType) :\n flatten(x as string[], [], skipTypedArray) as string[];\n return ENGINE.makeTensor(values, inferredShape, inferredDtype) as T;\n}\n\nexport function convertToTensorArray(\n arg: Array, argName: string, functionName: string,\n parseAsDtype: DataType|'numeric'|'string_or_numeric' = 'numeric'): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) =>\n convertToTensor(t, `${argName}[${i}]`, functionName, parseAsDtype));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {isPromise} from '../util';\n\nexport const OP_SCOPE_SUFFIX = '__op';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENGINE.startScope(opName);\n try {\n const result = fn(...args);\n if (isPromise(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENGINE.endScope(result);\n return result;\n } catch (ex) {\n ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Complex, ComplexInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Converts two real numbers to a complex number.\n *\n * Given a tensor `real` representing the real part of a complex number, and a\n * tensor `imag` representing the imaginary part of a complex number, this\n * operation returns complex numbers elementwise of the form [r0, i0, r1, i1],\n * where r represents the real part and i represents the imag part.\n *\n * The input tensors real and imag must have the same shape.\n *\n * ```js\n * const real = tf.tensor1d([2.25, 3.25]);\n * const imag = tf.tensor1d([4.75, 5.75]);\n * const complex = tf.complex(real, imag);\n *\n * complex.print();\n * ```\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction complex_(real: T|TensorLike, imag: T|TensorLike): T {\n const $real = convertToTensor(real, 'real', 'complex');\n const $imag = convertToTensor(imag, 'imag', 'complex');\n util.assertShapesMatch(\n $real.shape, $imag.shape,\n `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` +\n `must match in call to tf.complex().`);\n\n const inputs: ComplexInputs = {real: $real, imag: $imag};\n return ENGINE.runKernel(Complex, inputs as {} as NamedTensorMap);\n}\n\nexport const complex = op({complex_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Tensor} from '../tensor';\nimport {TensorLike, TypedArray} from '../types';\nimport {DataType} from '../types';\nimport {assert, assertNonNegativeIntegerDimensions, flatten, inferDtype, isTypedArray, sizeFromShape, toTypedArray} from '../util';\n\n/** This is shared code across all tensor creation methods. */\nexport function makeTensor(\n values: TensorLike, shape: number[], inferredShape: number[],\n dtype?: DataType): Tensor {\n if (dtype == null) {\n dtype = inferDtype(values);\n }\n if (dtype === 'complex64') {\n throw new Error(\n `Cannot construct a complex64 tensor directly. ` +\n `Please use tf.complex(real, imag).`);\n }\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean' &&\n typeof values !== 'string') {\n throw new Error(\n 'values passed to tensor(values) must be a number/boolean/string or ' +\n 'an array of numbers/booleans/strings, or a TypedArray');\n }\n if (shape != null) {\n assertNonNegativeIntegerDimensions(shape);\n\n const providedSize = sizeFromShape(shape);\n const inferredSize = sizeFromShape(inferredShape);\n assert(\n providedSize === inferredSize,\n () =>\n `Based on the provided shape, [${shape}], the tensor should have ` +\n `${providedSize} values but has ${inferredSize}`);\n\n for (let i = 0; i < inferredShape.length; ++i) {\n const inferred = inferredShape[i];\n const flatDimsDontMatch = i === inferredShape.length - 1 ?\n inferred !== sizeFromShape(shape.slice(i)) :\n true;\n assert(\n inferredShape[i] === shape[i] || !flatDimsDontMatch,\n () => `Error creating a new Tensor. Inferred shape ` +\n `(${inferredShape}) does not match the provided ` +\n `shape (${shape}). `);\n }\n }\n\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n\n shape = shape || inferredShape;\n values = dtype !== 'string' ?\n toTypedArray(values, dtype) :\n flatten(values as string[], [], true) as string[];\n return ENGINE.makeTensor(values as TypedArray, shape, dtype);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {inferShape} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {DataType, Rank, ShapeMap} from '../types';\n\nimport {makeTensor} from './tensor_ops_util';\n\n/**\n * Creates a `tf.Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`. If the values are strings,\n * they will be encoded as utf-8 and kept as `Uint8Array[]`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function tensor(\n values: TensorLike, shape?: ShapeMap[R], dtype?: DataType): Tensor {\n const inferredShape = inferShape(values, dtype);\n return makeTensor(values, shape, inferredShape, dtype) as Tensor;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'float16': 2,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n 'complex64': 8\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * Group to which the weight belongs.\n *\n * - 'optimizer': Weight from a stateful optimizer.\n */\nexport type WeightGroup = 'model'|'optimizer';\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool'|'string'|'complex64';\n\n /**\n * Type of the weight.\n *\n * Optional.\n *\n * The value 'optimizer' indicates the weight belongs to an optimizer\n * (i.e., used only during model training and not during inference).\n */\n group?: WeightGroup;\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale?: number, // The scaling constant to multiply by.\n min?: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8'|'float16' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n * @innamespace io\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * non-trainable ones.\n */\n trainableOnly?: boolean;\n\n /**\n * Whether the optimizer will be saved (if exists).\n *\n * Default: `false`.\n */\n includeOptimizer?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * TODO (cais,yassogba) consider removing GraphDef as GraphDefs now\n * come in a JSON format and none of our IOHandlers support a non json\n * format. We could conder replacing this with 'Binary' if we want to\n * allow future handlers to save to non json formats (though they will\n * probably want more information than 'Binary').\n * Type of the model topology\n *\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocol buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/** Model training configuration. */\nexport declare interface TrainingConfig {\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n // See\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tfjs-layers/blob/master/src/keras_format/training_config.ts\n /** Optimizer used for the model training. */\n optimizer_config: {};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Loss function(s) for the model's output(s). */\n loss: string|string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n /** Metric function(s) for the model's output(s). */\n metrics?: string[]|{[key: string]: string};\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n weighted_metrics?: string[];\n\n // TODO(cais): Tighten the typing once keras spec is available to tfjs-core.\n sample_weight_mode?: string;\n\n loss_weights?: number[]|{[key: string]: number};\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `trainingConfig`, `weightSpecs` and `weightData` fields\n * of this interface are optional, in order to support topology- or weights-only\n * saving and loading.\n *\n * Note this interface is used internally in IOHandlers. For the file format\n * written to disk as `model.json`, see `ModelJSON`.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Serialized configuration for the model's training.\n */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * The on-disk format of the `model.json` file.\n *\n * TF.js 1.0 always populates the optional fields when writing model.json.\n * Prior versions did not provide those fields.\n */\nexport declare interface ModelJSON {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `SavedModel`), this is the JSON\n * encoding of the `GraphDef` protocol buffer.\n */\n modelTopology: {};\n\n /** Model training configuration. */\n trainingConfig?: TrainingConfig;\n\n /**\n * Weights manifest.\n *\n * The weights manifest consists of an ordered list of weight-manifest\n * groups. Each weight-manifest group consists of a number of weight values\n * stored in a number of paths. See the documentation of\n * `WeightsManifestConfig` for more details.\n */\n weightsManifest: WeightsManifestConfig;\n\n /**\n * Hard-coded format name for models saved from TensorFlow.js or converted\n * by TensorFlow.js Converter.\n */\n format?: string;\n\n /**\n * What library is responsible for originally generating this artifact.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.\n */\n generatedBy?: string;\n\n /**\n * What library or tool is responsible for converting the original model\n * to this format, applicable only if the model is output by a converter.\n *\n * Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.\n *\n * A value of `null` means the model artifacts are generated without any\n * conversion process (e.g., saved directly from a TensorFlow.js\n * `tf.LayersModel` instance.)\n */\n convertedBy?: string|null;\n\n /**\n * Inputs and outputs signature for saved model.\n */\n signature?: {};\n\n /**\n * User-defined metadata about the model.\n */\n userDefinedMetadata?: {[key: string]: {}};\n\n /**\n * Initializer for the model.\n */\n modelInitializer?: {};\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n\n/**\n * Callback for the progress of a long-running action such as an HTTP\n * request for a large binary object.\n *\n * `fraction` should be a number in the [0, 1] interval, indicating how\n * much of the action has completed.\n */\nexport type OnProgressCallback = (fraction: number) => void;\n\n/** @innamespace io */\nexport interface LoadOptions {\n /**\n * RequestInit (options) for HTTP requests.\n *\n * For detailed information on the supported fields, see\n * [https://developer.mozilla.org/en-US/docs/Web/API/Request/Request](\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)\n */\n requestInit?: RequestInit;\n\n /**\n * Progress callback.\n */\n onProgress?: OnProgressCallback;\n\n /**\n * A function used to override the `window.fetch` function.\n */\n fetchFunc?: Function;\n\n /**\n * Strict loading model: whether extraneous weights or missing\n * weights should trigger an `Error`.\n *\n * If `true`, require that the provided weights exactly match those\n * required by the layers. `false` means that both extra weights\n * and missing weights will be silently ignored.\n *\n * Default: `true`.\n */\n strict?: boolean;\n\n /**\n * Path prefix for weight files, by default this is calculated from the\n * path of the model JSON file.\n *\n * For instance, if the path to the model JSON file is\n * `http://localhost/foo/model.json`, then the default path prefix will be\n * `http://localhost/foo/`. If a weight file has the path value\n * `group1-shard1of2` in the weight manifest, then the weight file will be\n * loaded from `http://localhost/foo/group1-shard1of2` by default. However,\n * if you provide a `weightPathPrefix` value of\n * `http://localhost/foo/alt-weights`, then the weight file will be loaded\n * from the path `http://localhost/foo/alt-weights/group1-shard1of2` instead.\n */\n weightPathPrefix?: string;\n\n /**\n * Whether the module or model is to be loaded from TF Hub.\n *\n * Setting this to `true` allows passing a TF-Hub module URL, omitting the\n * standard model file name and the query parameters.\n *\n * Default: `false`.\n */\n fromTFHub?: boolean;\n\n /**\n * An async function to convert weight file name to URL. The weight file\n * names are stored in model.json's weightsManifest.paths field. By default we\n * consider weight files are colocated with the model.json file. For example:\n * model.json URL: https://www.google.com/models/1/model.json\n * group1-shard1of1.bin url:\n * https://www.google.com/models/1/group1-shard1of1.bin\n *\n * With this func you can convert the weight file name to any URL.\n */\n weightUrlConverter?: (weightFileName: string) => Promise;\n}\n\n/**\n * Additional options for Platform.fetch\n */\nexport interface RequestDetails {\n /**\n * Is this request for a binary file (as opposed to a json file)\n */\n isBinary?: boolean;\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {complex} from '../ops/complex';\nimport {tensor} from '../ops/tensor';\nimport {NamedTensor, NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\n\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, ModelJSON, WeightGroup, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/** Number of bytes reserved for the length of the string. (32bit integer). */\nconst NUM_BYTES_STRING_LENGTH = 4;\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @param group Group to which the weights belong (optional).\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(\n tensors: NamedTensorMap|NamedTensor[], group?: WeightGroup):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n\n const names: string[] = Array.isArray(tensors) ?\n tensors.map(tensor => tensor.name) :\n Object.keys(tensors);\n\n for (let i = 0; i < names.length; ++i) {\n const name = names[i];\n const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name];\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool' &&\n t.dtype !== 'string' && t.dtype !== 'complex64') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n const spec: WeightsManifestEntry = {name, shape: t.shape, dtype: t.dtype};\n if (t.dtype === 'string') {\n const utf8bytes = new Promise(async resolve => {\n const vals = await t.bytes() as Uint8Array[];\n const totalNumBytes = vals.reduce((p, c) => p + c.length, 0) +\n NUM_BYTES_STRING_LENGTH * vals.length;\n const bytes = new Uint8Array(totalNumBytes);\n let offset = 0;\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n const bytesOfLength =\n new Uint8Array(new Uint32Array([val.length]).buffer);\n bytes.set(bytesOfLength, offset);\n offset += NUM_BYTES_STRING_LENGTH;\n bytes.set(val, offset);\n offset += val.length;\n }\n resolve(bytes);\n });\n dataPromises.push(utf8bytes);\n } else {\n dataPromises.push(t.data());\n }\n if (group != null) {\n spec.group = group;\n }\n specs.push(spec);\n }\n\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let float16Decode: (buffer: Uint16Array) => Float32Array | undefined;\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n const size = sizeFromShape(shape);\n let values: TypedArray|string[]|Uint8Array[];\n\n if ('quantization' in spec) {\n const quantization = spec.quantization;\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n if (!('min' in quantization && 'scale' in quantization)) {\n throw new Error(\n `Weight ${spec.name} with quantization ${quantization.dtype} ` +\n `doesn't have corresponding metadata min and scale.`);\n }\n } else if (quantization.dtype === 'float16') {\n if (dtype !== 'float32') {\n throw new Error(\n `Weight ${spec.name} is quantized with ${quantization.dtype} ` +\n `which only supports weights of type float32 not ${dtype}.`);\n }\n } else {\n throw new Error(\n `Weight ${spec.name} has unknown ` +\n `quantization dtype ${quantization.dtype}. ` +\n `Supported quantization dtypes are: ` +\n `'uint8', 'uint16', and 'float16'.`);\n }\n const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype];\n const byteBuffer =\n buffer.slice(offset, offset + size * quantizationSizeFactor);\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n if (quantization.dtype === 'uint8' || quantization.dtype === 'uint16') {\n values = new Float32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = v * quantization.scale + quantization.min;\n }\n } else if (quantization.dtype === 'float16') {\n if (float16Decode === undefined) {\n float16Decode = getFloat16Decoder();\n }\n values = float16Decode(quantizedArray as Uint16Array);\n } else {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type float32.`);\n }\n } else if (dtype === 'int32') {\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Unsupported quantization type ${quantization.dtype} ` +\n `for weight type int32.`);\n }\n values = new Int32Array(quantizedArray.length);\n for (let i = 0; i < quantizedArray.length; i++) {\n const v = quantizedArray[i];\n values[i] = Math.round(v * quantization.scale + quantization.min);\n }\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * quantizationSizeFactor;\n } else if (dtype === 'string') {\n const size = sizeFromShape(spec.shape);\n values = [];\n for (let i = 0; i < size; i++) {\n const byteLength = new Uint32Array(\n buffer.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0];\n offset += NUM_BYTES_STRING_LENGTH;\n const bytes = new Uint8Array(buffer.slice(offset, offset + byteLength));\n (values as Uint8Array[]).push(bytes);\n offset += byteLength;\n }\n } else {\n const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype];\n const byteBuffer = buffer.slice(offset, offset + size * dtypeFactor);\n\n if (dtype === 'float32') {\n values = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n values = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n values = new Uint8Array(byteBuffer);\n } else if (dtype === 'complex64') {\n values = new Float32Array(byteBuffer);\n const real = new Float32Array(values.length / 2);\n const image = new Float32Array(values.length / 2);\n for (let i = 0; i < real.length; i++) {\n real[i] = values[i * 2];\n image[i] = values[i * 2 + 1];\n }\n const realTensor = tensor(real, shape, 'float32');\n const imageTensor = tensor(image, shape, 'float32');\n out[name] = complex(realTensor, imageTensor);\n realTensor.dispose();\n imageTensor.dispose();\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n offset += size * dtypeFactor;\n }\n if (dtype !== 'complex64') {\n out[name] = tensor(values, shape, dtype);\n }\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n const buf = new Uint8Array(buffer);\n let s = '';\n for (let i = 0, l = buf.length; i < l; i++) {\n s += String.fromCharCode(buf[i]);\n }\n return btoa(s);\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n if (buffers.length === 1) {\n return buffers[0];\n }\n\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Create `ModelJSON` from `ModelArtifacts`.\n *\n * @param artifacts Model artifacts, describing the model and its weights.\n * @param manifest Weight manifest, describing where the weights of the\n * `ModelArtifacts` are stored, and some metadata about them.\n * @returns Object representing the `model.json` file describing the model\n * artifacts and weights\n */\nexport function getModelJSONForModelArtifacts(\n artifacts: ModelArtifacts, manifest: WeightsManifestConfig): ModelJSON {\n const result: ModelJSON = {\n modelTopology: artifacts.modelTopology,\n format: artifacts.format,\n generatedBy: artifacts.generatedBy,\n convertedBy: artifacts.convertedBy,\n weightsManifest: manifest\n };\n if (artifacts.signature != null) {\n result.signature = artifacts.signature;\n }\n if (artifacts.userDefinedMetadata != null) {\n result.userDefinedMetadata = artifacts.userDefinedMetadata;\n }\n if (artifacts.modelInitializer != null) {\n result.modelInitializer = artifacts.modelInitializer;\n }\n if (artifacts.trainingConfig != null) {\n result.trainingConfig = artifacts.trainingConfig;\n }\n return result;\n}\n\n/**\n * Create `ModelArtifacts` from a JSON file.\n *\n * @param modelJSON Object containing the parsed JSON of `model.json`\n * @param loadWeights Function that takes the JSON file's weights manifest,\n * reads weights from the listed path(s), and returns a Promise of the\n * weight manifest entries along with the weights data.\n * @returns A Promise of the `ModelArtifacts`, as described by the JSON file.\n */\nexport async function getModelArtifactsForJSON(\n modelJSON: ModelJSON,\n loadWeights: (weightsManifest: WeightsManifestConfig) => Promise<[\n /* weightSpecs */ WeightsManifestEntry[], /* weightData */ ArrayBuffer\n ]>): Promise {\n const modelArtifacts: ModelArtifacts = {\n modelTopology: modelJSON.modelTopology,\n format: modelJSON.format,\n generatedBy: modelJSON.generatedBy,\n convertedBy: modelJSON.convertedBy\n };\n\n if (modelJSON.trainingConfig != null) {\n modelArtifacts.trainingConfig = modelJSON.trainingConfig;\n }\n if (modelJSON.weightsManifest != null) {\n const [weightSpecs, weightData] =\n await loadWeights(modelJSON.weightsManifest);\n modelArtifacts.weightSpecs = weightSpecs;\n modelArtifacts.weightData = weightData;\n }\n if (modelJSON.signature != null) {\n modelArtifacts.signature = modelJSON.signature;\n }\n if (modelJSON.userDefinedMetadata != null) {\n modelArtifacts.userDefinedMetadata = modelJSON.userDefinedMetadata;\n }\n if (modelJSON.modelInitializer != null) {\n modelArtifacts.modelInitializer = modelJSON.modelInitializer;\n }\n\n return modelArtifacts;\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n\n/**\n * Computes mantisa table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 2048 mantissa lookup values.\n */\nfunction computeFloat16MantisaTable(): Uint32Array {\n const convertMantissa = (i: number): number => {\n let m = i << 13;\n let e = 0;\n\n while ((m & 0x00800000) === 0) {\n e -= 0x00800000;\n m <<= 1;\n }\n m &= ~0x00800000;\n e += 0x38800000;\n\n return m | e;\n };\n\n const mantisaTable = new Uint32Array(2048);\n\n mantisaTable[0] = 0;\n for (let i = 1; i < 1024; i++) {\n mantisaTable[i] = convertMantissa(i);\n }\n for (let i = 1024; i < 2048; i++) {\n mantisaTable[i] = 0x38000000 + ((i - 1024) << 13);\n }\n\n return mantisaTable;\n}\n\n/**\n * Computes exponent table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 64 exponent lookup values.\n */\nfunction computeFloat16ExponentTable(): Uint32Array {\n const exponentTable = new Uint32Array(64);\n\n exponentTable[0] = 0;\n exponentTable[31] = 0x47800000;\n exponentTable[32] = 0x80000000;\n exponentTable[63] = 0xc7800000;\n for (let i = 1; i < 31; i++) {\n exponentTable[i] = i << 23;\n }\n for (let i = 33; i < 63; i++) {\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\n }\n\n return exponentTable;\n}\n\n/**\n * Computes offset table for casting Float16 to Float32\n * See http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n *\n * @returns Uint32Array, 6d offset values.\n */\nfunction computeFloat16OffsetTable(): Uint32Array {\n const offsetTable = new Uint32Array(64);\n\n for (let i = 0; i < 64; i++) {\n offsetTable[i] = 1024;\n }\n offsetTable[0] = offsetTable[32] = 0;\n\n return offsetTable;\n}\n\n/**\n * Retrieve a Float16 decoder which will decode a ByteArray of Float16 values\n * to a Float32Array.\n *\n * @returns Function (buffer: Uint16Array) => Float32Array which decodes\n * the Uint16Array of Float16 bytes to a Float32Array.\n */\nexport function getFloat16Decoder(): (buffer: Uint16Array) => Float32Array {\n // Algorithm is based off of\n // http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\n // Cache lookup tables\n const mantisaTable = computeFloat16MantisaTable();\n const exponentTable = computeFloat16ExponentTable();\n const offsetTable = computeFloat16OffsetTable();\n\n return (quantizedArray: Uint16Array) => {\n const buffer = new ArrayBuffer(4 * quantizedArray.length);\n const bufferUint32View = new Uint32Array(buffer);\n for (let index = 0; index < quantizedArray.length; index++) {\n const float16Bits = quantizedArray[index];\n const float32Bits =\n mantisaTable[offsetTable[float16Bits >> 10] + (float16Bits & 0x3ff)] +\n exponentTable[float16Bits >> 10];\n bufferUint32View[index] = float32Bits;\n }\n return new Float32Array(buffer);\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler, LoadOptions} from './types';\n\nexport type IORouter = (url: string|string[], loadOptions?: LoadOptions) =>\n IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string|string[]): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @param loadOptions Optional, custom load options.\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string|string[], loadOptions?: LoadOptions):\n IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load', loadOptions);\n }\n\n private static getHandlers(\n url: string|string[], handlerType: 'save'|'load',\n loadOptions?: LoadOptions): IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ?\n IORouterRegistry.getInstance().loadRouters :\n IORouterRegistry.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url, loadOptions);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n\nexport const registerSaveRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerSaveRouter(loudRouter);\nexport const registerLoadRouter = (loudRouter: IORouter) =>\n IORouterRegistry.registerLoadRouter(loudRouter);\nexport const getSaveHandlers = (url: string|string[]) =>\n IORouterRegistry.getSaveHandlers(url);\nexport const getLoadHandlers =\n (url: string|string[], loadOptions?: LoadOptions) =>\n IORouterRegistry.getLoadHandlers(url, loadOptions);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\n\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = typeof window === 'undefined' ? self : window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelJSON, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\nconst MODEL_METADATA_SUFFIX = 'model_metadata';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\ntype LocalStorageKeys = {\n /** Key of the localStorage entry storing `ModelArtifactsInfo`. */\n info: string,\n /**\n * Key of the localStorage entry storing the 'modelTopology' key of\n * `model.json`\n */\n topology: string,\n /**\n * Key of the localStorage entry storing the `weightsManifest.weights` entries\n * of `model.json`\n */\n weightSpecs: string,\n /** Key of the localStorage entry storing the weight data in Base64 */\n weightData: string,\n /**\n * Key of the localStorage entry storing the remaining fields of `model.json`\n * @see {@link ModelMetadata}\n */\n modelMetadata: string,\n};\n\ntype ModelMetadata = Omit;\n\nfunction getModelKeys(path: string): LocalStorageKeys {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR),\n modelMetadata:\n [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\nfunction removeItems(keys: LocalStorageKeys): void {\n for (const key of Object.values(keys)) {\n window.localStorage.removeItem(key);\n }\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: LocalStorageKeys;\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!env().getBool('IS_BROWSER') || typeof window === 'undefined' ||\n typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n\n // Note that JSON.stringify doesn't write out keys that have undefined\n // values, so for some keys, we set undefined instead of a null-ish\n // value.\n const metadata: Required = {\n format: modelArtifacts.format,\n generatedBy: modelArtifacts.generatedBy,\n convertedBy: modelArtifacts.convertedBy,\n signature: modelArtifacts.signature != null ?\n modelArtifacts.signature :\n undefined,\n userDefinedMetadata: modelArtifacts.userDefinedMetadata != null ?\n modelArtifacts.userDefinedMetadata :\n undefined,\n modelInitializer: modelArtifacts.modelInitializer != null ?\n modelArtifacts.modelInitializer :\n undefined,\n trainingConfig: modelArtifacts.trainingConfig != null ?\n modelArtifacts.trainingConfig :\n undefined\n };\n this.LS.setItem(this.keys.modelMetadata, JSON.stringify(metadata));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n removeItems(this.keys);\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load meta-data fields.\n const metadataString = this.LS.getItem(this.keys.modelMetadata);\n if (metadataString != null) {\n const metadata = JSON.parse(metadataString) as ModelMetadata;\n out.format = metadata.format;\n out.generatedBy = metadata.generatedBy;\n out.convertedBy = metadata.convertedBy;\n if (metadata.signature != null) {\n out.signature = metadata.signature;\n }\n if (metadata.userDefinedMetadata != null) {\n out.userDefinedMetadata = metadata.userDefinedMetadata;\n }\n if (metadata.modelInitializer != null) {\n out.modelInitializer = metadata.modelInitializer;\n }\n if (metadata.trainingConfig != null) {\n out.trainingConfig = metadata.trainingConfig;\n }\n }\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(\n env().getBool('IS_BROWSER'),\n () => 'Current environment is not a web browser');\n assert(\n typeof window === 'undefined' ||\n typeof window.localStorage !== 'undefined',\n () => 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n removeItems(keys);\n return info;\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, () => 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, () => 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n () => `A model store manager is already registered for scheme '${\n scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n () => `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n () => `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n () => `Copying failed because no save handler is found for destination ` +\n `URL ${destURL}.`);\n assert(\n saveHandlers.length < 2,\n () => `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Management',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '../flags';\n\nimport {env} from '../environment';\nimport {BrowserIndexedDB, BrowserIndexedDBManager} from '../io/indexed_db';\nimport {BrowserLocalStorage, BrowserLocalStorageManager} from '../io/local_storage';\nimport {ModelStoreManagerRegistry} from '../io/model_management';\n\nimport {Platform} from './platform';\n\nexport class PlatformBrowser implements Platform {\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n private textEncoder: TextEncoder;\n\n fetch(path: string, init?: RequestInit): Promise {\n return fetch(path, init);\n }\n\n now(): number {\n return performance.now();\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Browser's encoder only supports utf-8, but got ${encoding}`);\n }\n if (this.textEncoder == null) {\n this.textEncoder = new TextEncoder();\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n return new TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_BROWSER')) {\n env().setPlatform('browser', new PlatformBrowser());\n\n // Register LocalStorage IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n\n // Register IndexedDB IOHandler\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {env} from '../environment';\n\nimport {Platform} from './platform';\n\n// We are wrapping this within an object so it can be stubbed by Jasmine.\nexport const getNodeFetch = {\n // tslint:disable-next-line:no-require-imports\n importFetch: () => require('node-fetch')\n};\n\ntype FetchFn = (url: string, init?: RequestInit) => Promise;\nlet systemFetch: FetchFn;\n// These getters and setters are for testing so we don't export a mutable\n// variable.\nexport function resetSystemFetch() {\n systemFetch = null;\n}\nexport function setSystemFetch(fetchFn: FetchFn) {\n systemFetch = fetchFn;\n}\nexport function getSystemFetch(): FetchFn {\n return systemFetch;\n}\n\nexport class PlatformNode implements Platform {\n private textEncoder: TextEncoder;\n // tslint:disable-next-line:no-any\n util: any;\n\n constructor() {\n // tslint:disable-next-line:no-require-imports\n this.util = require('util');\n // According to the spec, the built-in encoder can do only UTF-8 encoding.\n // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder\n this.textEncoder = new this.util.TextEncoder();\n }\n\n fetch(path: string, requestInits?: RequestInit): Promise {\n if (env().global.fetch != null) {\n return env().global.fetch(path, requestInits);\n }\n\n if (systemFetch == null) {\n systemFetch = getNodeFetch.importFetch();\n }\n return systemFetch(path, requestInits);\n }\n\n now(): number {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n }\n\n encode(text: string, encoding: string): Uint8Array {\n if (encoding !== 'utf-8' && encoding !== 'utf8') {\n throw new Error(\n `Node built-in encoder only supports utf-8, but got ${encoding}`);\n }\n return this.textEncoder.encode(text);\n }\n decode(bytes: Uint8Array, encoding: string): string {\n if (bytes.length === 0) {\n return '';\n }\n return new this.util.TextDecoder(encoding).decode(bytes);\n }\n}\n\nif (env().get('IS_NODE')) {\n env().setPlatform('node', new PlatformNode());\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {TensorBuffer} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap} from '../types';\nimport * as util from '../util';\n\n/**\n * Creates an empty `tf.TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in CPU as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `tf.Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function buffer(\n shape: ShapeMap[R], dtype: D = 'float32' as D,\n values?: DataTypeMap[D]): TensorBuffer {\n dtype = dtype || 'float32' as D;\n util.assertNonNegativeIntegerDimensions(shape);\n return new TensorBuffer(shape, dtype, values);\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {Cast, CastAttrs, CastInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {DataType, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Casts a `tf.Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n *\n * @doc {heading: 'Tensors', subheading: 'Transformations'}\n */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n // Sanity checks.\n if (!util.isValidDtype(dtype)) {\n throw new Error(`Failed to cast to unknown dtype ${dtype}`);\n }\n if (dtype === 'string' && $x.dtype !== 'string' ||\n dtype !== 'string' && $x.dtype === 'string') {\n throw new Error('Only strings can be casted to strings');\n }\n\n const inputs: CastInputs = {x: $x};\n const attrs: CastAttrs = {dtype};\n\n return ENGINE.runKernel(\n Cast, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const cast = op({cast_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Identity, IdentityInputs} from '../kernel_names';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone', 'string_or_numeric');\n const inputs: IdentityInputs = {x: $x};\n\n // Note this op is called tf.identity in python. Hence the kernel name used\n // here.\n return ENGINE.runKernel(Identity, inputs as {} as NamedTensorMap);\n}\n\nexport const clone = op({clone_});\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\n\n/**\n * Prints information about the `tf.Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nexport function print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n", "/**\n * @license\n * Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Required side effectful code for tfjs-core\n\n// Set up Engine and ENV\nimport {getOrMakeEngine} from './engine';\ngetOrMakeEngine();\n\n// Register backend-agnostic flags.\nimport './flags';\n// Register platforms\nimport './platforms/platform_browser';\nimport './platforms/platform_node';\n\n// Set up OpHandler\nimport {buffer} from './ops/buffer';\nimport {cast} from './ops/cast';\nimport {clone} from './ops/clone';\nimport {print} from './ops/print';\nimport {OpHandler, setOpHandler} from './tensor';\nconst opHandler: OpHandler = {\n buffer,\n cast,\n clone,\n print\n};\nsetOpHandler(opHandler);\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest, http, isHTTPScheme} from './http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsForJSON, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {getLoadHandlers, getSaveHandlers, registerLoadRouter, registerSaveRouter} from './router_registry';\nimport {IOHandler, LoadHandler, LoadOptions, ModelArtifacts, ModelArtifactsInfo, ModelJSON, ModelStoreManager, OnProgressCallback, RequestDetails, SaveConfig, SaveHandler, SaveResult, TrainingConfig, WeightGroup, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights, weightsLoaderFactory} from './weights_loader';\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsForJSON,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n http,\n IOHandler,\n isHTTPScheme,\n LoadHandler,\n LoadOptions,\n loadWeights,\n ModelArtifacts,\n ModelArtifactsInfo,\n ModelJSON,\n ModelStoreManager,\n OnProgressCallback,\n registerLoadRouter,\n registerSaveRouter,\n RequestDetails,\n SaveConfig,\n SaveHandler,\n SaveResult,\n TrainingConfig,\n WeightGroup,\n weightsLoaderFactory,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport '../flags';\nimport {env} from '../environment';\n\nimport {basename, concatenateArrayBuffers, getModelArtifactsForJSON, getModelArtifactsInfoForJSON, getModelJSONForModelArtifacts} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelJSON, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nfunction defer(f: () => T): Promise {\n return new Promise(resolve => setTimeout(resolve)).then(f);\n}\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelJsonFileName: string;\n private readonly weightDataFileName: string;\n private readonly modelJsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!env().getBool('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'browserDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelJsonFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (typeof (document) === 'undefined') {\n throw new Error(\n 'Browser downloads are not supported in ' +\n 'this environment since `document` is not present');\n }\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserDownloads.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelJSON: ModelJSON =\n getModelJSONForModelArtifacts(modelArtifacts, weightsManifest);\n\n const modelJsonURL = window.URL.createObjectURL(\n new Blob([JSON.stringify(modelJSON)], {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.modelJsonAnchor == null ?\n document.createElement('a') :\n this.modelJsonAnchor;\n jsonAnchor.download = this.modelJsonFileName;\n jsonAnchor.href = modelJsonURL;\n // Trigger downloads by evoking a click event on the download anchors.\n // When multiple downloads are started synchronously, Firefox will only\n // save the last one.\n await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click')));\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n await defer(\n () => weightDataAnchor.dispatchEvent(new MouseEvent('click')));\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly jsonFile: File;\n private readonly weightsFiles: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.jsonFile = files[0];\n this.weightsFiles = files.slice(1);\n }\n\n async load(): Promise {\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result) as ModelJSON;\n\n const modelTopology = modelJSON.modelTopology;\n if (modelTopology == null) {\n reject(new Error(`modelTopology field is missing from file ${\n this.jsonFile.name}`));\n return;\n }\n\n const weightsManifest = modelJSON.weightsManifest;\n if (weightsManifest == null) {\n reject(new Error(`weightManifest field is missing from file ${\n this.jsonFile.name}`));\n return;\n }\n\n if (this.weightsFiles.length === 0) {\n resolve({modelTopology});\n return;\n }\n\n const modelArtifactsPromise = getModelArtifactsForJSON(\n modelJSON, (weightsManifest) => this.loadWeights(weightsManifest));\n resolve(modelArtifactsPromise);\n };\n\n jsonReader.onerror = error => reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${this.jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n jsonReader.readAsText(this.jsonFile);\n });\n }\n\n private loadWeights(weightsManifest: WeightsManifestConfig): Promise<[\n /* weightSpecs */ WeightsManifestEntry[], /* weightData */ ArrayBuffer\n ]> {\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n paths.push(...entry.paths);\n }\n\n const pathToFile: {[path: string]: File} =\n this.checkManifestAndWeightFiles(weightsManifest);\n\n const promises: Array> =\n paths.map(path => this.loadWeightsFile(path, pathToFile[path]));\n\n return Promise.all(promises).then(\n buffers => [weightSpecs, concatenateArrayBuffers(buffers)]);\n }\n\n private loadWeightsFile(path: string, file: File): Promise {\n return new Promise((resolve, reject) => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n resolve(weightData);\n };\n weightFileReader.onerror = error =>\n reject(`Failed to weights data from file of path '${path}'.`);\n weightFileReader.readAsArrayBuffer(file);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(manifest: WeightsManifestConfig):\n {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = this.weightsFiles.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = this.weightsFiles[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== this.weightsFiles.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${this.weightsFiles.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string|string[]) => {\n if (!env().getBool('IS_BROWSER')) {\n return null;\n } else {\n if (!Array.isArray(url) && url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel');\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `BrowserDownloads` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tf.loadLayersModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {assert} from '../util';\n\nimport {OnProgressCallback} from './types';\n\n/**\n * Monitor Promise.all progress, fire onProgress callback function.\n *\n * @param promises Promise list going to be monitored\n * @param onProgress Callback function. Fired when a promise resolved.\n * @param startFraction Optional fraction start. Default to 0.\n * @param endFraction Optional fraction end. Default to 1.\n */\nexport function monitorPromisesProgress(\n promises: Array>, onProgress: OnProgressCallback,\n startFraction?: number, endFraction?: number) {\n checkPromises(promises);\n startFraction = startFraction == null ? 0 : startFraction;\n endFraction = endFraction == null ? 1 : endFraction;\n checkFraction(startFraction, endFraction);\n let resolvedPromise = 0;\n\n const registerMonitor = (promise: Promise<{}>) => {\n promise.then(value => {\n const fraction = startFraction +\n ++resolvedPromise / promises.length * (endFraction - startFraction);\n // pass fraction as parameter to callback function.\n onProgress(fraction);\n return value;\n });\n return promise;\n };\n\n function checkPromises(promises: Array>): void {\n assert(\n promises != null && Array.isArray(promises) && promises.length > 0,\n () => 'promises must be a none empty array');\n }\n\n function checkFraction(startFraction: number, endFraction: number): void {\n assert(\n startFraction >= 0 && startFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got startFraction ${startFraction}`);\n assert(\n endFraction >= 0 && endFraction <= 1,\n () => `Progress fraction must be in range [0, 1], but ` +\n `got endFraction ${endFraction}`);\n assert(\n endFraction >= startFraction,\n () => `startFraction must be no more than endFraction, but ` +\n `got startFraction ${startFraction} and endFraction ` +\n `${endFraction}`);\n }\n\n return Promise.all(promises.map(registerMonitor));\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {env} from '../environment';\n\nimport {NamedTensorMap} from '../tensor_types';\nimport * as util from '../util';\nimport {decodeWeights} from './io_utils';\nimport {monitorPromisesProgress} from './progress';\nimport {DTYPE_VALUE_SIZE_MAP, LoadOptions, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @param fetchFunc Optional overriding value for the `window.fetch` function.\n * @param onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], loadOptions?: LoadOptions): Promise {\n if (loadOptions == null) {\n loadOptions = {};\n }\n\n const fetchFunc = loadOptions.fetchFunc == null ? env().platform.fetch :\n loadOptions.fetchFunc;\n\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(\n fetchURL =>\n fetchFunc(fetchURL, loadOptions.requestInit, {isBinary: true}));\n\n const fetchStartFraction = 0;\n const fetchEndFraction = 0.5;\n\n const responses = loadOptions.onProgress == null ?\n await Promise.all(requests) :\n await monitorPromisesProgress(\n requests, loadOptions.onProgress, fetchStartFraction,\n fetchEndFraction);\n\n const bufferPromises = responses.map(response => response.arrayBuffer());\n\n const bufferStartFraction = 0.5;\n const bufferEndFraction = 1;\n\n const buffers = loadOptions.onProgress == null ?\n await Promise.all(bufferPromises) :\n await monitorPromisesProgress(\n bufferPromises, loadOptions.onProgress, bufferStartFraction,\n bufferEndFraction);\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestInit?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n const fetchWeights = (fetchUrls: string[]) =>\n loadWeightsAsArrayBuffer(fetchUrls, {requestInit});\n const loadWeights = weightsLoaderFactory(fetchWeights);\n\n return loadWeights(manifest, filePathPrefix, weightNames);\n}\n\n/**\n * Creates a function, which reads a weights manifest JSON configuration,\n * fetches the weight files using the specified function and returns them as\n * `Tensor`s.\n *\n * ```js\n * // example for creating a nodejs weight loader, which reads the weight files\n * // from disk using fs.readFileSync\n *\n * import * as fs from 'fs'\n *\n * const fetchWeightsFromDisk = (filePaths: string[]) =>\n * filePaths.map(filePath => fs.readFileSync(filePath).buffer)\n *\n * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk)\n *\n * const manifest = JSON.parse(\n * fs.readFileSync('./my_model-weights_manifest').toString()\n * )\n * const weightMap = await loadWeights(manifest, './')\n * ```\n * @param fetchWeightsFunction The function used for fetching the weight files.\n * @returns Weight loading function.\n */\nexport function weightsLoaderFactory(\n fetchWeightsFunction: (fetchUrls: string[]) => Promise):\n (manifest: WeightsManifestConfig, filePathPrefix?: string,\n weightNames?: string[]) => Promise {\n return async(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[]): Promise => {\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound =\n weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await fetchWeightsFunction(fetchUrls);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n const nameToTensorMap =\n decodeWeights(byteBuffer, [weightsEntry.manifestEntry]);\n for (const name in nameToTensorMap) {\n weightsTensorMap[name] = nameToTensorMap[name];\n }\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n };\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {env} from '../environment';\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsForJSON, getModelArtifactsInfoForJSON, getModelJSONForModelArtifacts} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadOptions, ModelArtifacts, ModelJSON, OnProgressCallback, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nconst OCTET_STREAM_MIME_TYPE = 'application/octet-stream';\nconst JSON_TYPE = 'application/json';\nexport class HTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n private readonly fetch: Function;\n private readonly weightUrlConverter: (weightName: string) => Promise;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEME_REGEX = /^https?:\\/\\//;\n\n private readonly weightPathPrefix: string;\n private readonly onProgress: OnProgressCallback;\n\n constructor(path: string, loadOptions?: LoadOptions) {\n if (loadOptions == null) {\n loadOptions = {};\n }\n this.weightPathPrefix = loadOptions.weightPathPrefix;\n this.onProgress = loadOptions.onProgress;\n this.weightUrlConverter = loadOptions.weightUrlConverter;\n\n if (loadOptions.fetchFunc != null) {\n assert(\n typeof loadOptions.fetchFunc === 'function',\n () => 'Must pass a function that matches the signature of ' +\n '`fetch` (see ' +\n 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)');\n this.fetch = loadOptions.fetchFunc;\n } else {\n this.fetch = env().platform.fetch;\n }\n\n assert(\n path != null && path.length > 0,\n () => 'URL path for http must not be null, undefined or ' +\n 'empty.');\n\n if (Array.isArray(path)) {\n assert(\n path.length === 2,\n () => 'URL paths for http must have a length of 2, ' +\n `(actual length is ${path.length}).`);\n }\n this.path = path;\n\n if (loadOptions.requestInit != null &&\n loadOptions.requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = loadOptions.requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest: ModelJSON =\n getModelJSONForModelArtifacts(modelArtifacts, weightsManifest);\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: JSON_TYPE}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob([modelArtifacts.weightData], {type: OCTET_STREAM_MIME_TYPE}),\n 'model.weights.bin');\n }\n\n const response = await this.fetch(this.path, init);\n\n if (response.ok) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `tf.io.http` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await this.fetch(this.path, this.requestInit);\n\n if (!modelConfigRequest.ok) {\n throw new Error(\n `Request to ${this.path} failed with status code ` +\n `${modelConfigRequest.status}. Please verify this URL points to ` +\n `the model JSON of the model to load.`);\n }\n let modelJSON: ModelJSON;\n try {\n modelJSON = await modelConfigRequest.json();\n } catch (e) {\n let message = `Failed to parse model JSON of response from ${this.path}.`;\n // TODO(nsthorat): Remove this after some time when we're comfortable that\n // .pb files are mostly gone.\n if (this.path.endsWith('.pb')) {\n message += ' Your path contains a .pb file extension. ' +\n 'Support for .pb models have been removed in TensorFlow.js 1.0 ' +\n 'in favor of .json models. You can re-convert your Python ' +\n 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' +\n 'or you can convert your.pb models with the \\'pb2json\\'' +\n 'NPM script in the tensorflow/tfjs-converter repository.';\n } else {\n message += ' Please make sure the server is serving valid ' +\n 'JSON for this request.';\n }\n throw new Error(message);\n }\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n const modelTopology = modelJSON.modelTopology;\n const weightsManifest = modelJSON.weightsManifest;\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n return getModelArtifactsForJSON(\n modelJSON, (weightsManifest) => this.loadWeights(weightsManifest));\n }\n\n private async loadWeights(weightsManifest: WeightsManifestConfig):\n Promise<[WeightsManifestEntry[], ArrayBuffer]> {\n const weightPath = Array.isArray(this.path) ? this.path[1] : this.path;\n const [prefix, suffix] = parseUrl(weightPath);\n const pathPrefix = this.weightPathPrefix || prefix;\n\n const weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n const fetchURLs: string[] = [];\n const urlPromises: Array> = [];\n for (const weightsGroup of weightsManifest) {\n for (const path of weightsGroup.paths) {\n if (this.weightUrlConverter != null) {\n urlPromises.push(this.weightUrlConverter(path));\n } else {\n fetchURLs.push(pathPrefix + path + suffix);\n }\n }\n }\n\n if (this.weightUrlConverter) {\n fetchURLs.push(...await Promise.all(urlPromises));\n }\n\n const buffers = await loadWeightsAsArrayBuffer(fetchURLs, {\n requestInit: this.requestInit,\n fetchFunc: this.fetch,\n onProgress: this.onProgress\n });\n return [weightSpecs, concatenateArrayBuffers(buffers)];\n }\n}\n\n/**\n * Extract the prefix and suffix of the url, where the prefix is the path before\n * the last file, and suffix is the search params after the last file.\n * ```\n * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file'\n * [prefix, suffix] = parseUrl(url)\n * // prefix = 'http://tfhub.dev/model/1/'\n * // suffix = '?tfjs-format=file'\n * ```\n * @param url the model url to be parsed.\n */\nexport function parseUrl(url: string): [string, string] {\n const lastSlash = url.lastIndexOf('/');\n const lastSearchParam = url.lastIndexOf('?');\n const prefix = url.substring(0, lastSlash);\n const suffix =\n lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';\n return [prefix + '/', suffix];\n}\n\nexport function isHTTPScheme(url: string): boolean {\n return url.match(HTTPRequest.URL_SCHEME_REGEX) != null;\n}\n\nexport const httpRouter: IORouter =\n (url: string, loadOptions?: LoadOptions) => {\n if (typeof fetch === 'undefined' &&\n (loadOptions == null || loadOptions.fetchFunc == null)) {\n // `http` uses `fetch` or `node-fetch`, if one wants to use it in\n // an environment that is not the browser or node they have to setup a\n // global fetch polyfill.\n return null;\n } else {\n let isHTTP = true;\n if (Array.isArray(url)) {\n isHTTP = url.every(urlItem => isHTTPScheme(urlItem));\n } else {\n isHTTP = isHTTPScheme(url);\n }\n if (isHTTP) {\n return http(url, loadOptions);\n }\n }\n return null;\n };\nIORouterRegistry.registerSaveRouter(httpRouter);\nIORouterRegistry.registerLoadRouter(httpRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.http(\n * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following GitHub Gist\n * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864\n * implements a server based on [flask](https://github.com/pallets/flask) that\n * can receive the request. Upon receiving the model artifacts via the requst,\n * this particular server reconsistutes instances of [Keras\n * Models](https://keras.io/models/model/) in memory.\n *\n *\n * @param path A URL path to the model.\n * Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the\n * body will be set by TensorFlow.js. File blobs representing the model\n * topology (filename: 'model.json') and the weights of the model (filename:\n * 'model.weights.bin') will be appended to the body. If `requestInit` has a\n * `body`, an Error will be thrown.\n * @param loadOptions Optional configuration for the loading. It includes the\n * following fields:\n * - weightPathPrefix Optional, this specifies the path prefix for weight\n * files, by default this is calculated from the path param.\n * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js,\n * the `fetch` from node-fetch can be used here.\n * - onProgress Optional, progress callback function, fired periodically\n * before the load is completed.\n * @returns An instance of `IOHandler`.\n *\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * namespace: 'io',\n * ignoreCI: true\n * }\n */\nexport function http(path: string, loadOptions?: LoadOptions): IOHandler {\n return new HTTPRequest(path, loadOptions);\n}\n\n/**\n * Deprecated. Use `tf.io.http`.\n * @param path\n * @param loadOptions\n */\nexport function browserHTTPRequest(\n path: string, loadOptions?: LoadOptions): IOHandler {\n return http(path, loadOptions);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, TrainingConfig, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(private readonly modelArtifacts?: ModelArtifacts) {}\n\n async load(): Promise {\n return this.modelArtifacts;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler:\n (artifacts: ModelArtifacts) => Promise) {}\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadLayersModel`, an instance of\n * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadLayersModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelArtifacts a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n * @param trainingConfig Model training configuration. Optional.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelArtifacts: {}|ModelArtifacts, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer, trainingConfig?: TrainingConfig): IOHandler {\n if (arguments.length === 1) {\n const isModelArtifacts =\n (modelArtifacts as ModelArtifacts).modelTopology != null ||\n (modelArtifacts as ModelArtifacts).weightSpecs != null;\n if (isModelArtifacts) {\n return new PassthroughLoader(modelArtifacts as ModelArtifacts);\n } else {\n // Legacy support: with only modelTopology.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({modelTopology: modelArtifacts as {}});\n }\n } else {\n // Legacy support.\n // TODO(cais): Remove this deprecated API.\n console.warn(\n 'Please call tf.io.fromMemory() with only one argument. ' +\n 'The argument should be of type ModelArtifacts. ' +\n 'The multi-argument signature of tf.io.fromMemory() has been ' +\n 'deprecated and will be removed in a future release.');\n return new PassthroughLoader({\n modelTopology: modelArtifacts as {},\n weightSpecs,\n weightData,\n trainingConfig\n });\n }\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) =>\n Promise): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Exports under the tf.math.* namespace.\n */\n\nimport {confusionMatrix} from './ops/confusion_matrix';\n\nexport {confusionMatrix};\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENGINE} from '../engine';\nimport {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {makeTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction matMul_(\n a: Tensor|TensorLike, b: Tensor|TensorLike, transposeA = false,\n transposeB = false): T {\n let $a = convertToTensor(a, 'a', 'matMul');\n let $b = convertToTensor(b, 'b', 'matMul');\n [$a, $b] = makeTypesMatch($a, $b);\n\n const inputs: BatchMatMulInputs = {a: $a, b: $b};\n const attrs: BatchMatMulAttrs = {transposeA, transposeB};\n\n return ENGINE.runKernel(\n BatchMatMul, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const matMul = op({matMul_});\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {OneHot, OneHotAttrs, OneHotInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\n\nimport {op} from './operation';\n\n/**\n * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank\n * `R+1` with the last axis of size `depth`.\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `tf.Tensor` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in the output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n *\n * @doc {heading: 'Tensors', subheading: 'Creation'}\n */\nfunction oneHot_(\n indices: Tensor|TensorLike, depth: number, onValue = 1,\n offValue = 0): Tensor {\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n\n const inputs: OneHotInputs = {indices: $indices};\n const attrs: OneHotAttrs = {depth, onValue, offValue};\n\n return ENGINE.runKernel(\n OneHot, inputs as unknown as NamedTensorMap,\n attrs as unknown as NamedAttrMap);\n}\n\nexport const oneHot = op({oneHot_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {Transpose, TransposeAttrs, TransposeInputs} from '../kernel_names';\nimport {NamedAttrMap} from '../kernel_registry';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\n\n/**\n * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `tf.Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `tf.Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n *\n * @doc {heading: 'Operations', subheading: 'Matrices'}\n */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n () => `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const inputs: TransposeInputs = {x: $x};\n const attrs: TransposeAttrs = {perm};\n\n return ENGINE.runKernel(\n Transpose, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap);\n}\n\nexport const transpose = op({transpose_});\n", "/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {cast} from './cast';\nimport {matMul} from './mat_mul';\nimport {oneHot} from './one_hot';\nimport {op} from './operation';\nimport {transpose} from './transpose';\n\n/**\n * Computes the confusion matrix from true labels and predicted labels.\n *\n * ```js\n * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32');\n * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32');\n * const numClasses = 3;\n * const out = tf.math.confusionMatrix(labels, predictions, numClasses);\n * out.print();\n * // Expected output matrix:\n * // [[2, 0, 0],\n * // [0, 1, 1],\n * // [0, 0, 1]]\n * ```\n *\n * @param labels The target labels, assumed to be 0-based integers\n * for the classes. The shape is `[numExamples]`, where\n * `numExamples` is the number of examples included.\n * @param predictions The predicted classes, assumed to be\n * 0-based integers for the classes. Must have the same shape as `labels`.\n * @param numClasses Number of all classes, as an integer.\n * Its value must be larger than the largest element in `labels` and\n * `predictions`.\n * @returns The confusion matrix as a int32-type 2D tensor. The value at\n * row `r` and column `c` is the number of times examples of actual class\n * `r` were predicted as class `c`.\n *\n * @doc {heading: 'Operations', subheading: 'Evaluation'}\n */\nexport function confusionMatrix_(\n labels: Tensor1D|TensorLike, predictions: Tensor1D|TensorLike,\n numClasses: number): Tensor2D {\n const $labels = convertToTensor(labels, 'labels', 'confusionMatrix');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'confusionMatrix');\n\n util.assert(\n numClasses == null || numClasses > 0 && Number.isInteger(numClasses),\n () => `If provided, numClasses must be a positive integer, ` +\n `but got ${numClasses}`);\n util.assert(\n $labels.rank === 1,\n () => `Expected the rank of labels to be 1, but got ${$labels.rank}`);\n util.assert(\n $predictions.rank === 1,\n () => `Expected the rank of predictions to be 1, ` +\n `but got ${$predictions.rank}`);\n util.assert(\n $labels.shape[0] === $predictions.shape[0],\n () => `Mismatch in the number of examples: ` +\n `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` +\n `Labels and predictions should have the same number of elements.`);\n util.assert(\n numClasses > 0 && Number.isInteger(numClasses),\n () => `numClasses is required to be a positive integer, but got ` +\n `${numClasses}`);\n // TODO(cais): In the future, if oneHot supports tensors inputs for\n // `numClasses`, `confusionMatrix` can make `numClasses` optional.\n\n const oneHotLabels = oneHot(cast($labels, 'int32'), numClasses) as Tensor2D;\n const oneHotPredictions =\n oneHot(cast($predictions, 'int32'), numClasses) as Tensor2D;\n const oneHotLabelsT: Tensor2D = transpose(oneHotLabels);\n const product: Tensor2D = matMul(oneHotLabelsT, oneHotPredictions);\n return cast(product, 'int32');\n}\n\nexport const confusionMatrix = op({confusionMatrix_});\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENGINE} from '../engine';\nimport {env} from '../environment';\nimport {FromPixels, FromPixelsAttrs, FromPixelsInputs} from '../kernel_names';\nimport {getKernel, NamedAttrMap} from '../kernel_registry';\nimport {Tensor, Tensor2D, Tensor3D} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {convertToTensor} from '../tensor_util_env';\nimport {PixelData, TensorLike} from '../types';\n\nimport {cast} from './cast';\nimport {op} from './operation';\nimport {tensor3d} from './tensor3d';\n\nlet fromPixels2DContext: CanvasRenderingContext2D;\n\n/**\n * Creates a `tf.Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.browser.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel. You can also pass in an image\n * object with following attributes:\n * `{data: Uint8Array; width: number; height: number}`\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n *\n * @returns A Tensor3D with the shape `[height, width, numChannels]`.\n *\n * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true}\n */\nfunction fromPixels_(\n pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement|\n HTMLVideoElement|ImageBitmap,\n numChannels = 3): Tensor3D {\n // Sanity checks.\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n if (pixels == null) {\n throw new Error('pixels passed to tf.browser.fromPixels() can not be null');\n }\n let isPixelData = false;\n let isImageData = false;\n let isVideo = false;\n let isImage = false;\n let isCanvasLike = false;\n let isImageBitmap = false;\n if ((pixels as PixelData).data instanceof Uint8Array) {\n isPixelData = true;\n } else if (\n typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) {\n isImageData = true;\n } else if (\n typeof (HTMLVideoElement) !== 'undefined' &&\n pixels instanceof HTMLVideoElement) {\n isVideo = true;\n } else if (\n typeof (HTMLImageElement) !== 'undefined' &&\n pixels instanceof HTMLImageElement) {\n isImage = true;\n // tslint:disable-next-line: no-any\n } else if ((pixels as any).getContext != null) {\n isCanvasLike = true;\n } else if (\n typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) {\n isImageBitmap = true;\n } else {\n throw new Error(\n 'pixels passed to tf.browser.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` +\n `in browser, or OffscreenCanvas, ImageData in webworker` +\n ` or {data: Uint32Array, width: number, height: number}, ` +\n `but was ${(pixels as {}).constructor.name}`);\n }\n if (isVideo) {\n const HAVE_CURRENT_DATA_READY_STATE = 2;\n if (isVideo &&\n (pixels as HTMLVideoElement).readyState <\n HAVE_CURRENT_DATA_READY_STATE) {\n throw new Error(\n 'The video element has not loaded data yet. Please wait for ' +\n '`loadeddata` event on the