Registry / ai-ml / tosa-tools

tosa-tools

JSON →
library2026.5.0pypypi✓ verified 81d ago

TOSA Tools is a Python package providing a serialization library, a reference model, and an optional MLIR translator for the Tensor Operator Set Architecture (TOSA). It targets TOSA 1.0 conformance testing and model compilation workflows. Current version is 2026.5.0, released monthly.

pip install tosa-tools
INSTALL
IMPORT
SIG · TOSA-TOOLS
T
tosa-tools
ai-mlpythonv2026.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TosaSerializer
from tosa_serializer import TosaSerializer
from tosa import TosaSerializer

Demonstrates serialization and deserialization of TOSA models using the tosa package.

import os from tosa import TosaSerializer, TosaDeserializer # Serialize a simple TOSA graph serializer = TosaSerializer() # Build graph... (omitted for brevity) # binary = serializer.serialize() # Deserialize from file filename = 'model.tosa' if os.path.exists(filename): deserializer = TosaDeserializer(filename) graph = deserializer.deserialize() print('Graph loaded successfully') else: print('Model file not found')
Debug
Known issues
breakingVersion 2026.5.0 dropped support for Python 3.9; minimum is now Python 3.10.
fix
Upgrade Python to 3.10 or later; pin to tosa-tools<2026.5.0 if stuck on 3.9.
affects: >=2026.5.0
breakingThe TosaSerializer API changed: 'addTensor' renamed to 'add_tensor' and 'addOperator' to 'add_operator' (snake_case alignment).
fix
Update code to use snake_case method names: add_tensor, add_operator.
affects: >=2025.12.0
gotchaImporting from 'tosa_tools' instead of 'tosa' silently fails. Many users try 'import tosa_tools' which succeeds but has no meaningful symbols.
fix
Use 'from tosa import ...' or 'import tosa'.
affects: all
gotchaThe MLIR translator requires the optional 'mlir' package and a compatible MLIR version (>=14). Missing it raises ImportError at runtime.
fix
Install with 'pip install tosa-tools[mlir]' or ensure mlir is on PATH.
affects: all
Upgrade
Version history
2026.5.0latest on PyPI · released May 21, 2026
Audit
Dependencies
numpyrequiredRequired for flatbuffer serialization and reference model tensor operations.
flatbuffersrequiredUsed for serialization and deserialization of TOSA flatbuffer files.
mliroptionalOptional dependency for the MLIR translator; only needed if converting to/from MLIR.
Agent activity
24 hits · last 30 days
node
19
Amazon
1
Bingbot
1
OpenAI (training)
1
Resources

No resource links recorded.