@wetron/tflite
v0.0.35
Published
TFLite model parser - extracts graph structure from .tflite flatbuffer files
Maintainers
Readme
@wetron/tflite
TFLite model parser for wetron. Reads .tflite flatbuffer files and returns a ModelGraph IR. Graph structure only - no weight tensors are deserialized.
Install
pnpm add @wetron/tfliteIncluded automatically when you install @wetron/core or @wetron/react.
API
import { parseTflite } from "@wetron/tflite";
const bytes = new Uint8Array(await file.arrayBuffer());
const graph = parseTflite(bytes); // synchronousThrows ParseError from @wetron/common/ir on malformed input.
What gets parsed
- All subgraph operators with op type, inputs, and outputs
- Tensor shapes and dtypes
- Both
TFL3(TFLite) andODLF(LiteRT) magic bytes supported - Custom ops resolved via their
custom_codestring
dtype mapping
| TFLite enum | dtype |
| ----------- | ---------- |
| 0 | float32 |
| 1 | int32 |
| 2 | uint8 |
| 3 | int64 |
| 8 | int8 |
| 9 | float16 |
| 256 | bfloat16 |
