dart_tensor_preprocessing 0.2.0
dart_tensor_preprocessing: ^0.2.0 copied to clipboard
High-performance tensor preprocessing library for Flutter/Dart. NumPy-like transforms pipeline for ONNX Runtime inference.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-01-04 #
Added #
IndexOutOfBoundsException- Thrown when an index or axis is out of valid rangeDTypeMismatchException- Thrown when tensor data types do not match
Changed #
- BREAKING: Unified exception handling across the library
- All exceptions now extend
TensorExceptionsealed class ArgumentError→ShapeMismatchException,InvalidParameterExceptionRangeError→IndexOutOfBoundsExceptionStateError→NonContiguousException,DTypeMismatchException
- All exceptions now extend
- Shape validation now happens before buffer creation in
zeros()andones()
Migration Guide #
If you were catching standard Dart exceptions, update your code:
| Before | After |
|---|---|
on RangeError |
on IndexOutOfBoundsException |
on ArgumentError |
on ShapeMismatchException or on InvalidParameterException |
on StateError |
on NonContiguousException or on DTypeMismatchException |
0.1.4 - 2026-01-04 #
Added #
- Reduction operations for
TensorBuffer:sum()- Returns the sum of all elementsmean()- Returns the arithmetic mean of all elementsmin()- Returns the minimum valuemax()- Returns the maximum value
- Axis-wise reduction operations:
sumAxis(int axis, {bool keepDims})- Sum along a specific axismeanAxis(int axis, {bool keepDims})- Mean along a specific axisminAxis(int axis, {bool keepDims})- Min along a specific axismaxAxis(int axis, {bool keepDims})- Max along a specific axis
- Support for negative axis indexing in axis-wise operations
- Comprehensive test coverage for all reduction operations (49 tests)
0.1.3 - 2026-01-03 #
0.1.1 - 2025-12-27 #
Added #
- Comprehensive dartdoc comments for all public API elements
- Library-level documentation with usage examples
0.1.0 - 2025-12-27 #
Added #
-
Core tensor operations
TensorBufferwith shape, strides, and view/storage separationTensorStoragefor immutable typed data wrapperDTypeenum with ONNX-compatible data types
-
Transform operations
ResizeOpwith nearest, bilinear, bicubic interpolationResizeShortestOpfor aspect-ratio preserving resizeCenterCropOpfor center croppingNormalizeOpwith ImageNet, CIFAR-10, symmetric presetsScaleOpfor value scalingPermuteOpfor axis reorderingToTensorOpfor HWC uint8 to CHW float32 conversionToImageOpfor CHW float32 to HWC uint8 conversionUnsqueezeOp,SqueezeOp,ReshapeOp,FlattenOpfor shape manipulationTypeCastOpfor dtype conversion
-
Pipeline system
TensorPipelinefor chaining operationsPipelinePresetswith ImageNet, ResNet, YOLO, CLIP, ViT, MobileNet presets- Async execution via
Isolate.run
-
Zero-copy operations
transpose()via stride manipulationsqueeze(),unsqueeze()as shape-only changes