@genai-fi/nanogpt 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Generator.js +30 -30
- package/dist/{RealDiv-ioj6Z-ox.js → RealDiv-CGwv0liw.js} +9 -9
- package/dist/{Reshape-BZC-ebeR.js → Reshape-BW__R4mZ.js} +7 -7
- package/dist/{Reshape-pwprEaej.js → Reshape-CPBkTIH2.js} +1 -1
- package/dist/TeachableLLM.js +17 -17
- package/dist/Trainer.js +97 -95
- package/dist/{axis_util-QWWgLjut.js → axis_util-GTVlo58H.js} +1 -1
- package/dist/backend.js +2 -2
- package/dist/{backend_util-qwSFfxYx.js → backend_util-GaFarB78.js} +21 -21
- package/dist/{backend_webgpu-DI2wXEC2.js → backend_webgpu-BqASlsbV.js} +8 -8
- package/dist/{broadcast_to-C_EJTVTZ.js → broadcast_to-eS93CCN_.js} +2 -2
- package/dist/checks/appendCache.js +2 -2
- package/dist/checks/attentionMask.js +5 -5
- package/dist/checks/gelu.js +2 -2
- package/dist/checks/matMulGelu.js +2 -2
- package/dist/checks/normRMS.js +6 -6
- package/dist/checks/normRMSGrad.js +3 -3
- package/dist/checks/packUnpack.js +6 -6
- package/dist/checks/qkv.js +2 -2
- package/dist/checks/rope.js +2 -2
- package/dist/{clip_by_value-CLAD4h_I.js → clip_by_value-DDA7rrcT.js} +1 -1
- package/dist/complex-DI35Q-gW.js +11 -0
- package/dist/{concat-Dqk7Xk7h.js → concat-CAQpCret.js} +5 -5
- package/dist/{concat_util-C1Mxe27t.js → concat_util-D18dJ4fD.js} +1 -1
- package/dist/{dataset-DlqAN81i.js → dataset-CGGp1z9P.js} +3 -3
- package/dist/{dropout_util-N0z8Os-K.js → dropout_util--NxWuYg2.js} +1 -1
- package/dist/{expand_dims-D0rBtgT1.js → expand_dims-Bkd1YD5x.js} +4 -4
- package/dist/{exports_initializers-DIOZQt_L.js → exports_initializers-CYzKLjN7.js} +1 -1
- package/dist/{floor-CymuCmTO.js → floor-BQtb-Azg.js} +1 -1
- package/dist/{gather-DEyjXNb1.js → gather-qIqEqaGn.js} +1 -1
- package/dist/{gelu-DpTCC3eB.js → gelu-B220X1Go.js} +1 -1
- package/dist/{gpgpu_math-3bCb5ooU.js → gpgpu_math-BwvV12df.js} +25 -25
- package/dist/{index-DSGwv2Yx.js → index-CUXkjxiT.js} +33 -33
- package/dist/{index-BQvB7LCC.js → index-CjOWnMXP.js} +15 -15
- package/dist/{kernel_funcs_utils-DGqzNlHT.js → kernel_funcs_utils-pq0CK9co.js} +6 -6
- package/dist/layers/BaseLayer.js +4 -4
- package/dist/layers/CausalSelfAttention.d.ts +1 -0
- package/dist/layers/CausalSelfAttention.js +14 -14
- package/dist/layers/LoRA.js +4 -4
- package/dist/layers/MLP.js +4 -4
- package/dist/layers/PositionEmbedding.js +5 -5
- package/dist/layers/RMSNorm.js +3 -3
- package/dist/layers/RoPECache.js +4 -4
- package/dist/layers/TiedEmbedding.js +6 -6
- package/dist/layers/TransformerBlock.d.ts +1 -0
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/layers/WeightStore.js +2 -2
- package/dist/loader/loadTransformers.js +1 -1
- package/dist/loader/oldZipLoad.js +9 -9
- package/dist/loader/save.js +38 -31
- package/dist/main.js +9 -9
- package/dist/{matMul16-BIT70Vya.js → matMul16-BcVC_E62.js} +3 -3
- package/dist/{matMulGelu-CsZnh18H.js → matMulGelu-JNLZqKQp.js} +18 -18
- package/dist/mat_mul-DhG0Newp.js +11 -0
- package/dist/mod-CSdCpRjf.js +11 -0
- package/dist/models/NanoGPTV1.js +2 -2
- package/dist/models/NanoGPTV2.js +2 -2
- package/dist/models/model.d.ts +1 -0
- package/dist/models/model.js +9 -9
- package/dist/{not_equal-CkQKkKZy.js → not_equal-hurPF26l.js} +15 -15
- package/dist/{ones-DbVB5N58.js → ones-BytntneX.js} +3 -3
- package/dist/ops/adamAdjust.js +3 -3
- package/dist/ops/adamMoments.js +3 -3
- package/dist/ops/add16.js +1 -1
- package/dist/ops/appendCache.js +6 -6
- package/dist/ops/attentionMask.js +3 -3
- package/dist/ops/concat16.js +3 -3
- package/dist/ops/cpu/adamAdjust.js +9 -9
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +2 -2
- package/dist/ops/cpu/attentionMask.js +6 -6
- package/dist/ops/cpu/fusedSoftmax.js +4 -4
- package/dist/ops/cpu/gatherSub.js +5 -5
- package/dist/ops/cpu/gelu.js +4 -4
- package/dist/ops/cpu/matMul16.js +2 -2
- package/dist/ops/cpu/matMulGelu.js +7 -7
- package/dist/ops/cpu/matMulMul.js +2 -2
- package/dist/ops/cpu/mulDropout.js +5 -5
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +3 -3
- package/dist/ops/cpu/rope.js +5 -5
- package/dist/ops/cpu/scatterSub.js +5 -5
- package/dist/ops/dot16.js +2 -2
- package/dist/ops/dropout.js +6 -6
- package/dist/ops/dropout16.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +2 -2
- package/dist/ops/globalNorm.js +7 -7
- package/dist/ops/grads/add16.js +1 -1
- package/dist/ops/grads/attentionMask.js +2 -2
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +2 -2
- package/dist/ops/grads/matMul16.js +3 -3
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +7 -7
- package/dist/ops/grads/pack16.js +3 -3
- package/dist/ops/grads/qkv.js +11 -11
- package/dist/ops/grads/rope.js +2 -2
- package/dist/ops/grads/softmax16.js +1 -1
- package/dist/ops/grads/unpack16.js +2 -2
- package/dist/ops/matMul16.js +3 -3
- package/dist/ops/matMulGelu.js +6 -6
- package/dist/ops/matMulMul.js +3 -3
- package/dist/ops/mul16.js +1 -1
- package/dist/ops/mulDrop.js +3 -3
- package/dist/ops/normRMS.js +4 -4
- package/dist/ops/pack16.js +2 -2
- package/dist/ops/qkv.js +3 -3
- package/dist/ops/reshape16.js +6 -6
- package/dist/ops/rope.js +2 -2
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/slice16.js +2 -2
- package/dist/ops/softmax16.js +1 -1
- package/dist/ops/sub16.js +1 -1
- package/dist/ops/sum16.js +6 -6
- package/dist/ops/transpose16.js +3 -3
- package/dist/ops/unpack16.js +2 -2
- package/dist/ops/webgl/adamAdjust.js +2 -2
- package/dist/ops/webgl/adamMoments.js +1 -1
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/dropout16.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +7 -7
- package/dist/ops/webgl/gatherSub.js +3 -3
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMul16.js +13 -13
- package/dist/ops/webgl/matMulGelu.js +4 -4
- package/dist/ops/webgl/matMulMul.js +2 -2
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +2 -2
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +2 -2
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/add16.js +6 -6
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +2 -2
- package/dist/ops/webgpu/attentionMask32_program.js +2 -2
- package/dist/ops/webgpu/clipScale.js +7 -7
- package/dist/ops/webgpu/concat16.js +5 -5
- package/dist/ops/webgpu/dropout16.js +6 -6
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +8 -8
- package/dist/ops/webgpu/matMul16.js +16 -16
- package/dist/ops/webgpu/matMul16_program.js +2 -2
- package/dist/ops/webgpu/mul16.js +5 -5
- package/dist/ops/webgpu/norm2.js +1 -1
- package/dist/ops/webgpu/normRMS.js +2 -2
- package/dist/ops/webgpu/normRMSGrad.js +4 -4
- package/dist/ops/webgpu/pack16.js +4 -4
- package/dist/ops/webgpu/pack16_program.js +2 -2
- package/dist/ops/webgpu/qkv.js +2 -2
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/slice16.js +4 -4
- package/dist/ops/webgpu/softmax16.js +4 -4
- package/dist/ops/webgpu/softmax16_program.js +2 -2
- package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
- package/dist/ops/webgpu/softmax16grad.js +4 -4
- package/dist/ops/webgpu/sub16.js +6 -6
- package/dist/ops/webgpu/sum16.js +3 -3
- package/dist/ops/webgpu/transpose16.js +8 -8
- package/dist/ops/webgpu/transpose16_program.js +2 -2
- package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
- package/dist/ops/webgpu/unpack16.js +3 -3
- package/dist/ops/webgpu/utils/binary_op.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +5 -5
- package/dist/{ops-CURIZSVt.js → ops-CsXeTq1P.js} +100 -100
- package/dist/{pack16-WlOSOuZA.js → pack16-bqltoUlR.js} +2 -2
- package/dist/patches/webgpu_backend.js +6 -6
- package/dist/patches/webgpu_base.js +1 -1
- package/dist/patches/webgpu_program.js +2 -2
- package/dist/{random_normal-CIm8lk2-.js → random_normal-IBRrha8a.js} +1 -1
- package/dist/{random_width-B_fVXhGx.js → random_width-DN5ZtQkM.js} +131 -131
- package/dist/{range-BDxO73mk.js → range-C-CjF-LI.js} +1 -1
- package/dist/relu-J_X6MUzx.js +9 -0
- package/dist/{reshape-BIN71H3p.js → reshape-BDOuCSNW.js} +1 -1
- package/dist/{resize_nearest_neighbor-C6_0dAnK.js → resize_nearest_neighbor-BojqlfRe.js} +41 -41
- package/dist/{rope-CC5RjmKU.js → rope-DcrZM_e6.js} +5 -5
- package/dist/{scatter_nd_util-C-x73Cj6.js → scatter_nd_util-ByNJaL6I.js} +1 -1
- package/dist/{segment_util-4zuHV5IG.js → segment_util-Dasb2Zaf.js} +2 -2
- package/dist/{selu_util-BXdhy_W6.js → selu_util-BLhIqRkw.js} +5 -5
- package/dist/{shared-zTaJ5siv.js → shared-3agzAqQ_.js} +1 -1
- package/dist/{shared-DRWDyk9w.js → shared-CagdqkLh.js} +6 -6
- package/dist/slice-BzS11Qh0.js +12 -0
- package/dist/{slice_util-DPY56GzQ.js → slice_util-CC35pLmT.js} +5 -5
- package/dist/{softmax-BLGJqdwx.js → softmax-D4q1LJN7.js} +1 -1
- package/dist/split-C2Sj255c.js +9 -0
- package/dist/{squeeze-O_YWJpw_.js → squeeze-ho4wLUek.js} +2 -2
- package/dist/{stack-z6QE7kmP.js → stack-DudVrtmG.js} +1 -1
- package/dist/{step-DQY6_ABw.js → step-BTxPtq1r.js} +4 -4
- package/dist/{sum-D39FeU5h.js → sum-BpiwSWvg.js} +3 -3
- package/dist/{tensor-D8e0Gd7c.js → tensor-BWFldCso.js} +1 -1
- package/dist/{tensor1d-BMl0eZYV.js → tensor1d-LMGMIUlr.js} +1 -1
- package/dist/{tensor2d-DTtQ1QcT.js → tensor2d-BnXMKScO.js} +1 -1
- package/dist/{tensor4d-Dj4rDssL.js → tensor4d-C6UCG_u8.js} +1 -1
- package/dist/{tfjs_backend-Bk3PmK91.js → tfjs_backend-BGnG-ppu.js} +65 -65
- package/dist/{tile-CsWlVKKz.js → tile-CFy-xTO6.js} +1 -1
- package/dist/tokeniser/BaseTokeniser.d.ts +4 -0
- package/dist/tokeniser/BaseTokeniser.js +61 -56
- package/dist/tokeniser/type.d.ts +8 -0
- package/dist/training/AdamW.js +2 -2
- package/dist/training/BasicTrainer.d.ts +1 -0
- package/dist/training/BasicTrainer.js +95 -79
- package/dist/training/DatasetBuilder.d.ts +6 -2
- package/dist/training/DatasetBuilder.js +60 -41
- package/dist/training/Evaluator.d.ts +1 -2
- package/dist/training/Evaluator.js +21 -31
- package/dist/training/SFTTrainer.d.ts +3 -2
- package/dist/training/SFTTrainer.js +4 -3
- package/dist/training/orthoGrad.js +1 -1
- package/dist/training/sparseCrossEntropy.js +38 -38
- package/dist/training/tasks/ConversationTask.d.ts +4 -0
- package/dist/training/tasks/ConversationTask.js +7 -7
- package/dist/training/tasks/PretrainingTask.d.ts +4 -0
- package/dist/training/tasks/PretrainingTask.js +11 -7
- package/dist/training/tasks/StartSentenceTask.d.ts +4 -0
- package/dist/training/tasks/StartSentenceTask.js +5 -5
- package/dist/training/tasks/Task.d.ts +12 -0
- package/dist/training/tasks/Task.js +55 -31
- package/dist/training/types.d.ts +1 -0
- package/dist/training/validation.d.ts +1 -1
- package/dist/training/validation.js +33 -32
- package/dist/{transpose-Qxz-4os3.js → transpose-9kRxIXWR.js} +7 -7
- package/dist/{unsorted_segment_sum-BfFVV9Zm.js → unsorted_segment_sum-DJvk5xnh.js} +20 -20
- package/dist/utilities/dummy.js +6 -6
- package/dist/utilities/multinomialCPU.js +2 -2
- package/dist/utilities/packed.js +1 -1
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.js +2 -2
- package/dist/utilities/sentences.js +5 -5
- package/dist/utilities/weights.js +2 -2
- package/dist/{variable-SSATClyt.js → variable-Ck482e3n.js} +1 -1
- package/dist/{webgpu_program-CbjdYLYk.js → webgpu_program-B4HmApL1.js} +1 -1
- package/dist/{webgpu_util-DuofJBMo.js → webgpu_util-DYlGSwOJ.js} +7 -7
- package/dist/{zeros-Bw0puq_w.js → zeros-DvZpK8s6.js} +2 -2
- package/dist/{zeros_like-rOHr54NY.js → zeros_like-CWjDdwr-.js} +69 -69
- package/package.json +1 -1
- package/dist/complex-3DpPEG9B.js +0 -11
- package/dist/mat_mul-DP86qZtZ.js +0 -11
- package/dist/mod-BXjLYwvM.js +0 -11
- package/dist/readers-17HLdxVM.js +0 -12
- package/dist/relu-DTvZKBsZ.js +0 -9
- package/dist/slice-BvItlgXu.js +0 -12
- package/dist/split-BN9LkEgS.js +0 -9
- package/dist/training/SFTDatasetBuilder.d.ts +0 -23
- package/dist/training/SFTDatasetBuilder.js +0 -85
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as T, f as L, h as
|
|
3
|
-
import { a as z, c as
|
|
4
|
-
import { c as
|
|
5
|
-
import { S as k, a as Q, b as ee, g as te, c as se, s as ne } from "./selu_util-
|
|
6
|
-
import { c as re, v as oe, a as ie } from "./scatter_nd_util-
|
|
1
|
+
import { U as d, a9 as A, a8 as O, x as g, av as _, az as w, ad as D, _ as x, $ as b, am as y, aY as M } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { d as T, f as L, h as W, c as v, e as F, a as N, b as C, g as P } from "./axis_util-GTVlo58H.js";
|
|
3
|
+
import { a as z, c as U } from "./concat_util-D18dJ4fD.js";
|
|
4
|
+
import { c as B, b as H, d as V, f as G, g as Z, h as j, i as q, j as J, k as K, m as X, t as Y } from "./step-BTxPtq1r.js";
|
|
5
|
+
import { S as k, a as Q, b as ee, g as te, c as se, s as ne } from "./selu_util-BLhIqRkw.js";
|
|
6
|
+
import { c as re, v as oe, a as ie } from "./scatter_nd_util-ByNJaL6I.js";
|
|
7
7
|
import { a as ae, c as ue, b as ce, e as pe, d as le, g as fe, m as he, s as ge } from "./complex_util-Yc1A_gV1.js";
|
|
8
8
|
function de(e, t) {
|
|
9
9
|
const r = e.shape.length, n = t.shape.length;
|
|
@@ -146,10 +146,10 @@ function De(e, t, r) {
|
|
|
146
146
|
return n;
|
|
147
147
|
}
|
|
148
148
|
const xe = 0.3275911, be = 0.254829592, ye = -0.284496736, Me = 1.421413741, Te = -1.453152027, Le = 1.061405429;
|
|
149
|
-
const I = "->",
|
|
150
|
-
function
|
|
149
|
+
const I = "->", We = /->/g, E = ",", $ = "...";
|
|
150
|
+
function ve(e, t) {
|
|
151
151
|
e = e.replace(/\s/g, "");
|
|
152
|
-
const r = (e.length - e.replace(
|
|
152
|
+
const r = (e.length - e.replace(We, "").length) / I.length;
|
|
153
153
|
if (r < 1)
|
|
154
154
|
throw new Error("Equations without an arrow are not supported.");
|
|
155
155
|
if (r > 1)
|
|
@@ -226,7 +226,7 @@ function ze(e, t) {
|
|
|
226
226
|
(e[n].length === 0 || e[n].indexOf(t) !== -1 || t === -1) && r.push(n);
|
|
227
227
|
return r;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ue(e, t, r = 0) {
|
|
230
230
|
let n = [];
|
|
231
231
|
if (typeof t == "number")
|
|
232
232
|
g(e.shape[r] % t === 0, () => "Number of splits must evenly divide the axis."), n = new Array(t).fill(e.shape[r] / t);
|
|
@@ -242,7 +242,7 @@ function Be(e, t, r = 0) {
|
|
|
242
242
|
}
|
|
243
243
|
return n;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Be(e) {
|
|
246
246
|
return `Received SparseTensor with denseShape[0] = 0 but
|
|
247
247
|
indices.shape[0] = ${e}`;
|
|
248
248
|
}
|
|
@@ -314,8 +314,8 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
314
314
|
axesAreInnerMostDims: L,
|
|
315
315
|
calculateShapes: re,
|
|
316
316
|
checkEinsumDimSizes: Ne,
|
|
317
|
-
checkPadOnDimRoundingMode:
|
|
318
|
-
combineLocations:
|
|
317
|
+
checkPadOnDimRoundingMode: B,
|
|
318
|
+
combineLocations: W,
|
|
319
319
|
combineRaggedTensorToTensorShapes: me,
|
|
320
320
|
complexWithEvenIndex: ue,
|
|
321
321
|
complexWithOddIndex: ce,
|
|
@@ -324,12 +324,12 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
324
324
|
computeDefaultPad: G,
|
|
325
325
|
computeDilation2DInfo: Z,
|
|
326
326
|
computeOptimalWindowSize: Se,
|
|
327
|
-
computeOutAndReduceShapes:
|
|
328
|
-
computeOutShape:
|
|
327
|
+
computeOutAndReduceShapes: v,
|
|
328
|
+
computeOutShape: U,
|
|
329
329
|
computePool2DInfo: j,
|
|
330
330
|
computePool3DInfo: q,
|
|
331
331
|
convertConv2DDataFormat: J,
|
|
332
|
-
decodeEinsumEquation:
|
|
332
|
+
decodeEinsumEquation: ve,
|
|
333
333
|
eitherStridesOrDilationsAreOne: K,
|
|
334
334
|
expandShapeToKeepDim: F,
|
|
335
335
|
exponent: pe,
|
|
@@ -353,7 +353,7 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
353
353
|
getRowPartitionTypesHelper: Ie,
|
|
354
354
|
getSliceBeginCoords: we,
|
|
355
355
|
getSliceSize: De,
|
|
356
|
-
getSparseFillEmptyRowsIndicesDenseShapeMismatch:
|
|
356
|
+
getSparseFillEmptyRowsIndicesDenseShapeMismatch: Be,
|
|
357
357
|
getSparseFillEmptyRowsNegativeIndexErrorMessage: He,
|
|
358
358
|
getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: Ve,
|
|
359
359
|
getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: je,
|
|
@@ -369,7 +369,7 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
369
369
|
isIdentityPermutation: Pe,
|
|
370
370
|
mergeRealAndImagArrays: he,
|
|
371
371
|
prepareAndValidate: de,
|
|
372
|
-
prepareSplitSize:
|
|
372
|
+
prepareSplitSize: Ue,
|
|
373
373
|
shouldFuse: ne,
|
|
374
374
|
splitRealAndImagArrays: ge,
|
|
375
375
|
stridesOrDilationsArePositive: X,
|
|
@@ -386,14 +386,14 @@ export {
|
|
|
386
386
|
we as C,
|
|
387
387
|
De as D,
|
|
388
388
|
xe as E,
|
|
389
|
-
|
|
389
|
+
ve as F,
|
|
390
390
|
Ne as G,
|
|
391
391
|
Ce as H,
|
|
392
392
|
Fe as I,
|
|
393
393
|
Pe as J,
|
|
394
394
|
de as K,
|
|
395
395
|
Re as L,
|
|
396
|
-
|
|
396
|
+
Ue as M,
|
|
397
397
|
S as P,
|
|
398
398
|
f as R,
|
|
399
399
|
Ee as a,
|
|
@@ -403,7 +403,7 @@ export {
|
|
|
403
403
|
et as e,
|
|
404
404
|
Qe as f,
|
|
405
405
|
Ie as g,
|
|
406
|
-
|
|
406
|
+
Be as h,
|
|
407
407
|
He as i,
|
|
408
408
|
Ve as j,
|
|
409
409
|
Ge as k,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ab as g, as as $, at as K,
|
|
2
|
-
import { m as te, f as se, P as re } from "./webgpu_program-
|
|
3
|
-
import { i as ne, G as
|
|
4
|
-
import { m as
|
|
1
|
+
import { ab as g, as as $, at as K, h as D, x as _, au as O, U as x, av as Z, a5 as W, aw as F, ax as j, ay as X, az as J, af as ee, a9 as k } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { m as te, f as se, P as re } from "./webgpu_program-B4HmApL1.js";
|
|
3
|
+
import { i as ne, G as q } from "./webgpu_util-DYlGSwOJ.js";
|
|
4
|
+
import { m as N } from "./complex_util-Yc1A_gV1.js";
|
|
5
5
|
const d = g();
|
|
6
6
|
d.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE", () => 15);
|
|
7
7
|
d.registerFlag("WEBGPU_CPU_FORWARD", () => !0);
|
|
@@ -248,7 +248,7 @@ class R extends $ {
|
|
|
248
248
|
if (s != null || t.dtype === "string")
|
|
249
249
|
return s;
|
|
250
250
|
if (t.dtype === "complex64") {
|
|
251
|
-
const E = this.readSync(n.real.dataId), B = this.readSync(n.imag.dataId), y = O(
|
|
251
|
+
const E = this.readSync(n.real.dataId), B = this.readSync(n.imag.dataId), y = O(N(E, B).buffer, "float32");
|
|
252
252
|
return this.convertAndCacheOnCPU(e, y), y;
|
|
253
253
|
}
|
|
254
254
|
this.hasReadSyncWarned || (this.hasReadSyncWarned = !0, console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));
|
|
@@ -309,7 +309,7 @@ class R extends $ {
|
|
|
309
309
|
this.read(t.complexTensorInfos.real.dataId),
|
|
310
310
|
this.read(t.complexTensorInfos.imag.dataId)
|
|
311
311
|
]), a = r[0], i = r[1];
|
|
312
|
-
n =
|
|
312
|
+
n = N(a, i);
|
|
313
313
|
} else {
|
|
314
314
|
const r = await this.getBufferData(t.resource);
|
|
315
315
|
n = O(r, t.dtype);
|
|
@@ -337,7 +337,7 @@ class R extends $ {
|
|
|
337
337
|
refCount: 1,
|
|
338
338
|
external: e.zeroCopy
|
|
339
339
|
});
|
|
340
|
-
const a = this.tensorMap.get(r), i =
|
|
340
|
+
const a = this.tensorMap.get(r), i = q(a.dtype) * x(a.shape);
|
|
341
341
|
if (e.buffer.size < i)
|
|
342
342
|
throw new Error(`GPUBuffer size(${e.buffer.size}) is smaller than tensor size(${i})!`);
|
|
343
343
|
if ((e.buffer.usage & (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC)) !== (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC))
|
|
@@ -398,7 +398,7 @@ class R extends $ {
|
|
|
398
398
|
const t = this.tensorMap.get(e);
|
|
399
399
|
if (t.resource != null)
|
|
400
400
|
return;
|
|
401
|
-
const s =
|
|
401
|
+
const s = q(t.dtype) * x(t.shape);
|
|
402
402
|
let n;
|
|
403
403
|
const r = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST;
|
|
404
404
|
if (t.values) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as h,
|
|
2
|
-
import { r as b } from "./reshape-
|
|
1
|
+
import { o as h, q as f, u as p, w as g, E as u, T } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { r as b } from "./reshape-BDOuCSNW.js";
|
|
3
3
|
function m(e, r) {
|
|
4
4
|
let n = f(e, "broadcastTo", "x");
|
|
5
5
|
const a = n.shape;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as i,
|
|
2
|
-
import { t } from "../tensor4d-
|
|
3
|
-
import { t as
|
|
1
|
+
import { s as i, h as a } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t } from "../tensor4d-C6UCG_u8.js";
|
|
3
|
+
import { t as e } from "../tensor2d-BnXMKScO.js";
|
|
4
4
|
async function k(n) {
|
|
5
5
|
await i(n);
|
|
6
6
|
const s = t(
|
|
@@ -23,14 +23,14 @@ async function k(n) {
|
|
|
23
23
|
]
|
|
24
24
|
],
|
|
25
25
|
[1, 1, 2, 4]
|
|
26
|
-
), r =
|
|
26
|
+
), r = e(
|
|
27
27
|
[
|
|
28
28
|
[0, -1 / 0, -1 / 0, -1 / 0],
|
|
29
29
|
[0, 0, 0, -1 / 0]
|
|
30
30
|
],
|
|
31
31
|
[2, 4]
|
|
32
32
|
);
|
|
33
|
-
return await
|
|
33
|
+
return await a().runKernel("AttentionMask", { q: s, k: o, mask: r }, { divisor: 0.5, pastLen: 0 }).array();
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
36
|
k as execute
|
package/dist/checks/gelu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as e,
|
|
2
|
-
import { t as s } from "../tensor2d-
|
|
1
|
+
import { s as e, h as o } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as s } from "../tensor2d-BnXMKScO.js";
|
|
3
3
|
async function m(t) {
|
|
4
4
|
await e(t);
|
|
5
5
|
const r = s(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as o,
|
|
2
|
-
import { t as e } from "../tensor2d-
|
|
1
|
+
import { s as o, h as s } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as e } from "../tensor2d-BnXMKScO.js";
|
|
3
3
|
async function i(t) {
|
|
4
4
|
await o(t);
|
|
5
5
|
const r = e(
|
package/dist/checks/normRMS.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { s as u, a0 as A,
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as p } from "../tensor1d-
|
|
4
|
-
import { t as r } from "../tensor-
|
|
1
|
+
import { s as u, a0 as A, h } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { a as y } from "../ops-CsXeTq1P.js";
|
|
3
|
+
import { t as p } from "../tensor1d-LMGMIUlr.js";
|
|
4
|
+
import { t as r } from "../tensor-BWFldCso.js";
|
|
5
5
|
const w = Array.from({ length: 2048 * 192 }, () => Math.random()), x = Array.from({ length: 192 }, () => Math.random()), M = Array.from({ length: 2048 * 192 }, () => Math.random());
|
|
6
6
|
async function k(t) {
|
|
7
7
|
await u(t);
|
|
8
8
|
const o = p(x, "float32"), n = r(w, [16, 128, 192], "float32"), s = r(M, [16, 128, 192], "float32"), e = (d, g) => {
|
|
9
|
-
const i =
|
|
10
|
-
return
|
|
9
|
+
const i = h().runKernel("RMSNorm", { x: d, gamma: g });
|
|
10
|
+
return y.meanSquaredError(i, s);
|
|
11
11
|
}, { value: m, grads: a } = A(e)([n, o]), c = await m.array(), f = await a[0].array(), l = await a[1].array();
|
|
12
12
|
return [c, f, l];
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as c,
|
|
2
|
-
import { t as f } from "../tensor1d-
|
|
3
|
-
import { t as r } from "../tensor-
|
|
1
|
+
import { s as c, h as d } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as f } from "../tensor1d-LMGMIUlr.js";
|
|
3
|
+
import { t as r } from "../tensor-BWFldCso.js";
|
|
4
4
|
const y = Array.from({ length: 2048 * 192 }, () => Math.random()), i = Array.from({ length: 192 }, () => Math.random()), l = Array.from({ length: 2048 * 192 }, () => Math.random());
|
|
5
5
|
async function x(t) {
|
|
6
6
|
await c(t);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as a,
|
|
2
|
-
import { t as c } from "../tensor2d-
|
|
3
|
-
async function i(
|
|
4
|
-
await a(
|
|
1
|
+
import { s as a, h as n } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as c } from "../tensor2d-BnXMKScO.js";
|
|
3
|
+
async function i(e) {
|
|
4
|
+
await a(e);
|
|
5
5
|
const r = c(
|
|
6
6
|
[
|
|
7
7
|
[0.1, 0.2, 0, 0, 1230, 1232331234, -12234234],
|
|
@@ -10,8 +10,8 @@ async function i(n) {
|
|
|
10
10
|
[0, 0, 0, 0, -0.1, 1e-3, 0]
|
|
11
11
|
],
|
|
12
12
|
[4, 7]
|
|
13
|
-
), t =
|
|
14
|
-
return await
|
|
13
|
+
), t = n().runKernel("Pack16", { x: r });
|
|
14
|
+
return await n().runKernel("Unpack16", { x: t }).array();
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
i as execute
|
package/dist/checks/qkv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as f } from "../tensor2d-
|
|
1
|
+
import { W as i, X as u, Y as c, s as l, h } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as f } from "../tensor2d-BnXMKScO.js";
|
|
3
3
|
function m(t, e, n) {
|
|
4
4
|
if (i(t), e != null && e.length !== 3)
|
|
5
5
|
throw new Error("tensor3d() requires shape to have three numbers");
|
package/dist/checks/rope.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import s from "../layers/RoPECache.js";
|
|
2
|
-
import { s as c,
|
|
3
|
-
import { t as p } from "../tensor4d-
|
|
2
|
+
import { s as c, h as i } from "../index-CUXkjxiT.js";
|
|
3
|
+
import { t as p } from "../tensor4d-C6UCG_u8.js";
|
|
4
4
|
async function f(r) {
|
|
5
5
|
await c(r);
|
|
6
6
|
const n = p(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as a,
|
|
1
|
+
import { o as a, q as f, x as m, f as y, E as c, C as p } from "./index-CUXkjxiT.js";
|
|
2
2
|
function u(o, s, t) {
|
|
3
3
|
const r = f(o, "x", "clipByValue");
|
|
4
4
|
if (m(s <= t, () => `Error in clip: min (${s}) must be less than or equal to max (${t}).`), s === t)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { o as c, q as s, a6 as n, E as m, a7 as r } from "./index-CUXkjxiT.js";
|
|
2
|
+
function l(o, p) {
|
|
3
|
+
const a = s(o, "real", "complex"), e = s(p, "imag", "complex");
|
|
4
|
+
n(a.shape, e.shape, `real and imag shapes, ${a.shape} and ${e.shape}, must match in call to tf.complex().`);
|
|
5
|
+
const t = { real: a, imag: e };
|
|
6
|
+
return m.runKernel(r, t);
|
|
7
|
+
}
|
|
8
|
+
const i = /* @__PURE__ */ c({ complex_: l });
|
|
9
|
+
export {
|
|
10
|
+
i as c
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as s,
|
|
2
|
-
function
|
|
1
|
+
import { o as s, x as a, y as p, w as i, E as l, z as f } from "./index-CUXkjxiT.js";
|
|
2
|
+
function h(o, e = 0) {
|
|
3
3
|
a(o.length >= 1, () => "Pass at least one tensor to concat");
|
|
4
4
|
const t = p(o, "tensors", "concat", "string_or_numeric");
|
|
5
5
|
if (t[0].dtype === "complex64" && t.forEach((n) => {
|
|
@@ -9,9 +9,9 @@ function f(o, e = 0) {
|
|
|
9
9
|
}), t.length === 1)
|
|
10
10
|
return i(t[0]);
|
|
11
11
|
const r = t, c = { axis: e };
|
|
12
|
-
return l.runKernel(
|
|
12
|
+
return l.runKernel(f, r, c);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const u = /* @__PURE__ */ s({ concat_: h });
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
u as c
|
|
17
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ag as h, aA as S, ab as N,
|
|
1
|
+
import { ag as h, aA as S, ab as N, d as v, aB as o, aC as p, aD as g, x as k, t as y } from "./index-CUXkjxiT.js";
|
|
2
2
|
import { s as R } from "./index-CieiGp4Y.js";
|
|
3
|
-
import { s as B } from "./stack-
|
|
4
|
-
import { t as $ } from "./tensor-
|
|
3
|
+
import { s as B } from "./stack-DudVrtmG.js";
|
|
4
|
+
import { t as $ } from "./tensor-BWFldCso.js";
|
|
5
5
|
function _(s, t) {
|
|
6
6
|
return b(s, t);
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { o as e,
|
|
2
|
-
function
|
|
1
|
+
import { o as e, q as a, x as i, E as m, A as p } from "./index-CUXkjxiT.js";
|
|
2
|
+
function x(t, n = 0) {
|
|
3
3
|
const s = a(t, "x", "expandDims", "string_or_numeric");
|
|
4
4
|
i(n <= s.rank, () => "Axis must be <= rank of the tensor");
|
|
5
5
|
const r = { input: s }, o = { dim: n };
|
|
6
6
|
return m.runKernel(p, r, o);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const u = /* @__PURE__ */ e({ expandDims_: x });
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
u as e
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as g,
|
|
1
|
+
import { o as g, q as t, E as h, G as p } from "./index-CUXkjxiT.js";
|
|
2
2
|
function u(n, s, r = 0, e = 0) {
|
|
3
3
|
const o = t(n, "x", "gather"), a = t(s, "indices", "gather", "int32"), c = { x: o, indices: a }, i = { axis: r, batchDims: e };
|
|
4
4
|
return h.runKernel(p, c, i);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ab as $,
|
|
2
|
-
import { b as se } from "./backend_util-
|
|
1
|
+
import { ab as $, U as E, aR as X, ac as T, aS as ae, K as N, aT as G, x as ie, a9 as k, ad as ce } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { b as se } from "./backend_util-GaFarB78.js";
|
|
3
3
|
const w = {}, M = {
|
|
4
4
|
alpha: !1,
|
|
5
5
|
antialias: !1,
|
|
@@ -215,7 +215,7 @@ function Ot(e, t, n) {
|
|
|
215
215
|
function It(e, t) {
|
|
216
216
|
v(e, () => e.bindFramebuffer(e.FRAMEBUFFER, t)), v(e, () => e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, null, 0));
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Ut(e) {
|
|
219
219
|
const t = e.checkFramebufferStatus(e.FRAMEBUFFER);
|
|
220
220
|
if (t !== e.FRAMEBUFFER_COMPLETE)
|
|
221
221
|
throw new Error("Error binding framebuffer: " + Se(e, t));
|
|
@@ -258,7 +258,7 @@ function J(e) {
|
|
|
258
258
|
e[e.length - 1]
|
|
259
259
|
];
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function Lt(e) {
|
|
262
262
|
let t = [1, 1, 1];
|
|
263
263
|
return e.length === 0 || e.length === 1 && e[0] === 1 || (t = [Z(e), ...J(e)]), t;
|
|
264
264
|
}
|
|
@@ -378,7 +378,7 @@ function Xt(e, t) {
|
|
|
378
378
|
n != null && ie(n.dtype !== "complex64", () => `${t} does not support complex64 tensors in the WebGL backend.`);
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function U() {
|
|
382
382
|
let e, t, n, r, o, a, i, c, s, l;
|
|
383
383
|
return $().getNumber("WEBGL_VERSION") === 2 ? (e = "#version 300 es", t = "in", n = "out", r = "in", o = "texture", a = "outputColor", i = "out vec4 outputColor;", c = $().getBool("WEBGL2_ISNAN_CUSTOM") ? `
|
|
384
384
|
bool isnan_custom(float val) {
|
|
@@ -567,8 +567,8 @@ function Fe(e, t, n) {
|
|
|
567
567
|
});
|
|
568
568
|
const o = r.join(`
|
|
569
569
|
`), a = e.map((x) => _e(x, t, n.packedInputs, n.enableShapeUniforms)).join(`
|
|
570
|
-
`), i = t.texShape, c =
|
|
571
|
-
let l, u, f =
|
|
570
|
+
`), i = t.texShape, c = U(), s = Ne(c);
|
|
571
|
+
let l, u, f = Ue(c);
|
|
572
572
|
return t.isPacked ? (l = Ae(t.logicalShape, i, n.enableShapeUniforms), u = Ie(c)) : (l = we(t.logicalShape, i, n.enableShapeUniforms), u = Oe(c)), n.packedInputs && (f += be), [
|
|
573
573
|
f,
|
|
574
574
|
s,
|
|
@@ -580,7 +580,7 @@ function Fe(e, t, n) {
|
|
|
580
580
|
].join(`
|
|
581
581
|
`);
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function L(e, t = !1) {
|
|
584
584
|
const n = e.shapeInfo.logicalShape;
|
|
585
585
|
switch (n.length) {
|
|
586
586
|
case 0:
|
|
@@ -617,7 +617,7 @@ function te(e, t) {
|
|
|
617
617
|
}
|
|
618
618
|
function _e(e, t, n = !1, r) {
|
|
619
619
|
let o = "";
|
|
620
|
-
n ? o += te(e, r) : o +=
|
|
620
|
+
n ? o += te(e, r) : o += L(e, r);
|
|
621
621
|
const a = e.shapeInfo.logicalShape, i = t.logicalShape;
|
|
622
622
|
return a.length <= i.length && (n ? o += ot(e, t) : o += at(e, t)), o;
|
|
623
623
|
}
|
|
@@ -676,7 +676,7 @@ function Ie(e) {
|
|
|
676
676
|
}
|
|
677
677
|
`;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Ue(e) {
|
|
680
680
|
return `${e.version}
|
|
681
681
|
precision highp float;
|
|
682
682
|
precision highp int;
|
|
@@ -732,12 +732,12 @@ function Le(e) {
|
|
|
732
732
|
return fract((p3.x + p3.y) * p3.z);
|
|
733
733
|
}
|
|
734
734
|
|
|
735
|
-
${
|
|
735
|
+
${Le}
|
|
736
736
|
${De}
|
|
737
737
|
${ge}
|
|
738
738
|
`;
|
|
739
739
|
}
|
|
740
|
-
const
|
|
740
|
+
const Le = `
|
|
741
741
|
vec2 uvFromFlat(int texNumR, int texNumC, int index) {
|
|
742
742
|
int texR = index / texNumC;
|
|
743
743
|
int texC = index - texR * texNumC;
|
|
@@ -1112,7 +1112,7 @@ function O(e) {
|
|
|
1112
1112
|
return `offset${e}`;
|
|
1113
1113
|
}
|
|
1114
1114
|
function He(e) {
|
|
1115
|
-
const t = e.name, n = "get" + t.charAt(0).toUpperCase() + t.slice(1), r =
|
|
1115
|
+
const t = e.name, n = "get" + t.charAt(0).toUpperCase() + t.slice(1), r = U();
|
|
1116
1116
|
return `
|
|
1117
1117
|
vec4 ${n}() {
|
|
1118
1118
|
return ${r.texture2D}(${t}, halfCR);
|
|
@@ -1147,7 +1147,7 @@ function qe(e, t) {
|
|
|
1147
1147
|
`;
|
|
1148
1148
|
}
|
|
1149
1149
|
function je(e, t) {
|
|
1150
|
-
const n = e.name, r = "get" + n.charAt(0).toUpperCase() + n.slice(1), o = e.shapeInfo.texShape, a =
|
|
1150
|
+
const n = e.name, r = "get" + n.charAt(0).toUpperCase() + n.slice(1), o = e.shapeInfo.texShape, a = U();
|
|
1151
1151
|
if (t)
|
|
1152
1152
|
return `
|
|
1153
1153
|
vec4 ${r}(int index) {
|
|
@@ -1215,7 +1215,7 @@ function Ye(e, t) {
|
|
|
1215
1215
|
`;
|
|
1216
1216
|
}
|
|
1217
1217
|
function Ke(e, t) {
|
|
1218
|
-
const n = e.shapeInfo.logicalShape, r = e.name, o = "get" + r.charAt(0).toUpperCase() + r.slice(1), a = e.shapeInfo.texShape, i = a[0], c = a[1], s =
|
|
1218
|
+
const n = e.shapeInfo.logicalShape, r = e.name, o = "get" + r.charAt(0).toUpperCase() + r.slice(1), a = e.shapeInfo.texShape, i = a[0], c = a[1], s = U();
|
|
1219
1219
|
if (a != null && T(n, a))
|
|
1220
1220
|
return t ? `
|
|
1221
1221
|
vec4 ${o}(int row, int col) {
|
|
@@ -1269,7 +1269,7 @@ function Ze(e, t) {
|
|
|
1269
1269
|
if (s.length < n.length) {
|
|
1270
1270
|
const d = g(e, s), x = ["row", "col"];
|
|
1271
1271
|
return `
|
|
1272
|
-
${
|
|
1272
|
+
${L(d, t)}
|
|
1273
1273
|
float ${o}(int row, int col) {
|
|
1274
1274
|
return ${o}(${b(x, c)});
|
|
1275
1275
|
}
|
|
@@ -1334,7 +1334,7 @@ function Je(e, t) {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
`;
|
|
1336
1336
|
}
|
|
1337
|
-
const c =
|
|
1337
|
+
const c = U();
|
|
1338
1338
|
if (t)
|
|
1339
1339
|
return `
|
|
1340
1340
|
vec4 ${o}(int b, int row, int col) {
|
|
@@ -1360,7 +1360,7 @@ function Qe(e, t) {
|
|
|
1360
1360
|
if (l.length < n.length) {
|
|
1361
1361
|
const p = g(e, l), m = ["row", "col", "depth"];
|
|
1362
1362
|
return `
|
|
1363
|
-
${
|
|
1363
|
+
${L(p, t)}
|
|
1364
1364
|
float ${o}(int row, int col, int depth) {
|
|
1365
1365
|
return ${o}(${b(m, s)});
|
|
1366
1366
|
}
|
|
@@ -1430,7 +1430,7 @@ function Qe(e, t) {
|
|
|
1430
1430
|
`;
|
|
1431
1431
|
}
|
|
1432
1432
|
function et(e, t) {
|
|
1433
|
-
const n = e.name, r = "get" + n.charAt(0).toUpperCase() + n.slice(1), o =
|
|
1433
|
+
const n = e.name, r = "get" + n.charAt(0).toUpperCase() + n.slice(1), o = U();
|
|
1434
1434
|
if (t)
|
|
1435
1435
|
return `
|
|
1436
1436
|
vec4 ${r}(int b2, int b, int row, int col) {
|
|
@@ -1464,7 +1464,7 @@ function tt(e, t) {
|
|
|
1464
1464
|
if (s.length < n.length) {
|
|
1465
1465
|
const R = g(e, s), F = ["row", "col", "depth", "depth2"];
|
|
1466
1466
|
return `
|
|
1467
|
-
${
|
|
1467
|
+
${L(R, t)}
|
|
1468
1468
|
float ${o}(int row, int col, int depth, int depth2) {
|
|
1469
1469
|
return ${o}(${b(F, l)});
|
|
1470
1470
|
}
|
|
@@ -1550,7 +1550,7 @@ function nt(e) {
|
|
|
1550
1550
|
if (s.length < t.length) {
|
|
1551
1551
|
const p = g(e, s), m = ["row", "col", "depth", "depth2", "depth3"];
|
|
1552
1552
|
return `
|
|
1553
|
-
${
|
|
1553
|
+
${L(p)}
|
|
1554
1554
|
float ${r}(int row, int col, int depth, int depth2, int depth3) {
|
|
1555
1555
|
return ${r}(${b(m, l)});
|
|
1556
1556
|
}
|
|
@@ -1607,7 +1607,7 @@ function rt(e) {
|
|
|
1607
1607
|
if (o.length < t.length) {
|
|
1608
1608
|
const m = g(e, o), S = ["row", "col", "depth", "depth2", "depth3", "depth4"];
|
|
1609
1609
|
return `
|
|
1610
|
-
${
|
|
1610
|
+
${L(m)}
|
|
1611
1611
|
float ${r}(int row, int col, int depth,
|
|
1612
1612
|
int depth2, int depth3, int depth4) {
|
|
1613
1613
|
return ${r}(${b(S, a)});
|
|
@@ -1979,12 +1979,12 @@ export {
|
|
|
1979
1979
|
wt as O,
|
|
1980
1980
|
H as P,
|
|
1981
1981
|
Nt as Q,
|
|
1982
|
-
|
|
1982
|
+
Ut as R,
|
|
1983
1983
|
Ot as S,
|
|
1984
1984
|
q as T,
|
|
1985
1985
|
ut as U,
|
|
1986
1986
|
j as V,
|
|
1987
|
-
|
|
1987
|
+
Lt as W,
|
|
1988
1988
|
xt as X,
|
|
1989
1989
|
ht as Y,
|
|
1990
1990
|
Yt as Z,
|
|
@@ -2008,7 +2008,7 @@ export {
|
|
|
2008
2008
|
yt as m,
|
|
2009
2009
|
Pt as n,
|
|
2010
2010
|
Vt as o,
|
|
2011
|
-
|
|
2011
|
+
U as p,
|
|
2012
2012
|
Q as q,
|
|
2013
2013
|
St as r,
|
|
2014
2014
|
Rt as s,
|