Python
tensorcode 0.4.0a5The reference implementation, on PyTorch. Python 3.11 or newer; install from PyPI with pip.
python -m pip install 'tensorcode[tools]'from tensorcode.program import compile, int32
choose = compile("def choose(a): return 10 if a > 4 else 12",
inputs={"a": int32(min=-128, max=127)})
assert choose.run({"a": 5}) == {"result": 10}
checked = choose.verify(lambda a: 10 if a > 4 else 12)
assert checked["passed"] and checked["cases"] == 256- Compiled numerical programsStart here
- Algorithms across substratesStart here
- Distilled programs and weight patchesStart here
- QuickstartStart here
- Architecture and contractsStart here
- Pretrained toolsStart here
- Tools and pretrained modelsGuides