/** * ONNX weight parser for paddleocr-webgpu. * * The hand-rolled protobuf walker used to fail on PaddleOCRv6 exports * because of subtle field-number / wire-type edge cases in attribute and * TensorProto encoding. This version enforces strict bounds and * short-circuits on any anomaly. */ export interface OnnxTensor { name: string; dims: number[]; dataType: number; rawData: Uint8Array; } /** * Minimal ONNX protobuf parser. Reads only what we need (initializer * TensorProtos) and discards everything else after recording it for sanity. */ export declare class OnnxParser { private buffer; private view; constructor(buffer: ArrayBuffer); /** Parse all initializer tensors from the ONNX model. */ parseInitializers(): Map; /** * Decode a TensorProto between [start, end). Strictly bound-checked and * resilient to malformed payloads. */ private parseTensorProto; /** Read a LEB128 varint starting at offset. Returns { value, end }. */ private readVarint; /** Read a protobuf tag (field + wire-type) at offset. Backwards compat. */ private readTag; /** * Backwards-compatible alias of skipWireType that accepts a tag-shape with * `{ fieldNumber, wireType, dataStart }` — what's used by the engine's * NodeProto / AttributeProto walk. */ private skipField; /** Skip a single field's value at dataStart for the given wire type. */ private skipWireType; /** Skip a top-level field encoded at `offset`. */ private skipVarintField; private findField; } /** Float16 → float32 conversion. */ export declare function float16ToFloat32(f16: Uint16Array): Float32Array; /** Static typed-array body copy. */ export declare function copyTypedArray(src: Float32Array, dst: Float32Array): void; //# sourceMappingURL=onnx.d.ts.map