import { a as i } from "../../index-DSGwv2Yx.js";
import p from "./pack16_program.js";
function m(e) {
  const { x: n } = e.inputs, { scaling: a, padding: r } = e.attrs, s = e.backend;
  if (n.shape[n.shape.length - 1] % 2 !== 0)
    throw new Error("Last dimension of input tensor must be even to use Pack16.");
  e.attrs && (e.attrs.originalShape = n.shape);
  const t = new p(n.shape, r), o = a !== 1;
  o && t.useScaling();
  const c = [{ type: "float32", data: [a] }];
  return s.runWebGPUProgram(t, [n], "packedF16", o ? c : void 0);
}
const k = {
  kernelName: "Pack16",
  backendName: "webgpu",
  kernelFunc: m
};
i(k);
